| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "skia/ext/platform_device_win.h" | 9 #include "skia/ext/platform_device_win.h" |
| 10 | 10 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 // the resulting GDI clip rect will be random. | 62 // the resulting GDI clip rect will be random. |
| 63 // | 63 // |
| 64 // Copy constucting and "=" is designed for saving the device or passing it | 64 // Copy constucting and "=" is designed for saving the device or passing it |
| 65 // around to another routine willing to deal with the bitmap data directly. | 65 // around to another routine willing to deal with the bitmap data directly. |
| 66 BitmapPlatformDevice(const BitmapPlatformDevice& other); | 66 BitmapPlatformDevice(const BitmapPlatformDevice& other); |
| 67 virtual ~BitmapPlatformDevice(); | 67 virtual ~BitmapPlatformDevice(); |
| 68 | 68 |
| 69 // See warning for copy constructor above. | 69 // See warning for copy constructor above. |
| 70 BitmapPlatformDevice& operator=(const BitmapPlatformDevice& other); | 70 BitmapPlatformDevice& operator=(const BitmapPlatformDevice& other); |
| 71 | 71 |
| 72 // PlatformDevice overrides |
| 72 // Retrieves the bitmap DC, which is the memory DC for our bitmap data. The | 73 // Retrieves the bitmap DC, which is the memory DC for our bitmap data. The |
| 73 // bitmap DC is lazy created. | 74 // bitmap DC is lazy created. |
| 74 virtual PlatformSurface BeginPlatformPaint(); | 75 virtual PlatformSurface BeginPlatformPaint(); |
| 75 virtual void EndPlatformPaint(); | 76 virtual void EndPlatformPaint(); |
| 76 | 77 |
| 78 virtual void DrawToNativeContext(HDC dc, int x, int y, const RECT* src_rect); |
| 79 virtual void MakeOpaque(int x, int y, int width, int height); |
| 80 virtual bool IsVectorial() { return false; } |
| 81 |
| 77 // Loads the given transform and clipping region into the HDC. This is | 82 // Loads the given transform and clipping region into the HDC. This is |
| 78 // overridden from SkDevice. | 83 // overridden from SkDevice. |
| 79 virtual void setMatrixClip(const SkMatrix& transform, const SkRegion& region, | 84 virtual void setMatrixClip(const SkMatrix& transform, const SkRegion& region, |
| 80 const SkClipStack&); | 85 const SkClipStack&); |
| 81 | 86 |
| 82 virtual void drawToHDC(HDC dc, int x, int y, const RECT* src_rect); | |
| 83 virtual void makeOpaque(int x, int y, int width, int height); | |
| 84 virtual bool IsVectorial() { return false; } | |
| 85 | |
| 86 // Returns the color value at the specified location. This does not | |
| 87 // consider any transforms that may be set on the device. | |
| 88 SkColor getColorAt(int x, int y); | |
| 89 | |
| 90 protected: | 87 protected: |
| 91 // Flushes the Windows device context so that the pixel data can be accessed | 88 // Flushes the Windows device context so that the pixel data can be accessed |
| 92 // directly by Skia. Overridden from SkDevice, this is called when Skia | 89 // directly by Skia. Overridden from SkDevice, this is called when Skia |
| 93 // starts accessing pixel data. | 90 // starts accessing pixel data. |
| 94 virtual void onAccessBitmap(SkBitmap* bitmap); | 91 virtual void onAccessBitmap(SkBitmap* bitmap); |
| 95 | 92 |
| 96 // Override SkDevice. | 93 // Override SkDevice. |
| 97 virtual SkDeviceFactory* onNewDeviceFactory(); | 94 virtual SkDeviceFactory* onNewDeviceFactory(); |
| 98 | 95 |
| 99 private: | 96 private: |
| (...skipping 12 matching lines...) Expand all Loading... |
| 112 | 109 |
| 113 #ifdef SK_DEBUG | 110 #ifdef SK_DEBUG |
| 114 int begin_paint_count_; | 111 int begin_paint_count_; |
| 115 #endif | 112 #endif |
| 116 }; | 113 }; |
| 117 | 114 |
| 118 } // namespace skia | 115 } // namespace skia |
| 119 | 116 |
| 120 #endif // SKIA_EXT_BITMAP_PLATFORM_DEVICE_WIN_H_ | 117 #endif // SKIA_EXT_BITMAP_PLATFORM_DEVICE_WIN_H_ |
| 121 | 118 |
| OLD | NEW |