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 "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 // reference counting for the pixel data. In normal Skia, you could assign | 24 // reference counting for the pixel data. In normal Skia, you could assign |
25 // another bitmap to this device's bitmap and everything will work properly. | 25 // another bitmap to this device's bitmap and everything will work properly. |
26 // For us, that other bitmap will become invalid as soon as the device becomes | 26 // For us, that other bitmap will become invalid as soon as the device becomes |
27 // invalid, which may lead to subtle bugs. Therefore, DO NOT ASSIGN THE | 27 // invalid, which may lead to subtle bugs. Therefore, DO NOT ASSIGN THE |
28 // DEVICE'S PIXEL DATA TO ANOTHER BITMAP, make sure you copy instead. | 28 // DEVICE'S PIXEL DATA TO ANOTHER BITMAP, make sure you copy instead. |
29 class SK_API BitmapPlatformDevice : public PlatformDevice, public SkDevice { | 29 class SK_API BitmapPlatformDevice : public PlatformDevice, public SkDevice { |
30 public: | 30 public: |
31 // Factory function. The screen DC is used to create the bitmap, and will not | 31 // Factory function. The screen DC is used to create the bitmap, and will not |
32 // be stored beyond this function. is_opaque should be set if the caller | 32 // be stored beyond this function. is_opaque should be set if the caller |
33 // knows the bitmap will be completely opaque and allows some optimizations. | 33 // knows the bitmap will be completely opaque and allows some optimizations. |
| 34 // initialize should be set if the bitmap needs to be initialized to zero. |
34 // | 35 // |
35 // The shared_section parameter is optional (pass NULL for default behavior). | 36 // The shared_section parameter is optional (pass NULL for default behavior). |
36 // If shared_section is non-null, then it must be a handle to a file-mapping | 37 // If shared_section is non-null, then it must be a handle to a file-mapping |
37 // object returned by CreateFileMapping. See CreateDIBSection for details. | 38 // object returned by CreateFileMapping. See CreateDIBSection for details. |
38 static BitmapPlatformDevice* create(HDC screen_dc, int width, int height, | 39 static BitmapPlatformDevice* create(HDC screen_dc, int width, int height, |
39 bool is_opaque, HANDLE shared_section); | 40 int flags, HANDLE shared_section); |
40 | 41 |
41 // This version is the same as above but will get the screen DC itself. | 42 // This version is the same as above but will get the screen DC itself. |
42 static BitmapPlatformDevice* create(int width, int height, bool is_opaque, | 43 static BitmapPlatformDevice* create(int width, int height, int flags, |
43 HANDLE shared_section); | 44 HANDLE shared_section); |
44 | 45 |
45 virtual ~BitmapPlatformDevice(); | 46 virtual ~BitmapPlatformDevice(); |
46 | 47 |
47 // PlatformDevice overrides | 48 // PlatformDevice overrides |
48 // Retrieves the bitmap DC, which is the memory DC for our bitmap data. The | 49 // Retrieves the bitmap DC, which is the memory DC for our bitmap data. The |
49 // bitmap DC is lazy created. | 50 // bitmap DC is lazy created. |
50 virtual PlatformSurface BeginPlatformPaint() OVERRIDE; | 51 virtual PlatformSurface BeginPlatformPaint() OVERRIDE; |
51 virtual void EndPlatformPaint() OVERRIDE; | 52 virtual void EndPlatformPaint() OVERRIDE; |
52 | 53 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 #ifdef SK_DEBUG | 86 #ifdef SK_DEBUG |
86 int begin_paint_count_; | 87 int begin_paint_count_; |
87 #endif | 88 #endif |
88 | 89 |
89 DISALLOW_COPY_AND_ASSIGN(BitmapPlatformDevice); | 90 DISALLOW_COPY_AND_ASSIGN(BitmapPlatformDevice); |
90 }; | 91 }; |
91 | 92 |
92 } // namespace skia | 93 } // namespace skia |
93 | 94 |
94 #endif // SKIA_EXT_BITMAP_PLATFORM_DEVICE_WIN_H_ | 95 #endif // SKIA_EXT_BITMAP_PLATFORM_DEVICE_WIN_H_ |
OLD | NEW |