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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 SetNeedsCommit(); | 168 SetNeedsCommit(); |
169 } | 169 } |
170 } | 170 } |
171 | 171 |
172 const RendererCapabilities& SingleThreadProxy::GetRendererCapabilities() const { | 172 const RendererCapabilities& SingleThreadProxy::GetRendererCapabilities() const { |
173 DCHECK(Proxy::IsMainThread()); | 173 DCHECK(Proxy::IsMainThread()); |
174 DCHECK(!layer_tree_host_->output_surface_lost()); | 174 DCHECK(!layer_tree_host_->output_surface_lost()); |
175 return renderer_capabilities_for_main_thread_; | 175 return renderer_capabilities_for_main_thread_; |
176 } | 176 } |
177 | 177 |
178 void SingleThreadProxy::SetNeedsAnimate() { | 178 void SingleThreadProxy::SetNeedsUpdateLayers() { |
179 DCHECK(Proxy::IsMainThread()); | 179 DCHECK(Proxy::IsMainThread()); |
180 client_->ScheduleAnimation(); | 180 client_->ScheduleAnimation(); |
181 } | 181 } |
182 | 182 |
183 void SingleThreadProxy::SetNeedsUpdateLayers() { | |
184 DCHECK(Proxy::IsMainThread()); | |
185 client_->ScheduleComposite(); | |
186 } | |
187 | |
188 void SingleThreadProxy::DoCommit(scoped_ptr<ResourceUpdateQueue> queue) { | 183 void SingleThreadProxy::DoCommit(scoped_ptr<ResourceUpdateQueue> queue) { |
189 DCHECK(Proxy::IsMainThread()); | 184 DCHECK(Proxy::IsMainThread()); |
190 // Commit immediately. | 185 // Commit immediately. |
191 { | 186 { |
192 DebugScopedSetMainThreadBlocked main_thread_blocked(this); | 187 DebugScopedSetMainThreadBlocked main_thread_blocked(this); |
193 DebugScopedSetImplThread impl(this); | 188 DebugScopedSetImplThread impl(this); |
194 | 189 |
195 // This CapturePostTasks should be destroyed before CommitComplete() is | 190 // This CapturePostTasks should be destroyed before CommitComplete() is |
196 // called since that goes out to the embedder, and we want the embedder | 191 // called since that goes out to the embedder, and we want the embedder |
197 // to receive its callbacks before that. | 192 // to receive its callbacks before that. |
(...skipping 350 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 |