diff options
Diffstat (limited to 'chrome/plugin/webplugin_proxy.cc')
-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()); |