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/pdf/SkPDFDevice.h"
19 class BitmapPlatformDevice;
21 class VectorPlatformDeviceSkia : public SkPDFDevice, public PlatformDevice {
23 SK_API VectorPlatformDeviceSkia(const SkISize& pageSize,
24 const SkISize& contentSize,
25 const SkMatrix& initialTransform);
26 virtual ~VectorPlatformDeviceSkia();
28 // PlatformDevice methods.
29 virtual bool SupportsPlatformPaint() OVERRIDE;
31 virtual PlatformSurface BeginPlatformPaint() OVERRIDE;
32 virtual void EndPlatformPaint() OVERRIDE;
34 virtual void DrawToNativeContext(HDC dc,
37 const RECT* src_rect) OVERRIDE;
38 #elif defined(OS_MACOSX)
39 virtual void DrawToNativeContext(CGContext* context,
42 const CGRect* src_rect) OVERRIDE;
43 virtual CGContextRef GetBitmapContext() OVERRIDE;
44 #elif defined(OS_POSIX)
45 virtual void DrawToNativeContext(PlatformSurface surface,
48 const PlatformRect* src_rect) OVERRIDE;
52 skia::RefPtr<BitmapPlatformDevice> raster_surface_;
54 DISALLOW_COPY_AND_ASSIGN(VectorPlatformDeviceSkia);
59 #endif // SKIA_EXT_VECTOR_PLATFORM_DEVICE_SKIA_H_