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