diff options
author | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-10 17:09:36 +0000 |
---|---|---|
committer | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-10 17:09:36 +0000 |
commit | 73216b28eb41641844b8d97388fce5f76edc6d67 (patch) | |
tree | d77108629795416a533a7733cf20e51edeaba009 /chrome/plugin | |
parent | 8dde7858e43270d9481a1b9c7f1e28be0b4df66d (diff) | |
download | chromium_src-73216b28eb41641844b8d97388fce5f76edc6d67.zip chromium_src-73216b28eb41641844b8d97388fce5f76edc6d67.tar.gz chromium_src-73216b28eb41641844b8d97388fce5f76edc6d67.tar.bz2 |
Fix partial updates of transparent plugin backgrounds on Mac
Applies the same flipping that fixed partial plugin drawing originally to backgrounds of transparent plugins, since it has the same relative flipping.
BUG=25820
TEST=Visit a site with a transparent plugin (see bug for example)
Review URL: http://codereview.chromium.org/372078
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31561 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/plugin')
-rw-r--r-- | chrome/plugin/webplugin_proxy.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/chrome/plugin/webplugin_proxy.cc b/chrome/plugin/webplugin_proxy.cc index ab5326f..9983315 100644 --- a/chrome/plugin/webplugin_proxy.cc +++ b/chrome/plugin/webplugin_proxy.cc @@ -422,8 +422,11 @@ void WebPluginProxy::Paint(const gfx::Rect& rect) { } else { scoped_cftyperef<CGImageRef> image( CGBitmapContextCreateImage(background_context_)); + CGRect source_rect = rect.ToCGRect(); + // Flip the rect we use to pull from the canvas, since it's upside-down. + source_rect.origin.y = CGImageGetHeight(image) - rect.y() - rect.height(); scoped_cftyperef<CGImageRef> sub_image( - CGImageCreateWithImageInRect(image, rect.ToCGRect())); + CGImageCreateWithImageInRect(image, source_rect)); CGContextDrawImage(windowless_context_, rect.ToCGRect(), sub_image); } CGContextClipToRect(windowless_context_, rect.ToCGRect()); |