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_BITMAP_PLATFORM_DEVICE_WIN_H_ | 5 #ifndef SKIA_EXT_BITMAP_PLATFORM_DEVICE_WIN_H_ |
6 #define SKIA_EXT_BITMAP_PLATFORM_DEVICE_WIN_H_ | 6 #define SKIA_EXT_BITMAP_PLATFORM_DEVICE_WIN_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "skia/ext/platform_device.h" | 10 #include "skia/ext/platform_device.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 void DrawToHDC(HDC dc, int x, int y, const RECT* src_rect) override; | 58 void DrawToHDC(HDC dc, int x, int y, const RECT* src_rect) override; |
59 | 59 |
60 protected: | 60 protected: |
61 // Flushes the Windows device context so that the pixel data can be accessed | 61 // Flushes the Windows device context so that the pixel data can be accessed |
62 // directly by Skia. Overridden from SkBaseDevice, this is called when Skia | 62 // directly by Skia. Overridden from SkBaseDevice, this is called when Skia |
63 // starts accessing pixel data. | 63 // starts accessing pixel data. |
64 virtual const SkBitmap& onAccessBitmap() override; | 64 virtual const SkBitmap& onAccessBitmap() override; |
65 | 65 |
66 virtual SkBaseDevice* onCreateCompatibleDevice(const CreateInfo& info) | 66 virtual SkBaseDevice* onCreateCompatibleDevice(const CreateInfo& info) |
67 override; | 67 override; |
| 68 SkBaseDevice* onCreateDevice(const CreateInfo&, const SkPaint*) override; |
68 | 69 |
69 private: | 70 private: |
70 // Private constructor. | 71 // Private constructor. |
71 BitmapPlatformDevice(HBITMAP hbitmap, const SkBitmap& bitmap); | 72 BitmapPlatformDevice(HBITMAP hbitmap, const SkBitmap& bitmap); |
72 | 73 |
73 // Bitmap into which the drawing will be done. This bitmap not owned by this | 74 // Bitmap into which the drawing will be done. This bitmap not owned by this |
74 // class, but by the BitmapPlatformPixelRef inside the device's SkBitmap. | 75 // class, but by the BitmapPlatformPixelRef inside the device's SkBitmap. |
75 // It's only stored here in order to lazy-create the DC (below). | 76 // It's only stored here in order to lazy-create the DC (below). |
76 HBITMAP hbitmap_; | 77 HBITMAP hbitmap_; |
77 | 78 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 #ifdef SK_DEBUG | 113 #ifdef SK_DEBUG |
113 int begin_paint_count_; | 114 int begin_paint_count_; |
114 #endif | 115 #endif |
115 | 116 |
116 DISALLOW_COPY_AND_ASSIGN(BitmapPlatformDevice); | 117 DISALLOW_COPY_AND_ASSIGN(BitmapPlatformDevice); |
117 }; | 118 }; |
118 | 119 |
119 } // namespace skia | 120 } // namespace skia |
120 | 121 |
121 #endif // SKIA_EXT_BITMAP_PLATFORM_DEVICE_WIN_H_ | 122 #endif // SKIA_EXT_BITMAP_PLATFORM_DEVICE_WIN_H_ |
OLD | NEW |