summaryrefslogtreecommitdiffstats
path: root/skia
diff options
context:
space:
mode:
authorstuartmorgan@google.com <stuartmorgan@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-23 00:11:09 +0000
committerstuartmorgan@google.com <stuartmorgan@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-23 00:11:09 +0000
commit6c0006dce2f377730a9ee461eb20d6e00e88c3a6 (patch)
tree99a9441500dd6c55ba924235eb2d0416503344c5 /skia
parenta3c72a0e38b8d56680d602fd695f1daf8e9aa719 (diff)
downloadchromium_src-6c0006dce2f377730a9ee461eb20d6e00e88c3a6.zip
chromium_src-6c0006dce2f377730a9ee461eb20d6e00e88c3a6.tar.gz
chromium_src-6c0006dce2f377730a9ee461eb20d6e00e88c3a6.tar.bz2
Fix BitmapPlatformDevice::DrawToContext handling of NULL src_rect on Mac
BUG=none TEST=Crash/kill a plugin process on the Mac; sad tab should draw in the right place. Review URL: http://codereview.chromium.org/155958 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21349 0039d316-1c4b-4281-b951-d872f2087c98
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);