| 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) | 10 #if defined(OS_WIN) |
| 11 #include <windows.h> | 11 #include <windows.h> |
| 12 #include <vector> | 12 #include <vector> |
| 13 #endif | 13 #endif |
| 14 | 14 |
| 15 #include "skia/ext/platform_surface.h" | 15 #include "skia/ext/platform_surface.h" |
| 16 #include "third_party/skia/include/core/SkBitmapDevice.h" | 16 #include "third_party/skia/include/core/SkBitmapDevice.h" |
| 17 #include "third_party/skia/include/core/SkTypes.h" | 17 #include "third_party/skia/include/core/SkTypes.h" |
| 18 | 18 |
| 19 class SkMatrix; | 19 class SkMatrix; |
| 20 class SkPath; | 20 class SkPath; |
| 21 class SkRegion; | |
| 22 | 21 |
| 23 namespace skia { | 22 namespace skia { |
| 24 | 23 |
| 25 class PlatformDevice; | 24 class PlatformDevice; |
| 26 class ScopedPlatformPaint; | 25 class ScopedPlatformPaint; |
| 27 | 26 |
| 28 // The following routines provide accessor points for the functionality | 27 // The following routines provide accessor points for the functionality |
| 29 // exported by the various PlatformDevice ports. | 28 // exported by the various PlatformDevice ports. |
| 30 // All calls to PlatformDevice::* should be routed through these | 29 // All calls to PlatformDevice::* should be routed through these |
| 31 // helper functions. | 30 // helper functions. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 52 // from SkBaseDevice it might make sense for PlatformDevice to be derived | 51 // from SkBaseDevice it might make sense for PlatformDevice to be derived |
| 53 // from it. | 52 // from it. |
| 54 class SK_API PlatformDevice { | 53 class SK_API PlatformDevice { |
| 55 public: | 54 public: |
| 56 virtual ~PlatformDevice() {} | 55 virtual ~PlatformDevice() {} |
| 57 | 56 |
| 58 #if defined(OS_MACOSX) | 57 #if defined(OS_MACOSX) |
| 59 // The CGContext that corresponds to the bitmap, used for CoreGraphics | 58 // The CGContext that corresponds to the bitmap, used for CoreGraphics |
| 60 // operations drawing into the bitmap. This is possibly heavyweight, so it | 59 // operations drawing into the bitmap. This is possibly heavyweight, so it |
| 61 // should exist only during one pass of rendering. | 60 // should exist only during one pass of rendering. |
| 62 virtual CGContextRef GetBitmapContext() = 0; | 61 virtual CGContextRef GetBitmapContext(const SkMatrix& transform, |
| 62 const SkIRect& clip_bounds) = 0; |
| 63 #endif | 63 #endif |
| 64 | 64 |
| 65 #if defined(OS_WIN) | 65 #if defined(OS_WIN) |
| 66 // Draws to the given screen DC, if the bitmap DC doesn't exist, this will | 66 // Draws to the given screen DC, if the bitmap DC doesn't exist, this will |
| 67 // temporarily create it. However, if you have created the bitmap DC, it will | 67 // temporarily create it. However, if you have created the bitmap DC, it will |
| 68 // be more efficient if you don't free it until after this call so it doesn't | 68 // be more efficient if you don't free it until after this call so it doesn't |
| 69 // have to be created twice. If src_rect is null, then the entirety of the | 69 // have to be created twice. If src_rect is null, then the entirety of the |
| 70 // source device will be copied. | 70 // source device will be copied. |
| 71 virtual void DrawToHDC(HDC, int x, int y, const RECT* src_rect); | 71 virtual void DrawToHDC(HDC source_dc, HDC destination_dc, int x, int y, |
| 72 const RECT* src_rect, const SkMatrix& transform); |
| 72 #endif | 73 #endif |
| 73 | 74 |
| 74 private: | 75 private: |
| 75 // The DC that corresponds to the bitmap, used for GDI operations drawing | 76 // The DC that corresponds to the bitmap, used for GDI operations drawing |
| 76 // into the bitmap. This is possibly heavyweight, so it should be existant | 77 // into the bitmap. This is possibly heavyweight, so it should be existant |
| 77 // only during one pass of rendering. | 78 // only during one pass of rendering. |
| 78 virtual PlatformSurface BeginPlatformPaint(); | 79 virtual PlatformSurface BeginPlatformPaint(const SkMatrix& transform, |
| 80 const SkIRect& clip_bounds); |
| 79 | 81 |
| 80 friend class ScopedPlatformPaint; | 82 friend class ScopedPlatformPaint; |
| 81 }; | 83 }; |
| 82 | 84 |
| 83 } // namespace skia | 85 } // namespace skia |
| 84 | 86 |
| 85 #endif // SKIA_EXT_PLATFORM_DEVICE_H_ | 87 #endif // SKIA_EXT_PLATFORM_DEVICE_H_ |
| OLD | NEW |