diff options
Diffstat (limited to 'skia/ext/bitmap_platform_device_linux.cc')
-rw-r--r-- | skia/ext/bitmap_platform_device_linux.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/skia/ext/bitmap_platform_device_linux.cc b/skia/ext/bitmap_platform_device_linux.cc index 9b589de..5535ed1 100644 --- a/skia/ext/bitmap_platform_device_linux.cc +++ b/skia/ext/bitmap_platform_device_linux.cc @@ -130,6 +130,13 @@ void BitmapPlatformDevice::BitmapPlatformDeviceData::LoadConfig() { BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height, bool is_opaque, cairo_surface_t* surface) { + if ((width == 0) || (height == 0)) { + // Empty Skia bitmaps can't be configured. Create a minimal bitmap that + // allows specific configurations, such as ARGB. + width = 1; + height = 1; + } + SkBitmap bitmap; bitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height, cairo_image_surface_get_stride(surface)); |