summaryrefslogtreecommitdiffstats
path: root/skia
diff options
context:
space:
mode:
Diffstat (limited to 'skia')
-rw-r--r--skia/ext/bitmap_platform_device_mac.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/skia/ext/bitmap_platform_device_mac.cc b/skia/ext/bitmap_platform_device_mac.cc
index 60293d8..56150ce 100644
--- a/skia/ext/bitmap_platform_device_mac.cc
+++ b/skia/ext/bitmap_platform_device_mac.cc
@@ -300,16 +300,15 @@ void BitmapPlatformDevice::DrawToContext(CGContextRef context, int x, int y,
// anything to trigger copy on write
CGImageRef image = CGBitmapContextCreateImage(data_->bitmap_context_);
CGRect bounds;
+ bounds.origin.x = x;
+ bounds.origin.y = y;
if (src_rect) {
- bounds = *src_rect;
- bounds.origin.x = x;
- bounds.origin.y = y;
+ bounds.size.width = src_rect->size.width;
+ bounds.size.height = src_rect->size.height;
CGImageRef sub_image = CGImageCreateWithImageInRect(image, *src_rect);
CGContextDrawImage(context, bounds, sub_image);
CGImageRelease(sub_image);
} else {
- bounds.origin.x = 0;
- bounds.origin.y = 0;
bounds.size.width = width();
bounds.size.height = height();
CGContextDrawImage(context, bounds, image);