Chromium Code Reviews| Index: skia/ext/bitmap_platform_device_linux.cc |
| =================================================================== |
| --- skia/ext/bitmap_platform_device_linux.cc (revision 123041) |
| +++ skia/ext/bitmap_platform_device_linux.cc (working copy) |
| @@ -81,13 +81,13 @@ |
| // required so that we can call the base class' constructor with the pixel |
| // data. |
| BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height, |
| - bool is_opaque, |
| + int flags, |
| cairo_surface_t* surface) { |
| SkBitmap bitmap; |
| bitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height, |
| cairo_image_surface_get_stride(surface)); |
| bitmap.setPixels(cairo_image_surface_get_data(surface)); |
| - bitmap.setIsOpaque(is_opaque); |
| + bitmap.setIsOpaque(flags & FLAGS_OPAQUE); |
| // The device object will take ownership of the graphics context. |
| return new BitmapPlatformDevice |
| @@ -95,15 +95,15 @@ |
| } |
| BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height, |
| - bool is_opaque) { |
| + int flags) { |
| // This initializes the bitmap to all zeros. |
| cairo_surface_t* surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, |
| width, height); |
| - BitmapPlatformDevice* device = Create(width, height, is_opaque, surface); |
| + BitmapPlatformDevice* device = Create(width, height, flags, surface); |
| #ifndef NDEBUG |
| - if (is_opaque) // Fill with bright bluish green |
| + if (flags & FLAGS_OPAQUE) // Fill with bright bluish green |
| device->eraseColor(SkColorSetARGB(255, 0, 255, 128)); |
| #endif |
| @@ -111,13 +111,12 @@ |
| } |
| BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height, |
| - bool is_opaque, |
| - uint8_t* data) { |
| + int flags, uint8_t* data) { |
| cairo_surface_t* surface = cairo_image_surface_create_for_data( |
| data, CAIRO_FORMAT_ARGB32, width, height, |
| cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, width)); |
| - return Create(width, height, is_opaque, surface); |
| + return Create(width, height, flags, surface); |
| } |
| // The device will own the bitmap, which corresponds to also owning the pixel |
| @@ -137,7 +136,7 @@ |
| SkBitmap::Config config, int width, int height, bool isOpaque, |
| Usage /*usage*/) { |
| SkASSERT(config == SkBitmap::kARGB_8888_Config); |
| - return BitmapPlatformDevice::Create(width, height, isOpaque); |
| + return BitmapPlatformDevice::Create(width, height, GetDefaultFlags(isOpaque)); |
|
Jeff Timanus
2012/02/23 22:14:10
The various BitmapPlatformDevice::onCreateCompatib
|
| } |
| cairo_t* BitmapPlatformDevice::BeginPlatformPaint() { |