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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 // Creates a BitmapPlatformDevice instance respecting the parameters as above. | 44 // Creates a BitmapPlatformDevice instance respecting the parameters as above. |
45 // If |is_opaque| is false, then the bitmap is initialzed to 0. | 45 // If |is_opaque| is false, then the bitmap is initialzed to 0. |
46 static BitmapPlatformDevice* CreateAndClear(int width, int height, | 46 static BitmapPlatformDevice* CreateAndClear(int width, int height, |
47 bool is_opaque); | 47 bool is_opaque); |
48 | 48 |
49 virtual ~BitmapPlatformDevice(); | 49 virtual ~BitmapPlatformDevice(); |
50 | 50 |
51 // PlatformDevice overrides | 51 // PlatformDevice overrides |
52 // Retrieves the bitmap DC, which is the memory DC for our bitmap data. The | 52 // Retrieves the bitmap DC, which is the memory DC for our bitmap data. The |
53 // bitmap DC is lazy created. | 53 // bitmap DC is lazy created. |
54 virtual PlatformSurface BeginPlatformPaint() OVERRIDE; | 54 virtual PlatformSurface BeginPlatformPaint() override; |
55 virtual void EndPlatformPaint() OVERRIDE; | 55 virtual void EndPlatformPaint() override; |
56 | 56 |
57 virtual void DrawToNativeContext(HDC dc, int x, int y, | 57 virtual void DrawToNativeContext(HDC dc, int x, int y, |
58 const RECT* src_rect) OVERRIDE; | 58 const RECT* src_rect) override; |
59 | 59 |
60 // Loads the given transform and clipping region into the HDC. This is | 60 // Loads the given transform and clipping region into the HDC. This is |
61 // overridden from SkBaseDevice. | 61 // overridden from SkBaseDevice. |
62 virtual void setMatrixClip(const SkMatrix& transform, const SkRegion& region, | 62 virtual void setMatrixClip(const SkMatrix& transform, const SkRegion& region, |
63 const SkClipStack&) OVERRIDE; | 63 const SkClipStack&) override; |
64 | 64 |
65 protected: | 65 protected: |
66 // Flushes the Windows device context so that the pixel data can be accessed | 66 // Flushes the Windows device context so that the pixel data can be accessed |
67 // directly by Skia. Overridden from SkBaseDevice, this is called when Skia | 67 // directly by Skia. Overridden from SkBaseDevice, this is called when Skia |
68 // starts accessing pixel data. | 68 // starts accessing pixel data. |
69 virtual const SkBitmap& onAccessBitmap() OVERRIDE; | 69 virtual const SkBitmap& onAccessBitmap() override; |
70 | 70 |
71 virtual SkBaseDevice* onCreateDevice(const SkImageInfo& info, | 71 virtual SkBaseDevice* onCreateDevice(const SkImageInfo& info, |
72 Usage usage) OVERRIDE; | 72 Usage usage) override; |
73 | 73 |
74 private: | 74 private: |
75 // Private constructor. | 75 // Private constructor. |
76 BitmapPlatformDevice(HBITMAP hbitmap, const SkBitmap& bitmap); | 76 BitmapPlatformDevice(HBITMAP hbitmap, const SkBitmap& bitmap); |
77 | 77 |
78 // Bitmap into which the drawing will be done. This bitmap not owned by this | 78 // Bitmap into which the drawing will be done. This bitmap not owned by this |
79 // class, but by the BitmapPlatformPixelRef inside the device's SkBitmap. | 79 // class, but by the BitmapPlatformPixelRef inside the device's SkBitmap. |
80 // It's only stored here in order to lazy-create the DC (below). | 80 // It's only stored here in order to lazy-create the DC (below). |
81 HBITMAP hbitmap_; | 81 HBITMAP hbitmap_; |
82 | 82 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 #ifdef SK_DEBUG | 117 #ifdef SK_DEBUG |
118 int begin_paint_count_; | 118 int begin_paint_count_; |
119 #endif | 119 #endif |
120 | 120 |
121 DISALLOW_COPY_AND_ASSIGN(BitmapPlatformDevice); | 121 DISALLOW_COPY_AND_ASSIGN(BitmapPlatformDevice); |
122 }; | 122 }; |
123 | 123 |
124 } // namespace skia | 124 } // namespace skia |
125 | 125 |
126 #endif // SKIA_EXT_BITMAP_PLATFORM_DEVICE_WIN_H_ | 126 #endif // SKIA_EXT_BITMAP_PLATFORM_DEVICE_WIN_H_ |
OLD | NEW |