Roll leveldb from r73 to r75.
[chromium-blink-merge.git] / skia / ext / vector_platform_device_skia.h
blob4a6d2d92921bd0d8c312bcfca3ac9151f3523307
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef SKIA_EXT_VECTOR_PLATFORM_DEVICE_SKIA_H_
6 #define SKIA_EXT_VECTOR_PLATFORM_DEVICE_SKIA_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "base/logging.h"
11 #include "skia/ext/platform_device.h"
12 #include "skia/ext/refptr.h"
13 #include "third_party/skia/include/core/SkTScopedPtr.h"
14 #include "third_party/skia/include/pdf/SkPDFDevice.h"
16 class SkMatrix;
18 namespace skia {
20 class BitmapPlatformDevice;
22 class VectorPlatformDeviceSkia : public SkPDFDevice, public PlatformDevice {
23 public:
24 SK_API VectorPlatformDeviceSkia(const SkISize& pageSize,
25 const SkISize& contentSize,
26 const SkMatrix& initialTransform);
27 virtual ~VectorPlatformDeviceSkia();
29 // PlatformDevice methods.
30 virtual bool SupportsPlatformPaint() OVERRIDE;
32 virtual PlatformSurface BeginPlatformPaint() OVERRIDE;
33 virtual void EndPlatformPaint() OVERRIDE;
34 #if defined(OS_WIN)
35 virtual void DrawToNativeContext(HDC dc,
36 int x,
37 int y,
38 const RECT* src_rect) OVERRIDE;
39 #elif defined(OS_MACOSX)
40 virtual void DrawToNativeContext(CGContext* context,
41 int x,
42 int y,
43 const CGRect* src_rect) OVERRIDE;
44 virtual CGContextRef GetBitmapContext() OVERRIDE;
45 #elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_OPENBSD)
46 virtual void DrawToNativeContext(PlatformSurface surface,
47 int x,
48 int y,
49 const PlatformRect* src_rect) OVERRIDE;
50 #endif
52 private:
53 skia::RefPtr<BitmapPlatformDevice> raster_surface_;
55 DISALLOW_COPY_AND_ASSIGN(VectorPlatformDeviceSkia);
58 } // namespace skia
60 #endif // SKIA_EXT_VECTOR_PLATFORM_DEVICE_SKIA_H_