summaryrefslogtreecommitdiffstats
path: root/skia/ext/bitmap_platform_device_mac.cc
diff options
context:
space:
mode:
Diffstat (limited to 'skia/ext/bitmap_platform_device_mac.cc')
-rw-r--r--skia/ext/bitmap_platform_device_mac.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/skia/ext/bitmap_platform_device_mac.cc b/skia/ext/bitmap_platform_device_mac.cc
index feb192b..3eb1e7e 100644
--- a/skia/ext/bitmap_platform_device_mac.cc
+++ b/skia/ext/bitmap_platform_device_mac.cc
@@ -181,6 +181,13 @@ BitmapPlatformDevice* BitmapPlatformDevice::Create(CGContextRef context,
int width,
int height,
bool is_opaque) {
+ 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);
if (bitmap.allocPixels() != true)