| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PLATFORM_DEVICE_H_ | 5 #ifndef SKIA_EXT_PLATFORM_DEVICE_H_ |
| 6 #define SKIA_EXT_PLATFORM_DEVICE_H_ | 6 #define SKIA_EXT_PLATFORM_DEVICE_H_ |
| 7 | 7 |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #if defined(OS_WIN) | |
| 11 #include <windows.h> | |
| 12 #include <vector> | |
| 13 #endif | |
| 14 | |
| 15 #include "skia/ext/native_drawing_context.h" | 10 #include "skia/ext/native_drawing_context.h" |
| 16 #include "third_party/skia/include/core/SkBitmapDevice.h" | 11 #include "third_party/skia/include/core/SkBitmapDevice.h" |
| 17 #include "third_party/skia/include/core/SkTypes.h" | 12 #include "third_party/skia/include/core/SkTypes.h" |
| 18 | 13 |
| 19 class SkMatrix; | 14 class SkMatrix; |
| 20 | 15 |
| 21 namespace skia { | 16 namespace skia { |
| 22 | 17 |
| 23 class PlatformDevice; | 18 class PlatformDevice; |
| 24 class ScopedPlatformPaint; | 19 class ScopedPlatformPaint; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 43 // It provides the basic interface to implement it either with or without | 38 // It provides the basic interface to implement it either with or without |
| 44 // a bitmap backend. | 39 // a bitmap backend. |
| 45 // | 40 // |
| 46 // PlatformDevice provides an interface which sub-classes of SkBaseDevice can | 41 // PlatformDevice provides an interface which sub-classes of SkBaseDevice can |
| 47 // also provide to allow for drawing by the native platform into the device. | 42 // also provide to allow for drawing by the native platform into the device. |
| 48 // TODO(robertphillips): Once the bitmap-specific entry points are removed | 43 // TODO(robertphillips): Once the bitmap-specific entry points are removed |
| 49 // from SkBaseDevice it might make sense for PlatformDevice to be derived | 44 // from SkBaseDevice it might make sense for PlatformDevice to be derived |
| 50 // from it. | 45 // from it. |
| 51 class SK_API PlatformDevice { | 46 class SK_API PlatformDevice { |
| 52 public: | 47 public: |
| 53 virtual ~PlatformDevice() {} | 48 virtual ~PlatformDevice(); |
| 54 | |
| 55 #if defined(OS_MACOSX) | |
| 56 // The CGContext that corresponds to the bitmap, used for CoreGraphics | |
| 57 // operations drawing into the bitmap. This is possibly heavyweight, so it | |
| 58 // should exist only during one pass of rendering. | |
| 59 virtual CGContextRef GetBitmapContext(const SkMatrix& transform, | |
| 60 const SkIRect& clip_bounds) = 0; | |
| 61 #endif | |
| 62 | 49 |
| 63 private: | 50 private: |
| 64 // The DC that corresponds to the bitmap, used for GDI operations drawing | 51 // The DC that corresponds to the bitmap, used for GDI operations drawing |
| 65 // into the bitmap. This is possibly heavyweight, so it should be existant | 52 // into the bitmap. This is possibly heavyweight, so it should be existant |
| 66 // only during one pass of rendering. | 53 // only during one pass of rendering. |
| 67 virtual NativeDrawingContext BeginPlatformPaint(const SkMatrix& transform, | 54 virtual NativeDrawingContext BeginPlatformPaint(const SkMatrix& transform, |
| 68 const SkIRect& clip_bounds); | 55 const SkIRect& clip_bounds) =
0; |
| 69 | 56 |
| 70 friend class ScopedPlatformPaint; | 57 friend class ScopedPlatformPaint; |
| 71 }; | 58 }; |
| 72 | 59 |
| 73 } // namespace skia | 60 } // namespace skia |
| 74 | 61 |
| 75 #endif // SKIA_EXT_PLATFORM_DEVICE_H_ | 62 #endif // SKIA_EXT_PLATFORM_DEVICE_H_ |
| OLD | NEW |