diff options
author | stuartmorgan@google.com <stuartmorgan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-27 19:30:32 +0000 |
---|---|---|
committer | stuartmorgan@google.com <stuartmorgan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-27 19:30:32 +0000 |
commit | 4be98628a79d54152176eaf829916a4eb5e6777c (patch) | |
tree | b36c0db6734482cb1247d85da9c8a74afa044b71 /webkit | |
parent | 9abc1b14a6042d4575d2817b275acb6c241ec543 (diff) | |
download | chromium_src-4be98628a79d54152176eaf829916a4eb5e6777c.zip chromium_src-4be98628a79d54152176eaf829916a4eb5e6777c.tar.gz chromium_src-4be98628a79d54152176eaf829916a4eb5e6777c.tar.bz2 |
Fix partial plugin invalidate repainting on Mac.
The transport canvas and the backing store canvas are upside down relative to eachother, so the rects need some massaging.
BUG=none
TEST=YouTube videos should play without sections drawing in the wrong place, and plugins scrolled partially offscreen should draw the right section.
Review URL: http://codereview.chromium.org/159423
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21681 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/plugins/webplugin_delegate_impl_mac.mm | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/webkit/glue/plugins/webplugin_delegate_impl_mac.mm b/webkit/glue/plugins/webplugin_delegate_impl_mac.mm index 409122f..7a900b8 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl_mac.mm +++ b/webkit/glue/plugins/webplugin_delegate_impl_mac.mm @@ -258,14 +258,14 @@ void WebPluginDelegateImpl::WindowlessUpdateGeometry( if (window_rect_ != window_rect) { window_rect_ = window_rect; - window_.clipRect.top = clip_rect_.y(); - window_.clipRect.left = clip_rect_.x(); - window_.clipRect.bottom = clip_rect_.y() + clip_rect_.height(); - window_.clipRect.right = clip_rect_.x() + clip_rect_.width(); + window_.clipRect.top = 0; + window_.clipRect.left = 0; + window_.clipRect.bottom = window_rect_.height(); + window_.clipRect.right = window_rect_.width(); window_.height = window_rect_.height(); window_.width = window_rect_.width(); - window_.x = window_rect_.x(); - window_.y = window_rect_.y(); + window_.x = 0; + window_.y = 0; window_.type = NPWindowTypeDrawable; windowless_needs_set_window_ = true; } @@ -282,8 +282,8 @@ void WebPluginDelegateImpl::WindowlessPaint(gfx::NativeDrawingContext context, [NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithGraphicsPort:context flipped:NO]]; - CGContextSaveGState(context); + cg_context_.context = context; window_.window = &cg_context_; window_.type = NPWindowTypeDrawable; @@ -322,6 +322,7 @@ void WebPluginDelegateImpl::WindowlessPaint(gfx::NativeDrawingContext context, paint_event.where.v = 0; paint_event.modifiers = 0; instance()->NPP_HandleEvent(&paint_event); + CGContextRestoreGState(context); [NSGraphicsContext restoreGraphicsState]; } @@ -333,14 +334,14 @@ void WebPluginDelegateImpl::WindowlessSetWindow(bool force_set_window) { if (window_rect_.IsEmpty()) // wait for geometry to be set. return; - window_.clipRect.top = clip_rect_.y(); - window_.clipRect.left = clip_rect_.x(); - window_.clipRect.bottom = clip_rect_.y() + clip_rect_.height(); - window_.clipRect.right = clip_rect_.x() + clip_rect_.width(); + window_.clipRect.top = 0; + window_.clipRect.left = 0; + window_.clipRect.bottom = window_rect_.height(); + window_.clipRect.right = window_rect_.width(); window_.height = window_rect_.height(); window_.width = window_rect_.width(); - window_.x = window_rect_.x(); - window_.y = window_rect_.y(); + window_.x = 0; + window_.y = 0; window_.type = NPWindowTypeDrawable; if (!force_set_window) |