Chromium Code Reviews| 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 33612b0acb372936fd2e6a378a4caad2d6cae38b..cad9301a8d579bd1928a985215e3f1e4c499fef1 100644 |
| --- a/content/renderer/gpu/render_widget_compositor.cc |
| +++ b/content/renderer/gpu/render_widget_compositor.cc |
| @@ -320,7 +320,6 @@ scoped_ptr<RenderWidgetCompositor> RenderWidgetCompositor::Create( |
| RenderWidgetCompositor::RenderWidgetCompositor(RenderWidget* widget, |
| bool threaded) |
| : threaded_(threaded), |
| - suppress_schedule_composite_(false), |
| widget_(widget) { |
| } |
| @@ -332,26 +331,13 @@ RenderWidgetCompositor::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; |
| + layer_tree_host_->SetDeferCommits(suppress); |
| } |
| bool RenderWidgetCompositor::BeginMainFrameRequested() const { |
| return layer_tree_host_->BeginMainFrameRequested(); |
| } |
| -void RenderWidgetCompositor::UpdateAnimations(base::TimeTicks time) { |
| - layer_tree_host_->UpdateClientAnimations(time); |
| -} |
| - |
| void RenderWidgetCompositor::SetNeedsDisplayOnAllLayers() { |
| layer_tree_host_->SetNeedsDisplayOnAllLayers(); |
| } |
| @@ -444,7 +430,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) { |
| @@ -585,11 +574,11 @@ 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(); |
| + |
| + // Synchronous non-scheduled compositors need an immediate composite |
| + // so that the readback comes back. |
| + if (!layer_tree_host_->settings().single_thread_proxy_scheduler) |
| layer_tree_host_->Composite(gfx::FrameTime::Now()); |
| - } |
| } |
| void RenderWidgetCompositor::finishAllRendering() { |
| @@ -683,11 +672,6 @@ void RenderWidgetCompositor::DidCompleteSwapBuffers() { |
| widget_->OnSwapBuffersComplete(); |
| } |
| -void RenderWidgetCompositor::ScheduleComposite() { |
| - if (!suppress_schedule_composite_) |
| - widget_->scheduleComposite(); |
| -} |
| - |
| void RenderWidgetCompositor::ScheduleAnimation() { |
| widget_->scheduleAnimation(); |
|
enne (OOO)
2014/07/02 21:19:43
Unfortunately, I had to bring this back to get Web
|
| } |