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

Unified Diff: content/renderer/gpu/render_widget_compositor.cc

Issue 134623005: Make SingleThreadProxy a SchedulerClient (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add scoped_abort_remaining_swap_promises.h Created 6 years, 4 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/gpu/render_widget_compositor.h ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/gpu/render_widget_compositor.cc
diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc
index dc007a2fc87a6b2efc38c64b2966e0f3d81bcda1..571ca264d0505b83a812a3311044290cd748e04c 100644
--- a/content/renderer/gpu/render_widget_compositor.cc
+++ b/content/renderer/gpu/render_widget_compositor.cc
@@ -279,6 +279,8 @@ scoped_ptr<RenderWidgetCompositor> RenderWidgetCompositor::Create(
cmd->HasSwitch(cc::switches::kEnablePinchVirtualViewport);
settings.allow_antialiasing &=
!cmd->HasSwitch(cc::switches::kDisableCompositedAntialiasing);
+ settings.single_thread_proxy_scheduler =
+ !cmd->HasSwitch(switches::kDisableSingleThreadProxyScheduler);
// These flags should be mirrored by UI versions in ui/compositor/.
settings.initial_debug_state.show_debug_borders =
@@ -411,7 +413,6 @@ scoped_ptr<RenderWidgetCompositor> RenderWidgetCompositor::Create(
RenderWidgetCompositor::RenderWidgetCompositor(RenderWidget* widget,
bool threaded)
: threaded_(threaded),
- suppress_schedule_composite_(false),
widget_(widget) {
}
@@ -422,19 +423,6 @@ RenderWidgetCompositor::GetInputHandler() {
return layer_tree_host_->GetInputHandler();
}
-void RenderWidgetCompositor::SetSuppressScheduleComposite(bool suppress) {
- if (suppress_schedule_composite_ == suppress)
- return;
-
- if (suppress)
- TRACE_EVENT_ASYNC_BEGIN0(
- "gpu", "RenderWidgetCompositor::SetSuppressScheduleComposite", this);
- else
- TRACE_EVENT_ASYNC_END0(
- "gpu", "RenderWidgetCompositor::SetSuppressScheduleComposite", this);
- suppress_schedule_composite_ = suppress;
-}
-
bool RenderWidgetCompositor::BeginMainFrameRequested() const {
return layer_tree_host_->BeginMainFrameRequested();
}
@@ -547,7 +535,10 @@ void RenderWidgetCompositor::Initialize(cc::LayerTreeSettings settings) {
}
void RenderWidgetCompositor::setSurfaceReady() {
- layer_tree_host_->SetLayerTreeHostClientReady();
+ // 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())
+ layer_tree_host_->SetLayerTreeHostClientReady();
}
void RenderWidgetCompositor::setRootLayer(const blink::WebLayer& layer) {
@@ -701,9 +692,9 @@ void RenderWidgetCompositor::compositeAndReadbackAsync(
cc::CopyOutputRequest::CreateBitmapRequest(
base::Bind(&CompositeAndReadbackAsyncCallback, callback));
layer_tree_host_->root_layer()->RequestCopyOfOutput(request.Pass());
- if (!threaded_) {
- widget_->webwidget()->animate(0.0);
- widget_->webwidget()->layout();
+
+ if (!threaded_ &&
+ !layer_tree_host_->settings().single_thread_proxy_scheduler) {
layer_tree_host_->Composite(gfx::FrameTime::Now());
}
}
@@ -800,11 +791,6 @@ void RenderWidgetCompositor::DidCompleteSwapBuffers() {
widget_->OnSwapBuffersComplete();
}
-void RenderWidgetCompositor::ScheduleComposite() {
- if (!suppress_schedule_composite_)
- widget_->scheduleComposite();
-}
-
void RenderWidgetCompositor::ScheduleAnimation() {
widget_->scheduleAnimation();
}
« no previous file with comments | « content/renderer/gpu/render_widget_compositor.h ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698