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_
9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h"
11 #include "base/logging.h"
12 #include "skia/ext/platform_device.h"
13 #include "third_party/skia/include/core/SkRefCnt.h"
14 #include "third_party/skia/include/core/SkTScopedPtr.h"
15 #include "third_party/skia/include/pdf/SkPDFDevice.h"
21 class BitmapPlatformDevice
;
23 class VectorPlatformDeviceSkia
: public PlatformDevice
, public SkPDFDevice
{
25 SK_API
VectorPlatformDeviceSkia(const SkISize
& pageSize
,
26 const SkISize
& contentSize
,
27 const SkMatrix
& initialTransform
);
28 virtual ~VectorPlatformDeviceSkia();
30 // PlatformDevice methods.
31 virtual bool IsNativeFontRenderingAllowed() OVERRIDE
;
33 virtual PlatformSurface
BeginPlatformPaint() OVERRIDE
;
34 virtual void EndPlatformPaint() OVERRIDE
;
36 virtual void DrawToNativeContext(HDC dc
,
39 const RECT
* src_rect
) OVERRIDE
;
40 #elif defined(OS_MACOSX)
41 virtual void DrawToNativeContext(CGContext
* context
,
44 const CGRect
* src_rect
) OVERRIDE
;
45 virtual CGContextRef
GetBitmapContext() OVERRIDE
;
46 #elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_OPENBSD)
47 virtual void DrawToNativeContext(PlatformSurface surface
,
50 const PlatformRect
* src_rect
) OVERRIDE
;
54 SkRefPtr
<BitmapPlatformDevice
> raster_surface_
;
56 DISALLOW_COPY_AND_ASSIGN(VectorPlatformDeviceSkia
);
61 #endif // SKIA_EXT_VECTOR_PLATFORM_DEVICE_SKIA_H_