Index: skia/ext/bitmap_platform_device_mac.cc |
=================================================================== |
--- skia/ext/bitmap_platform_device_mac.cc (revision 11173) |
+++ skia/ext/bitmap_platform_device_mac.cc (working copy) |
@@ -146,12 +146,11 @@ |
int width, |
int height, |
bool is_opaque) { |
- void* data = malloc(height * width * 4); |
- if (!data) return NULL; |
- |
SkBitmap bitmap; |
bitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height); |
- bitmap.setPixels(data); |
+ if (bitmap.allocPixels() != true) |
+ return NULL; |
+ void* data = bitmap.getPixels(); |
// Note: The Windows implementation clears the Bitmap later on. |
// This bears mentioning since removal of this line makes the |
@@ -224,7 +223,7 @@ |
return data_->GetBitmapContext(); |
} |
-void BitmapPlatformDeviceMac::setMatrixClip(const SkMatrix& transform, |
+void BitmapPlatformDeviceMac::setMatrixClip(const SkMatrix& transform, |
const SkRegion& region) { |
data_->SetMatrixClip(transform, region); |
} |