Chromium Code Reviews| Index: skia/ext/bitmap_platform_device_linux.cc |
| =================================================================== |
| --- skia/ext/bitmap_platform_device_linux.cc (revision 97366) |
| +++ skia/ext/bitmap_platform_device_linux.cc (working copy) |
| @@ -75,9 +75,8 @@ |
| // that we can create the pixel data before calling the constructor. This is |
| // required so that we can call the base class' constructor with the pixel |
| // data. |
| -BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height, |
| - bool is_opaque, |
| - cairo_surface_t* surface) { |
| +BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height, bool is_opaque, |
|
alokp
2011/08/19 03:01:41
indenting
Jeff Timanus
2011/08/20 02:31:04
Done.
|
| + cairo_surface_t* surface) { |
| SkBitmap bitmap; |
| bitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height, |
| cairo_image_surface_get_stride(surface)); |
| @@ -89,8 +88,7 @@ |
| (bitmap, new BitmapPlatformDeviceData(surface)); |
| } |
| -BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height, |
| - bool is_opaque) { |
| +BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height, bool is_opaque) { |
| cairo_surface_t* surface = |
| cairo_image_surface_create(CAIRO_FORMAT_ARGB32, |
| width, height); |
| @@ -105,8 +103,7 @@ |
| return device; |
| } |
| -BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height, |
| - bool is_opaque, |
| +BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height, bool is_opaque, |
| uint8_t* data) { |
| cairo_surface_t* surface = cairo_image_surface_create_for_data( |
| data, CAIRO_FORMAT_ARGB32, width, height, |
| @@ -120,8 +117,14 @@ |
| BitmapPlatformDevice::BitmapPlatformDevice( |
| const SkBitmap& bitmap, |
| BitmapPlatformDeviceData* data) |
| - : PlatformDevice(bitmap), |
| + : PlatformDevice(this), |
| + SkDevice(bitmap), |
| data_(data) { |
| + |
| + // Pass false, because BitmapPlatformDevice inherits both SkDevice, and |
| + // PlatformDevice, so there is no need to explicitly bind the lifetime of the |
| + // two classes. |
| + SetPlatformDevice(this, this, false); |
| } |
| BitmapPlatformDevice::~BitmapPlatformDevice() { |