| 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) | |
| 67 override; | |
| 68 SkBaseDevice* onCreateDevice(const CreateInfo&, const SkPaint*) override; | 66 SkBaseDevice* onCreateDevice(const CreateInfo&, const SkPaint*) override; |
| 69 | 67 |
| 70 private: | 68 private: |
| 71 // Private constructor. | 69 // Private constructor. |
| 72 BitmapPlatformDevice(HBITMAP hbitmap, const SkBitmap& bitmap); | 70 BitmapPlatformDevice(HBITMAP hbitmap, const SkBitmap& bitmap); |
| 73 | 71 |
| 74 // 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 |
| 75 // class, but by the BitmapPlatformPixelRef inside the device's SkBitmap. | 73 // class, but by the BitmapPlatformPixelRef inside the device's SkBitmap. |
| 76 // 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). |
| 77 HBITMAP hbitmap_; | 75 HBITMAP hbitmap_; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 #ifdef SK_DEBUG | 111 #ifdef SK_DEBUG |
| 114 int begin_paint_count_; | 112 int begin_paint_count_; |
| 115 #endif | 113 #endif |
| 116 | 114 |
| 117 DISALLOW_COPY_AND_ASSIGN(BitmapPlatformDevice); | 115 DISALLOW_COPY_AND_ASSIGN(BitmapPlatformDevice); |
| 118 }; | 116 }; |
| 119 | 117 |
| 120 } // namespace skia | 118 } // namespace skia |
| 121 | 119 |
| 122 #endif // SKIA_EXT_BITMAP_PLATFORM_DEVICE_WIN_H_ | 120 #endif // SKIA_EXT_BITMAP_PLATFORM_DEVICE_WIN_H_ |
| OLD | NEW |