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/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "skia/ext/platform_device.h" | 10 #include "skia/ext/platform_device.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 ~BitmapPlatformDevice() override; | 41 ~BitmapPlatformDevice() override; |
42 | 42 |
43 protected: | 43 protected: |
44 SkBaseDevice* onCreateDevice(const CreateInfo&, const SkPaint*) override; | 44 SkBaseDevice* onCreateDevice(const CreateInfo&, const SkPaint*) override; |
45 | 45 |
46 private: | 46 private: |
47 // PlatformDevice override | 47 // PlatformDevice override |
48 // Retrieves the bitmap DC, which is the memory DC for our bitmap data. The | 48 // Retrieves the bitmap DC, which is the memory DC for our bitmap data. The |
49 // bitmap DC may be lazily created. | 49 // bitmap DC may be lazily created. |
50 PlatformSurface BeginPlatformPaint(const SkMatrix& transform, | 50 NativeDrawingContext BeginPlatformPaint(const SkMatrix& transform, |
51 const SkIRect& clip_bounds) override; | 51 const SkIRect& clip_bounds) override; |
52 | 52 |
53 // Private constructor. | 53 // Private constructor. |
54 BitmapPlatformDevice(HBITMAP hbitmap, const SkBitmap& bitmap); | 54 BitmapPlatformDevice(HBITMAP hbitmap, const SkBitmap& bitmap); |
55 | 55 |
56 // Bitmap into which the drawing will be done. This bitmap not owned by this | 56 // Bitmap into which the drawing will be done. This bitmap not owned by this |
57 // class, but by the BitmapPlatformPixelRef inside the device's SkBitmap. | 57 // class, but by the BitmapPlatformPixelRef inside the device's SkBitmap. |
58 // It's only stored here in order to lazy-create the DC (below). | 58 // It's only stored here in order to lazy-create the DC (below). |
59 HBITMAP hbitmap_; | 59 HBITMAP hbitmap_; |
60 | 60 |
61 // Previous bitmap held by the DC. This will be selected back before the | 61 // Previous bitmap held by the DC. This will be selected back before the |
(...skipping 12 matching lines...) Expand all Loading... |
74 // when |hbitmap_| is NULL (will be a NOP). | 74 // when |hbitmap_| is NULL (will be a NOP). |
75 void LoadConfig(const SkMatrix& transform, const SkIRect& clip_bounds); | 75 void LoadConfig(const SkMatrix& transform, const SkIRect& clip_bounds); |
76 | 76 |
77 DISALLOW_COPY_AND_ASSIGN(BitmapPlatformDevice); | 77 DISALLOW_COPY_AND_ASSIGN(BitmapPlatformDevice); |
78 friend class ScopedPlatformPaint; | 78 friend class ScopedPlatformPaint; |
79 }; | 79 }; |
80 | 80 |
81 } // namespace skia | 81 } // namespace skia |
82 | 82 |
83 #endif // SKIA_EXT_BITMAP_PLATFORM_DEVICE_WIN_H_ | 83 #endif // SKIA_EXT_BITMAP_PLATFORM_DEVICE_WIN_H_ |
OLD | NEW |