| 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_MAC_H_ | 5 #ifndef SKIA_EXT_BITMAP_PLATFORM_DEVICE_MAC_H_ |
| 6 #define SKIA_EXT_BITMAP_PLATFORM_DEVICE_MAC_H_ | 6 #define SKIA_EXT_BITMAP_PLATFORM_DEVICE_MAC_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 17 matching lines...) Expand all Loading... |
| 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 SkBitmapDevice, public PlatformDevice
{ | 29 class SK_API BitmapPlatformDevice : public SkBitmapDevice, public PlatformDevice
{ |
| 30 public: | 30 public: |
| 31 // Creates a BitmapPlatformDevice instance. |is_opaque| should be set if the | 31 // Creates a BitmapPlatformDevice instance. |is_opaque| should be set if the |
| 32 // caller knows the bitmap will be completely opaque and allows some | 32 // caller knows the bitmap will be completely opaque and allows some |
| 33 // optimizations. | 33 // optimizations. |
| 34 // |context| may be NULL. If |context| is NULL, then the bitmap backing store | 34 // |context| may be NULL. If |context| is NULL, then the bitmap backing store |
| 35 // is not initialized. | 35 // is not initialized. |
| 36 static BitmapPlatformDevice* Create(CGContextRef context, | 36 static BitmapPlatformDevice* Create(CGContextRef context, |
| 37 int width, int height, | 37 int width, int height, |
| 38 bool is_opaque); | 38 bool is_opaque, bool do_clear = false); |
| 39 | |
| 40 // Creates a BitmapPlatformDevice instance. If |is_opaque| is false, | |
| 41 // then the bitmap is initialzed to 0. | |
| 42 static BitmapPlatformDevice* CreateAndClear(int width, int height, | |
| 43 bool is_opaque); | |
| 44 | 39 |
| 45 // Creates a context for |data| and calls Create. | 40 // Creates a context for |data| and calls Create. |
| 46 // If |data| is NULL, then the bitmap backing store is not initialized. | 41 // If |data| is NULL, then the bitmap backing store is not initialized. |
| 47 static BitmapPlatformDevice* CreateWithData(uint8_t* data, | 42 static BitmapPlatformDevice* CreateWithData(uint8_t* data, |
| 48 int width, int height, | 43 int width, int height, |
| 49 bool is_opaque); | 44 bool is_opaque); |
| 50 | 45 |
| 51 ~BitmapPlatformDevice() override; | 46 ~BitmapPlatformDevice() override; |
| 52 | 47 |
| 53 // PlatformDevice overrides | 48 // PlatformDevice overrides |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 SkMatrix transform_; | 89 SkMatrix transform_; |
| 95 | 90 |
| 96 // The current clipping | 91 // The current clipping |
| 97 SkRegion clip_region_; | 92 SkRegion clip_region_; |
| 98 DISALLOW_COPY_AND_ASSIGN(BitmapPlatformDevice); | 93 DISALLOW_COPY_AND_ASSIGN(BitmapPlatformDevice); |
| 99 }; | 94 }; |
| 100 | 95 |
| 101 } // namespace skia | 96 } // namespace skia |
| 102 | 97 |
| 103 #endif // SKIA_EXT_BITMAP_PLATFORM_DEVICE_MAC_H_ | 98 #endif // SKIA_EXT_BITMAP_PLATFORM_DEVICE_MAC_H_ |
| OLD | NEW |