Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(456)

Unified Diff: content/renderer/render_widget.cc

Issue 1385043002: cc: Remove SetLayerTreeHostClientReady() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@startcomp
Patch Set: sky's offline comment Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_widget.h ('k') | content/test/web_layer_tree_view_impl_for_testing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_widget.cc
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index c9a9a41fd9cdd4e78a87fd5dd172f2f40078c166..78e5df11a24cc7577e4b48c5d18a89dd7e95aa90 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -492,7 +492,7 @@ RenderWidget::RenderWidget(CompositorDependencies* compositor_deps,
need_update_rect_for_auto_resize_(false),
did_show_(false),
is_hidden_(hidden),
- never_visible_(never_visible),
+ compositor_never_visible_(never_visible),
is_fullscreen_granted_(false),
display_mode_(blink::WebDisplayModeUndefined),
has_focus_(false),
@@ -967,7 +967,7 @@ GURL RenderWidget::GetURLForGraphicsContext3D() {
scoped_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface(bool fallback) {
// For widgets that are never visible, we don't start the compositor, so we
// never get a request for a cc::OutputSurface.
- DCHECK(!never_visible_);
+ DCHECK(!compositor_never_visible_);
#if defined(OS_ANDROID)
if (SynchronousCompositorFactory* factory =
@@ -1339,6 +1339,12 @@ void RenderWidget::initializeLayerTreeView() {
compositor_ = RenderWidgetCompositor::Create(this, compositor_deps_);
compositor_->setViewportSize(size_, physical_backing_size_);
+
+ // For background pages and certain tests, we don't want to trigger
+ // OutputSurface creation.
+ if (compositor_never_visible_ || !RenderThreadImpl::current())
+ compositor_->SetNeverVisible();
+
StartCompositor();
}
@@ -2168,15 +2174,8 @@ void RenderWidget::didOverscroll(
}
void RenderWidget::StartCompositor() {
- // For widgets that are never visible, we don't need the compositor to run
- // at all.
- if (never_visible_)
- return;
- // In tests without a RenderThreadImpl, don't set ready as this kicks
- // off creating output surfaces that the test can't create.
- if (!RenderThreadImpl::current())
- return;
- compositor_->StartCompositor();
+ if (!is_hidden())
+ compositor_->setVisible(true);
}
void RenderWidget::SchedulePluginMove(const WebPluginGeometry& move) {
« no previous file with comments | « content/renderer/render_widget.h ('k') | content/test/web_layer_tree_view_impl_for_testing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698