diff options
author | stuartmorgan@google.com <stuartmorgan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-29 20:27:09 +0000 |
---|---|---|
committer | stuartmorgan@google.com <stuartmorgan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-29 20:27:09 +0000 |
commit | d5a8a426e8b64ac9bfb90873b28f47bb2814899a (patch) | |
tree | e5246a855f74c7c128d7c4145ae03e1005d6139f /chrome/plugin | |
parent | 825dd109a3acdcf2640c531068a602dd8f40a196 (diff) | |
download | chromium_src-d5a8a426e8b64ac9bfb90873b28f47bb2814899a.zip chromium_src-d5a8a426e8b64ac9bfb90873b28f47bb2814899a.tar.gz chromium_src-d5a8a426e8b64ac9bfb90873b28f47bb2814899a.tar.bz2 |
Update the Mac plugin dummy window code for the new coordinate system.
Fixes the location of the dummy window, cleans up some duplicate window-handling code, and tries to keep the window activation status more in sync with what it would be in a single-process system. The net result is that event handling in plugins works better, although there are still activation issues.
BUG=none
TEST=Clicks on plugins should register in the right place (assuming they register at all; there are still bugs in having them handled).
Review URL: http://codereview.chromium.org/159525
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21987 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/plugin')
-rw-r--r-- | chrome/plugin/webplugin_proxy.cc | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/chrome/plugin/webplugin_proxy.cc b/chrome/plugin/webplugin_proxy.cc index 32102d3..5b150581 100644 --- a/chrome/plugin/webplugin_proxy.cc +++ b/chrome/plugin/webplugin_proxy.cc @@ -412,14 +412,14 @@ void WebPluginProxy::Paint(const gfx::Rect& rect) { CGContextSaveGState(windowless_context_); if (!background_context_.get()) { CGContextSetFillColorWithColor(windowless_context_, - CGColorGetConstantColor(kCGColorWhite)); + CGColorGetConstantColor(kCGColorBlack)); CGContextFillRect(windowless_context_, rect.ToCGRect()); } else { scoped_cftyperef<CGImageRef> image( CGBitmapContextCreateImage(background_context_)); scoped_cftyperef<CGImageRef> sub_image( CGImageCreateWithImageInRect(image, rect.ToCGRect())); - CGContextDrawImage(background_context_, rect.ToCGRect(), sub_image); + CGContextDrawImage(windowless_context_, rect.ToCGRect(), sub_image); } CGContextClipToRect(windowless_context_, rect.ToCGRect()); delegate_->Paint(windowless_context_, rect); @@ -450,11 +450,7 @@ void WebPluginProxy::UpdateGeometry( delegate_->UpdateGeometry(window_rect, clip_rect); bool moved = old.x() != window_rect.x() || old.y() != window_rect.y(); -#if defined(OS_MACOSX) - if (windowless_buffer.fd > 0) { -#else - if (windowless_buffer) { -#endif + if (TransportDIB::is_valid(windowless_buffer)) { // The plugin's rect changed, so now we have a new buffer to draw into. SetWindowlessBuffer(windowless_buffer, background_buffer); |