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" |
11 | 11 |
12 namespace skia { | 12 namespace skia { |
13 | 13 |
14 class ScopedPlatformPaint; | |
15 | |
16 // A device is basically a wrapper around SkBitmap that provides a surface for | 14 // A device is basically a wrapper around SkBitmap that provides a surface for |
17 // SkCanvas to draw into. Our device provides a surface Windows can also write | 15 // SkCanvas to draw into. Our device provides a surface Windows can also write |
18 // to. BitmapPlatformDevice creates a bitmap using CreateDIBSection() in a | 16 // to. BitmapPlatformDevice creates a bitmap using CreateDIBSection() in a |
19 // format that Skia supports and can then use this to draw ClearType into, etc. | 17 // format that Skia supports and can then use this to draw ClearType into, etc. |
20 // This pixel data is provided to the bitmap that the device contains so that it | 18 // This pixel data is provided to the bitmap that the device contains so that it |
21 // can be shared. | 19 // can be shared. |
22 class SK_API BitmapPlatformDevice : public SkBitmapDevice, | 20 class SK_API BitmapPlatformDevice : public SkBitmapDevice, |
23 public PlatformDevice { | 21 public PlatformDevice { |
24 public: | 22 public: |
25 // Factory function. is_opaque should be set if the caller knows the bitmap | 23 // Factory function. is_opaque should be set if the caller knows the bitmap |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 // Create/destroy hdc_, which is the memory DC for our bitmap data. | 66 // Create/destroy hdc_, which is the memory DC for our bitmap data. |
69 HDC GetBitmapDC(const SkMatrix& transform, const SkIRect& clip_bounds); | 67 HDC GetBitmapDC(const SkMatrix& transform, const SkIRect& clip_bounds); |
70 void ReleaseBitmapDC(); | 68 void ReleaseBitmapDC(); |
71 bool IsBitmapDCCreated() const; | 69 bool IsBitmapDCCreated() const; |
72 | 70 |
73 // Loads the current transform and clip into the context. Can be called even | 71 // Loads the current transform and clip into the context. Can be called even |
74 // when |hbitmap_| is NULL (will be a NOP). | 72 // when |hbitmap_| is NULL (will be a NOP). |
75 void LoadConfig(const SkMatrix& transform, const SkIRect& clip_bounds); | 73 void LoadConfig(const SkMatrix& transform, const SkIRect& clip_bounds); |
76 | 74 |
77 DISALLOW_COPY_AND_ASSIGN(BitmapPlatformDevice); | 75 DISALLOW_COPY_AND_ASSIGN(BitmapPlatformDevice); |
78 friend class ScopedPlatformPaint; | |
79 }; | 76 }; |
80 | 77 |
81 } // namespace skia | 78 } // namespace skia |
82 | 79 |
83 #endif // SKIA_EXT_BITMAP_PLATFORM_DEVICE_WIN_H_ | 80 #endif // SKIA_EXT_BITMAP_PLATFORM_DEVICE_WIN_H_ |
OLD | NEW |