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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 const SkClipStack&) override; | 56 const SkClipStack&) override; |
57 | 57 |
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 SkBaseDevice* onCreateDevice(const CreateInfo&, const SkPaint*) override; |
67 override; | |
68 | 67 |
69 private: | 68 private: |
70 // Private constructor. | 69 // Private constructor. |
71 BitmapPlatformDevice(HBITMAP hbitmap, const SkBitmap& bitmap); | 70 BitmapPlatformDevice(HBITMAP hbitmap, const SkBitmap& bitmap); |
72 | 71 |
73 // Bitmap into which the drawing will be done. This bitmap not owned by this | 72 // 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. | 73 // class, but by the BitmapPlatformPixelRef inside the device's SkBitmap. |
75 // It's only stored here in order to lazy-create the DC (below). | 74 // It's only stored here in order to lazy-create the DC (below). |
76 HBITMAP hbitmap_; | 75 HBITMAP hbitmap_; |
77 | 76 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 #ifdef SK_DEBUG | 111 #ifdef SK_DEBUG |
113 int begin_paint_count_; | 112 int begin_paint_count_; |
114 #endif | 113 #endif |
115 | 114 |
116 DISALLOW_COPY_AND_ASSIGN(BitmapPlatformDevice); | 115 DISALLOW_COPY_AND_ASSIGN(BitmapPlatformDevice); |
117 }; | 116 }; |
118 | 117 |
119 } // namespace skia | 118 } // namespace skia |
120 | 119 |
121 #endif // SKIA_EXT_BITMAP_PLATFORM_DEVICE_WIN_H_ | 120 #endif // SKIA_EXT_BITMAP_PLATFORM_DEVICE_WIN_H_ |
OLD | NEW |