diff options
author | alexst@chromium.org <alexst@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-08 02:41:28 +0000 |
---|---|---|
committer | alexst@chromium.org <alexst@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-08 02:41:28 +0000 |
commit | 34bb3ace821d6a370d023fa7b6b8cd6114e85746 (patch) | |
tree | 7b5d3b6aac1fadaa2b90e727e5da8ee633b1adc7 /content/renderer | |
parent | 450e788f0af4bce630433be7d19f3e0c0d791984 (diff) | |
download | chromium_src-34bb3ace821d6a370d023fa7b6b8cd6114e85746.zip chromium_src-34bb3ace821d6a370d023fa7b6b8cd6114e85746.tar.gz chromium_src-34bb3ace821d6a370d023fa7b6b8cd6114e85746.tar.bz2 |
Disable partial swaps for webview guest renderer until we can figure out how to do that properly.
BUG=179256
Review URL: https://chromiumcodereview.appspot.com/12463007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186863 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer')
-rw-r--r-- | content/renderer/browser_plugin/browser_plugin_compositing_helper.cc | 1 | ||||
-rw-r--r-- | content/renderer/gpu/render_widget_compositor.cc | 2 | ||||
-rw-r--r-- | content/renderer/render_thread_impl.cc | 3 | ||||
-rw-r--r-- | content/renderer/render_view_impl.cc | 14 | ||||
-rw-r--r-- | content/renderer/render_view_impl.h | 6 | ||||
-rw-r--r-- | content/renderer/render_view_impl_params.cc | 6 | ||||
-rw-r--r-- | content/renderer/render_view_impl_params.h | 4 | ||||
-rw-r--r-- | content/renderer/render_widget.cc | 4 | ||||
-rw-r--r-- | content/renderer/render_widget.h | 2 |
9 files changed, 33 insertions, 9 deletions
diff --git a/content/renderer/browser_plugin/browser_plugin_compositing_helper.cc b/content/renderer/browser_plugin/browser_plugin_compositing_helper.cc index 544ff1b..88c3d5c 100644 --- a/content/renderer/browser_plugin/browser_plugin_compositing_helper.cc +++ b/content/renderer/browser_plugin/browser_plugin_compositing_helper.cc @@ -220,6 +220,7 @@ void BrowserPluginCompositingHelper::OnBuffersSwapped( } texture_layer_->setTextureMailbox(cc::TextureMailbox(mailbox_name, callback)); + texture_layer_->setNeedsDisplay(); last_mailbox_valid_ = current_mailbox_valid; } diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc index 123956f..9869d657 100644 --- a/content/renderer/gpu/render_widget_compositor.cc +++ b/content/renderer/gpu/render_widget_compositor.cc @@ -171,7 +171,7 @@ scoped_ptr<RenderWidgetCompositor> RenderWidgetCompositor::Create( settings.topControlsHideThreshold = hide_threshold; } - settings.partialSwapEnabled = + settings.partialSwapEnabled = widget->AllowPartialSwap() && cmd->HasSwitch(cc::switches::kEnablePartialSwap); settings.backgroundColorInsteadOfCheckerboard = cmd->HasSwitch(cc::switches::kBackgroundColorInsteadOfCheckerboard); diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc index 2fbd677..ad61b04 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc @@ -1131,7 +1131,8 @@ void RenderThreadImpl::OnCreateNewView(const ViewMsg_New_Params& params) { params.swapped_out, params.next_page_id, params.screen_info, - params.accessibility_mode); + params.accessibility_mode, + params.allow_partial_swap); } GpuChannelHost* RenderThreadImpl::EstablishGpuChannelSync( diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc index 99f90d4..97c85fc 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc @@ -659,6 +659,7 @@ RenderViewImpl::RenderViewImpl(RenderViewImplParams* params) decrement_shared_popup_at_destruction_(false), handling_select_range_(false), next_snapshot_id_(0), + allow_partial_swap_(params->allow_partial_swap), #if defined(OS_WIN) focused_plugin_id_(-1), #endif @@ -892,7 +893,8 @@ RenderViewImpl* RenderViewImpl::Create( bool swapped_out, int32 next_page_id, const WebKit::WebScreenInfo& screen_info, - AccessibilityMode accessibility_mode) { + AccessibilityMode accessibility_mode, + bool allow_partial_swap) { DCHECK(routing_id != MSG_ROUTING_NONE); RenderViewImplParams params( opener_id, @@ -907,7 +909,8 @@ RenderViewImpl* RenderViewImpl::Create( swapped_out, next_page_id, screen_info, - accessibility_mode); + accessibility_mode, + allow_partial_swap); RenderViewImpl* render_view = NULL; if (g_create_render_view_impl) render_view = g_create_render_view_impl(¶ms); @@ -1963,7 +1966,8 @@ WebView* RenderViewImpl::createView( false, 1, screen_info_, - accessibility_mode_); + accessibility_mode_, + allow_partial_swap_); view->opened_by_user_gesture_ = params.user_gesture; // Record whether the creator frame is trying to suppress the opener field. @@ -6223,6 +6227,10 @@ void RenderViewImpl::InstrumentWillComposite() { webview()->devToolsAgent()->willComposite(); } +bool RenderViewImpl::AllowPartialSwap() const { + return allow_partial_swap_; +} + #if defined(OS_WIN) void RenderViewImpl::PluginFocusChanged(bool focused, int plugin_id) { if (focused) diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h index c11df2c..d8ec834 100644 --- a/content/renderer/render_view_impl.h +++ b/content/renderer/render_view_impl.h @@ -223,7 +223,8 @@ class CONTENT_EXPORT RenderViewImpl bool swapped_out, int32 next_page_id, const WebKit::WebScreenInfo& screen_info, - AccessibilityMode accessibility_mode); + AccessibilityMode accessibility_mode, + bool allow_partial_swap); // Used by content_layouttest_support to hook into the creation of // RenderViewImpls. @@ -830,6 +831,7 @@ class CONTENT_EXPORT RenderViewImpl virtual void InstrumentDidBeginFrame() OVERRIDE; virtual void InstrumentDidCancelFrame() OVERRIDE; virtual void InstrumentWillComposite() OVERRIDE; + virtual bool AllowPartialSwap() const OVERRIDE; protected: explicit RenderViewImpl(RenderViewImplParams* params); @@ -1550,6 +1552,8 @@ class CONTENT_EXPORT RenderViewImpl PendingSnapshotMap; PendingSnapshotMap pending_snapshots_; + bool allow_partial_swap_; + // Plugins ------------------------------------------------------------------- // All the currently active plugin delegates for this RenderView; kept so diff --git a/content/renderer/render_view_impl_params.cc b/content/renderer/render_view_impl_params.cc index 49ea830..5035b35 100644 --- a/content/renderer/render_view_impl_params.cc +++ b/content/renderer/render_view_impl_params.cc @@ -19,7 +19,8 @@ RenderViewImplParams::RenderViewImplParams( bool swapped_out, int32 next_page_id, const WebKit::WebScreenInfo& screen_info, - AccessibilityMode accessibility_mode) + AccessibilityMode accessibility_mode, + bool allow_partial_swap) : opener_id(opener_id), renderer_prefs(renderer_prefs), webkit_prefs(webkit_prefs), @@ -32,7 +33,8 @@ RenderViewImplParams::RenderViewImplParams( swapped_out(swapped_out), next_page_id(next_page_id), screen_info(screen_info), - accessibility_mode(accessibility_mode) { + accessibility_mode(accessibility_mode), + allow_partial_swap(allow_partial_swap){ } RenderViewImplParams::~RenderViewImplParams() {} diff --git a/content/renderer/render_view_impl_params.h b/content/renderer/render_view_impl_params.h index 19db5eb..7288ab1 100644 --- a/content/renderer/render_view_impl_params.h +++ b/content/renderer/render_view_impl_params.h @@ -38,7 +38,8 @@ struct CONTENT_EXPORT RenderViewImplParams { bool swapped_out, int32 next_page_id, const WebKit::WebScreenInfo& screen_info, - AccessibilityMode accessibility_mode); + AccessibilityMode accessibility_mode, + bool allow_partial_swap); ~RenderViewImplParams(); int32 opener_id; @@ -54,6 +55,7 @@ struct CONTENT_EXPORT RenderViewImplParams { int32 next_page_id; const WebKit::WebScreenInfo& screen_info; AccessibilityMode accessibility_mode; + bool allow_partial_swap; }; } // namespace content diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc index 7ab8dc1..45b7a94 100644 --- a/content/renderer/render_widget.cc +++ b/content/renderer/render_widget.cc @@ -277,6 +277,10 @@ void RenderWidget::SetSwappedOut(bool is_swapped_out) { RenderProcess::current()->AddRefProcess(); } +bool RenderWidget::AllowPartialSwap() const { + return true; +} + bool RenderWidget::OnMessageReceived(const IPC::Message& message) { bool handled = true; IPC_BEGIN_MESSAGE_MAP(RenderWidget, message) diff --git a/content/renderer/render_widget.h b/content/renderer/render_widget.h index 1cf9832..f556915 100644 --- a/content/renderer/render_widget.h +++ b/content/renderer/render_widget.h @@ -210,6 +210,8 @@ class CONTENT_EXPORT RenderWidget virtual void InstrumentDidCancelFrame() {} virtual void InstrumentWillComposite() {} + virtual bool AllowPartialSwap() const; + protected: // Friend RefCounted so that the dtor can be non-public. Using this class // without ref-counting is an error. |