| 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 #include "skia/ext/native_drawing_context.h" | 10 #include "skia/ext/native_drawing_context.h" |
| 11 #include "third_party/skia/include/core/SkBitmapDevice.h" | 11 #include "third_party/skia/include/core/SkBitmapDevice.h" |
| 12 #include "third_party/skia/include/core/SkTypes.h" | 12 #include "third_party/skia/include/core/SkTypes.h" |
| 13 | 13 |
| 14 class SkMatrix; | 14 class SkMatrix; |
| 15 | 15 |
| 16 namespace skia { | 16 namespace skia { |
| 17 | 17 |
| 18 class PlatformDevice; | 18 class PlatformDevice; |
| 19 class ScopedPlatformPaint; | |
| 20 | 19 |
| 21 // The following routines provide accessor points for the functionality | 20 // The following routines provide accessor points for the functionality |
| 22 // exported by the various PlatformDevice ports. | 21 // exported by the various PlatformDevice ports. |
| 23 // All calls to PlatformDevice::* should be routed through these | 22 // All calls to PlatformDevice::* should be routed through these |
| 24 // helper functions. | 23 // helper functions. |
| 25 | 24 |
| 26 // DEPRECATED | 25 // DEPRECATED |
| 27 // Bind a PlatformDevice instance, |platform_device|, to |device|. | 26 // Bind a PlatformDevice instance, |platform_device|, to |device|. |
| 28 SK_API void SetPlatformDevice(SkBaseDevice* device, PlatformDevice* platform_dev
ice); | 27 SK_API void SetPlatformDevice(SkBaseDevice* device, PlatformDevice* platform_dev
ice); |
| 29 | 28 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 40 // | 39 // |
| 41 // PlatformDevice provides an interface which sub-classes of SkBaseDevice can | 40 // PlatformDevice provides an interface which sub-classes of SkBaseDevice can |
| 42 // also provide to allow for drawing by the native platform into the device. | 41 // also provide to allow for drawing by the native platform into the device. |
| 43 // TODO(robertphillips): Once the bitmap-specific entry points are removed | 42 // TODO(robertphillips): Once the bitmap-specific entry points are removed |
| 44 // from SkBaseDevice it might make sense for PlatformDevice to be derived | 43 // from SkBaseDevice it might make sense for PlatformDevice to be derived |
| 45 // from it. | 44 // from it. |
| 46 class SK_API PlatformDevice { | 45 class SK_API PlatformDevice { |
| 47 public: | 46 public: |
| 48 virtual ~PlatformDevice(); | 47 virtual ~PlatformDevice(); |
| 49 | 48 |
| 50 private: | |
| 51 // The DC that corresponds to the bitmap, used for GDI operations drawing | 49 // The DC that corresponds to the bitmap, used for GDI operations drawing |
| 52 // into the bitmap. This is possibly heavyweight, so it should be existant | 50 // into the bitmap. This is possibly heavyweight, so it should be existant |
| 53 // only during one pass of rendering. | 51 // only during one pass of rendering. |
| 54 virtual NativeDrawingContext BeginPlatformPaint(const SkMatrix& transform, | 52 virtual NativeDrawingContext BeginPlatformPaint(const SkMatrix& transform, |
| 55 const SkIRect& clip_bounds) =
0; | 53 const SkIRect& clip_bounds) =
0; |
| 56 | |
| 57 friend class ScopedPlatformPaint; | |
| 58 }; | 54 }; |
| 59 | 55 |
| 60 } // namespace skia | 56 } // namespace skia |
| 61 | 57 |
| 62 #endif // SKIA_EXT_PLATFORM_DEVICE_H_ | 58 #endif // SKIA_EXT_PLATFORM_DEVICE_H_ |
| OLD | NEW |