| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef SKIA_EXT_VECTOR_PLATFORM_DEVICE_SKIA_H_ | 5 #ifndef SKIA_EXT_VECTOR_PLATFORM_DEVICE_SKIA_H_ |
| 6 #define SKIA_EXT_VECTOR_PLATFORM_DEVICE_SKIA_H_ | 6 #define SKIA_EXT_VECTOR_PLATFORM_DEVICE_SKIA_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" |
| 10 #include "base/logging.h" | 11 #include "base/logging.h" |
| 11 #include "skia/ext/platform_device.h" | 12 #include "skia/ext/platform_device.h" |
| 12 #include "third_party/skia/include/core/SkRefCnt.h" | 13 #include "third_party/skia/include/core/SkRefCnt.h" |
| 13 #include "third_party/skia/include/core/SkTScopedPtr.h" | 14 #include "third_party/skia/include/core/SkTScopedPtr.h" |
| 14 #include "third_party/skia/include/pdf/SkPDFDevice.h" | 15 #include "third_party/skia/include/pdf/SkPDFDevice.h" |
| 15 | 16 |
| 16 class SkMatrix; | 17 class SkMatrix; |
| 17 | 18 |
| 18 namespace skia { | 19 namespace skia { |
| 19 | 20 |
| 20 class BitmapPlatformDevice; | 21 class BitmapPlatformDevice; |
| 21 | 22 |
| 22 class VectorPlatformDeviceSkia : public PlatformDevice, public SkPDFDevice { | 23 class VectorPlatformDeviceSkia : public PlatformDevice, public SkPDFDevice { |
| 23 public: | 24 public: |
| 24 SK_API VectorPlatformDeviceSkia(const SkISize& pageSize, | 25 SK_API VectorPlatformDeviceSkia(const SkISize& pageSize, |
| 25 const SkISize& contentSize, | 26 const SkISize& contentSize, |
| 26 const SkMatrix& initialTransform); | 27 const SkMatrix& initialTransform); |
| 27 virtual ~VectorPlatformDeviceSkia(); | 28 virtual ~VectorPlatformDeviceSkia(); |
| 28 | 29 |
| 29 // PlatformDevice methods. | 30 // PlatformDevice methods. |
| 30 virtual bool IsNativeFontRenderingAllowed(); | 31 virtual bool IsNativeFontRenderingAllowed() OVERRIDE; |
| 31 | 32 |
| 32 virtual PlatformSurface BeginPlatformPaint(); | 33 virtual PlatformSurface BeginPlatformPaint() OVERRIDE; |
| 33 virtual void EndPlatformPaint(); | 34 virtual void EndPlatformPaint() OVERRIDE; |
| 34 #if defined(OS_WIN) | 35 #if defined(OS_WIN) |
| 35 virtual void DrawToNativeContext(HDC dc, int x, int y, const RECT* src_rect); | 36 virtual void DrawToNativeContext(HDC dc, |
| 37 int x, |
| 38 int y, |
| 39 const RECT* src_rect) OVERRIDE; |
| 36 #elif defined(OS_MACOSX) | 40 #elif defined(OS_MACOSX) |
| 37 virtual void DrawToNativeContext(CGContext* context, int x, int y, | 41 virtual void DrawToNativeContext(CGContext* context, |
| 38 const CGRect* src_rect); | 42 int x, |
| 39 virtual CGContextRef GetBitmapContext(); | 43 int y, |
| 44 const CGRect* src_rect) OVERRIDE; |
| 45 virtual CGContextRef GetBitmapContext() OVERRIDE; |
| 40 #elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_OPENBSD) | 46 #elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_OPENBSD) |
| 41 virtual void DrawToNativeContext(PlatformSurface surface, int x, int y, | 47 virtual void DrawToNativeContext(PlatformSurface surface, |
| 42 const PlatformRect* src_rect); | 48 int x, |
| 49 int y, |
| 50 const PlatformRect* src_rect) OVERRIDE; |
| 43 #endif | 51 #endif |
| 44 | 52 |
| 45 private: | 53 private: |
| 46 SkRefPtr<BitmapPlatformDevice> raster_surface_; | 54 SkRefPtr<BitmapPlatformDevice> raster_surface_; |
| 47 | 55 |
| 48 DISALLOW_COPY_AND_ASSIGN(VectorPlatformDeviceSkia); | 56 DISALLOW_COPY_AND_ASSIGN(VectorPlatformDeviceSkia); |
| 49 }; | 57 }; |
| 50 | 58 |
| 51 } // namespace skia | 59 } // namespace skia |
| 52 | 60 |
| 53 #endif // SKIA_EXT_VECTOR_PLATFORM_DEVICE_SKIA_H_ | 61 #endif // SKIA_EXT_VECTOR_PLATFORM_DEVICE_SKIA_H_ |
| OLD | NEW |