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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 SetNeedsCommit(); | 169 SetNeedsCommit(); |
170 } | 170 } |
171 } | 171 } |
172 | 172 |
173 const RendererCapabilities& SingleThreadProxy::GetRendererCapabilities() const { | 173 const RendererCapabilities& SingleThreadProxy::GetRendererCapabilities() const { |
174 DCHECK(Proxy::IsMainThread()); | 174 DCHECK(Proxy::IsMainThread()); |
175 DCHECK(!layer_tree_host_->output_surface_lost()); | 175 DCHECK(!layer_tree_host_->output_surface_lost()); |
176 return renderer_capabilities_for_main_thread_; | 176 return renderer_capabilities_for_main_thread_; |
177 } | 177 } |
178 | 178 |
179 void SingleThreadProxy::SetNeedsAnimate() { | 179 void SingleThreadProxy::SetNeedsUpdateLayers() { |
180 DCHECK(Proxy::IsMainThread()); | 180 DCHECK(Proxy::IsMainThread()); |
181 client_->ScheduleAnimation(); | 181 client_->ScheduleAnimation(); |
182 } | 182 } |
183 | 183 |
184 void SingleThreadProxy::SetNeedsUpdateLayers() { | |
185 DCHECK(Proxy::IsMainThread()); | |
186 client_->ScheduleComposite(); | |
187 } | |
188 | |
189 void SingleThreadProxy::DoCommit(scoped_ptr<ResourceUpdateQueue> queue) { | 184 void SingleThreadProxy::DoCommit(scoped_ptr<ResourceUpdateQueue> queue) { |
190 DCHECK(Proxy::IsMainThread()); | 185 DCHECK(Proxy::IsMainThread()); |
191 // Commit immediately. | 186 // Commit immediately. |
192 { | 187 { |
193 DebugScopedSetMainThreadBlocked main_thread_blocked(this); | 188 DebugScopedSetMainThreadBlocked main_thread_blocked(this); |
194 DebugScopedSetImplThread impl(this); | 189 DebugScopedSetImplThread impl(this); |
195 | 190 |
196 // This CapturePostTasks should be destroyed before CommitComplete() is | 191 // This CapturePostTasks should be destroyed before CommitComplete() is |
197 // called since that goes out to the embedder, and we want the embedder | 192 // called since that goes out to the embedder, and we want the embedder |
198 // to receive its callbacks before that. | 193 // to receive its callbacks before that. |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 void SingleThreadProxy::DidSwapFrame() { | 543 void SingleThreadProxy::DidSwapFrame() { |
549 if (next_frame_is_newly_committed_frame_) { | 544 if (next_frame_is_newly_committed_frame_) { |
550 next_frame_is_newly_committed_frame_ = false; | 545 next_frame_is_newly_committed_frame_ = false; |
551 layer_tree_host_->DidCommitAndDrawFrame(); | 546 layer_tree_host_->DidCommitAndDrawFrame(); |
552 } | 547 } |
553 } | 548 } |
554 | 549 |
555 bool SingleThreadProxy::CommitPendingForTesting() { return false; } | 550 bool SingleThreadProxy::CommitPendingForTesting() { return false; } |
556 | 551 |
557 } // namespace cc | 552 } // namespace cc |
OLD | NEW |