diff options
author | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-15 14:47:41 +0000 |
---|---|---|
committer | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-15 14:47:41 +0000 |
commit | bc5fc9f3e123e4a3c9ca34bc0b0f0341d00a3e05 (patch) | |
tree | 384ff1666917498cc314f59ba820b9b81bed71d9 /webkit/glue/plugins | |
parent | f474abdb177a3c870736e8c39f59f8a171af6c2a (diff) | |
download | chromium_src-bc5fc9f3e123e4a3c9ca34bc0b0f0341d00a3e05.zip chromium_src-bc5fc9f3e123e4a3c9ca34bc0b0f0341d00a3e05.tar.gz chromium_src-bc5fc9f3e123e4a3c9ca34bc0b0f0341d00a3e05.tar.bz2 |
Remove the last remnants of windowless_needs_set_window_ from Linux plugins
Also removes the variable now that it's unused on all platforms, the WindowlessSetWindow argument that went with it, and a completely dead clipping variable.
Fixes Windows to call WindowlessSetWindow for clip rect changes (a case that used to be covered by the now-removed WindowlessSetWindow call in Draw).
BUG=none
TEST=Linux and Windows windowless plugins should still work (especially test scrolling them partially and completely off screen).
Review URL: http://codereview.chromium.org/1225009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44649 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/plugins')
-rw-r--r-- | webkit/glue/plugins/webplugin_delegate_impl.h | 11 | ||||
-rw-r--r-- | webkit/glue/plugins/webplugin_delegate_impl_gtk.cc | 24 | ||||
-rw-r--r-- | webkit/glue/plugins/webplugin_delegate_impl_mac.mm | 11 | ||||
-rw-r--r-- | webkit/glue/plugins/webplugin_delegate_impl_win.cc | 15 |
4 files changed, 15 insertions, 46 deletions
diff --git a/webkit/glue/plugins/webplugin_delegate_impl.h b/webkit/glue/plugins/webplugin_delegate_impl.h index 039223c4..7b5f970 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl.h +++ b/webkit/glue/plugins/webplugin_delegate_impl.h @@ -249,7 +249,7 @@ class WebPluginDelegateImpl : public webkit_glue::WebPluginDelegate { // Tells the plugin about the current state of the window. // See NPAPI NPP_SetWindow for more information. - void WindowlessSetWindow(bool force_set_window); + void WindowlessSetWindow(); //----------------------------------------- // used for windowed and windowless plugins @@ -275,14 +275,6 @@ class WebPluginDelegateImpl : public webkit_glue::WebPluginDelegate { bool windowed_did_set_window_; - // TODO(dglazkov): No longer used by Windows, make sure the removal - // causes no regressions and eliminate from other platforms. - // this is an optimization to avoid calling SetWindow to the plugin - // when it is not necessary. Initially, we need to call SetWindow, - // and after that we only need to call it when the geometry changes. - // use this flag to indicate whether we really need it or not. - bool windowless_needs_set_window_; - // used by windowed and windowless plugins bool windowless_; @@ -339,7 +331,6 @@ class WebPluginDelegateImpl : public webkit_glue::WebPluginDelegate { #endif gfx::Rect window_rect_; gfx::Rect clip_rect_; - std::vector<gfx::Rect> cutout_rects_; int quirks_; #if defined(OS_WIN) diff --git a/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc b/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc index 776f613..bf8b141 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc +++ b/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc @@ -41,7 +41,6 @@ WebPluginDelegateImpl::WebPluginDelegateImpl( NPAPI::PluginInstance *instance) : windowed_handle_(0), windowed_did_set_window_(false), - windowless_needs_set_window_(true), windowless_(false), plugin_(NULL), instance_(instance), @@ -229,18 +228,9 @@ void WebPluginDelegateImpl::WindowlessUpdateGeometry( if (window_rect == window_rect_ && clip_rect == clip_rect_) return; - // Set this flag before entering the instance in case of side-effects. - windowless_needs_set_window_ = true; - - // We will inform the instance of this change when we call NPP_SetWindow. clip_rect_ = clip_rect; - cutout_rects_.clear(); - - if (window_rect_ != window_rect) { - window_rect_ = window_rect; - - WindowlessSetWindow(true); - } + window_rect_ = window_rect; + WindowlessSetWindow(); } void WebPluginDelegateImpl::EnsurePixmapAtLeastSize(int width, int height) { @@ -295,11 +285,6 @@ void WebPluginDelegateImpl::WindowlessPaint(cairo_t* context, // TODO(darin): we should avoid calling NPP_SetWindow here since it may // cause page layout to be invalidated. - // We really don't need to continually call SetWindow. - // m_needsSetWindow flags when the geometry has changed. - if (windowless_needs_set_window_) - WindowlessSetWindow(false); - // The actual dirty region is just the intersection of the plugin window and // the clip window with the damage region. However, the plugin wants to draw // relative to the containing window's origin, so our pixmap must be from the @@ -452,7 +437,7 @@ void WebPluginDelegateImpl::WindowlessPaint(cairo_t* context, cairo_restore(context); } -void WebPluginDelegateImpl::WindowlessSetWindow(bool force_set_window) { +void WebPluginDelegateImpl::WindowlessSetWindow() { if (!instance()) return; @@ -485,9 +470,6 @@ void WebPluginDelegateImpl::WindowlessSetWindow(bool force_set_window) { extra->depth = DefaultDepth(GDK_DISPLAY(), 0); extra->colormap = DefaultColormap(GDK_DISPLAY(), 0); - if (!force_set_window) - windowless_needs_set_window_ = false; - NPError err = instance()->NPP_SetWindow(&window_); DCHECK(err == NPERR_NO_ERROR); if (quirks_ & PLUGIN_QUIRK_WINDOWLESS_INVALIDATE_AFTER_SET_WINDOW) { diff --git a/webkit/glue/plugins/webplugin_delegate_impl_mac.mm b/webkit/glue/plugins/webplugin_delegate_impl_mac.mm index 13ef782..9227242 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl_mac.mm +++ b/webkit/glue/plugins/webplugin_delegate_impl_mac.mm @@ -172,7 +172,6 @@ WebPluginDelegateImpl::WebPluginDelegateImpl( gfx::PluginWindowHandle containing_view, NPAPI::PluginInstance *instance) : windowed_handle_(NULL), - windowless_needs_set_window_(true), // all Mac plugins are "windowless" in the Windows/X11 sense windowless_(true), plugin_(NULL), @@ -337,7 +336,7 @@ bool WebPluginDelegateImpl::PlatformInitialize() { if (instance()->drawing_model() == NPDrawingModelQuickDraw) { const WebPluginInfo& plugin_info = instance_->plugin_lib()->plugin_info(); if (plugin_info.name.find(L"QuickTime") != std::wstring::npos) - WindowlessSetWindow(true); + WindowlessSetWindow(); } #endif @@ -456,7 +455,7 @@ void WebPluginDelegateImpl::WindowlessUpdateGeometry( #endif if (window_size_changed || clip_rect_changed) - WindowlessSetWindow(true); + WindowlessSetWindow(); } void WebPluginDelegateImpl::DrawLayerInSurface() { @@ -531,7 +530,7 @@ void WebPluginDelegateImpl::WindowlessPaint(gfx::NativeDrawingContext context, CGContextRestoreGState(context); } -void WebPluginDelegateImpl::WindowlessSetWindow(bool force_set_window) { +void WebPluginDelegateImpl::WindowlessSetWindow() { if (!instance()) return; @@ -686,7 +685,7 @@ void WebPluginDelegateImpl::SetContainerVisibility(bool is_visible) { // doesn't change anything. if (!cached_clip_rect_.IsEmpty()) { PluginVisibilityChanged(); - WindowlessSetWindow(true); + WindowlessSetWindow(); } // When the plugin become visible, send an empty invalidate. If there were any @@ -830,7 +829,7 @@ void WebPluginDelegateImpl::SetQuickDrawFastPathEnabled(bool enabled) { qd_manager_->SetFastPathEnabled(enabled); qd_port_.port = qd_manager_->port(); - WindowlessSetWindow(true); + WindowlessSetWindow(); // Send a paint event so that the new buffer gets updated immediately. WindowlessPaint(buffer_context_, clip_rect_); } diff --git a/webkit/glue/plugins/webplugin_delegate_impl_win.cc b/webkit/glue/plugins/webplugin_delegate_impl_win.cc index c898519..98fd0ed 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl_win.cc +++ b/webkit/glue/plugins/webplugin_delegate_impl_win.cc @@ -237,7 +237,6 @@ WebPluginDelegateImpl::WebPluginDelegateImpl( windowless_(false), windowed_handle_(NULL), windowed_did_set_window_(false), - windowless_needs_set_window_(true), plugin_wnd_proc_(NULL), last_message_(0), is_calling_wndproc(false), @@ -926,19 +925,17 @@ LRESULT CALLBACK WebPluginDelegateImpl::NativeWndProc( void WebPluginDelegateImpl::WindowlessUpdateGeometry( const gfx::Rect& window_rect, const gfx::Rect& clip_rect) { + bool window_rect_changed = (window_rect_ != window_rect); // Only resend to the instance if the geometry has changed. - if (window_rect == window_rect_ && clip_rect == clip_rect_) + if (!window_rect_changed && clip_rect == clip_rect_) return; - // We will inform the instance of this change when we call NPP_SetWindow. clip_rect_ = clip_rect; - cutout_rects_.clear(); - - if (window_rect_ != window_rect) { - window_rect_ = window_rect; + window_rect_ = window_rect; - WindowlessSetWindow(true); + WindowlessSetWindow(); + if (window_rect_changed) { WINDOWPOS win_pos = {0}; win_pos.x = window_rect_.x(); win_pos.y = window_rect_.y(); @@ -976,7 +973,7 @@ void WebPluginDelegateImpl::WindowlessPaint(HDC hdc, instance()->NPP_HandleEvent(&paint_event); } -void WebPluginDelegateImpl::WindowlessSetWindow(bool force_set_window) { +void WebPluginDelegateImpl::WindowlessSetWindow() { if (!instance()) return; |