| OLD | NEW | 
|---|
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #include "cc/trees/single_thread_proxy.h" | 5 #include "cc/trees/single_thread_proxy.h" | 
| 6 | 6 | 
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" | 
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" | 
| 9 #include "cc/debug/benchmark_instrumentation.h" | 9 #include "cc/debug/benchmark_instrumentation.h" | 
| 10 #include "cc/output/context_provider.h" | 10 #include "cc/output/context_provider.h" | 
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 121   layer_tree_host_->RequestNewOutputSurface(); | 121   layer_tree_host_->RequestNewOutputSurface(); | 
| 122 } | 122 } | 
| 123 | 123 | 
| 124 void SingleThreadProxy::SetOutputSurface( | 124 void SingleThreadProxy::SetOutputSurface( | 
| 125     scoped_ptr<OutputSurface> output_surface) { | 125     scoped_ptr<OutputSurface> output_surface) { | 
| 126   DCHECK(Proxy::IsMainThread()); | 126   DCHECK(Proxy::IsMainThread()); | 
| 127   DCHECK(layer_tree_host_->output_surface_lost()); | 127   DCHECK(layer_tree_host_->output_surface_lost()); | 
| 128   output_surface_creation_requested_ = false; | 128   output_surface_creation_requested_ = false; | 
| 129   renderer_capabilities_for_main_thread_ = RendererCapabilities(); | 129   renderer_capabilities_for_main_thread_ = RendererCapabilities(); | 
| 130 | 130 | 
| 131   bool success = !!output_surface; | 131   bool success; | 
| 132   if (success) { | 132   { | 
| 133     DebugScopedSetMainThreadBlocked main_thread_blocked(this); | 133     DebugScopedSetMainThreadBlocked main_thread_blocked(this); | 
| 134     DebugScopedSetImplThread impl(this); | 134     DebugScopedSetImplThread impl(this); | 
| 135     layer_tree_host_->DeleteContentsTexturesOnImplThread( | 135     layer_tree_host_->DeleteContentsTexturesOnImplThread( | 
| 136         layer_tree_host_impl_->resource_provider()); | 136         layer_tree_host_impl_->resource_provider()); | 
| 137     success = layer_tree_host_impl_->InitializeRenderer(output_surface.Pass()); | 137     success = layer_tree_host_impl_->InitializeRenderer(output_surface.Pass()); | 
| 138   } | 138   } | 
| 139 | 139 | 
| 140   layer_tree_host_->OnCreateAndInitializeOutputSurfaceAttempted(success); |  | 
| 141 |  | 
| 142   if (success) { | 140   if (success) { | 
|  | 141     layer_tree_host_->DidInitializeOutputSurface(); | 
| 143     if (scheduler_on_impl_thread_) | 142     if (scheduler_on_impl_thread_) | 
| 144       scheduler_on_impl_thread_->DidCreateAndInitializeOutputSurface(); | 143       scheduler_on_impl_thread_->DidCreateAndInitializeOutputSurface(); | 
| 145     else if (!inside_synchronous_composite_) | 144     else if (!inside_synchronous_composite_) | 
| 146       SetNeedsCommit(); | 145       SetNeedsCommit(); | 
| 147   } else if (Proxy::MainThreadTaskRunner()) { | 146   } else { | 
| 148     ScheduleRequestNewOutputSurface(); | 147     layer_tree_host_->DidFailToInitializeOutputSurface(); | 
| 149   } | 148   } | 
| 150 } | 149 } | 
| 151 | 150 | 
| 152 const RendererCapabilities& SingleThreadProxy::GetRendererCapabilities() const { | 151 const RendererCapabilities& SingleThreadProxy::GetRendererCapabilities() const { | 
| 153   DCHECK(Proxy::IsMainThread()); | 152   DCHECK(Proxy::IsMainThread()); | 
| 154   DCHECK(!layer_tree_host_->output_surface_lost()); | 153   DCHECK(!layer_tree_host_->output_surface_lost()); | 
| 155   return renderer_capabilities_for_main_thread_; | 154   return renderer_capabilities_for_main_thread_; | 
| 156 } | 155 } | 
| 157 | 156 | 
| 158 void SingleThreadProxy::SetNeedsAnimate() { | 157 void SingleThreadProxy::SetNeedsAnimate() { | 
| (...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 795 | 794 | 
| 796 void SingleThreadProxy::DidBeginImplFrameDeadline() { | 795 void SingleThreadProxy::DidBeginImplFrameDeadline() { | 
| 797   layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame(); | 796   layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame(); | 
| 798 } | 797 } | 
| 799 | 798 | 
| 800 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { | 799 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { | 
| 801   layer_tree_host_->SendBeginFramesToChildren(args); | 800   layer_tree_host_->SendBeginFramesToChildren(args); | 
| 802 } | 801 } | 
| 803 | 802 | 
| 804 }  // namespace cc | 803 }  // namespace cc | 
| OLD | NEW | 
|---|