| 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/output/context_provider.h" | 9 #include "cc/output/context_provider.h" |
| 10 #include "cc/output/output_surface.h" | 10 #include "cc/output/output_surface.h" |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 // Commit immediately. | 184 // Commit immediately. |
| 185 { | 185 { |
| 186 DebugScopedSetMainThreadBlocked main_thread_blocked(this); | 186 DebugScopedSetMainThreadBlocked main_thread_blocked(this); |
| 187 DebugScopedSetImplThread impl(this); | 187 DebugScopedSetImplThread impl(this); |
| 188 | 188 |
| 189 // This CapturePostTasks should be destroyed before CommitComplete() is | 189 // This CapturePostTasks should be destroyed before CommitComplete() is |
| 190 // called since that goes out to the embedder, and we want the embedder | 190 // called since that goes out to the embedder, and we want the embedder |
| 191 // to receive its callbacks before that. | 191 // to receive its callbacks before that. |
| 192 BlockingTaskRunner::CapturePostTasks blocked; | 192 BlockingTaskRunner::CapturePostTasks blocked; |
| 193 | 193 |
| 194 RenderingStatsInstrumentation* stats_instrumentation = | |
| 195 layer_tree_host_->rendering_stats_instrumentation(); | |
| 196 base::TimeTicks start_time = stats_instrumentation->StartRecording(); | |
| 197 | |
| 198 layer_tree_host_impl_->BeginCommit(); | 194 layer_tree_host_impl_->BeginCommit(); |
| 199 | 195 |
| 200 if (layer_tree_host_->contents_texture_manager()) { | 196 if (layer_tree_host_->contents_texture_manager()) { |
| 201 layer_tree_host_->contents_texture_manager()-> | 197 layer_tree_host_->contents_texture_manager()-> |
| 202 PushTexturePrioritiesToBackings(); | 198 PushTexturePrioritiesToBackings(); |
| 203 } | 199 } |
| 204 layer_tree_host_->BeginCommitOnImplThread(layer_tree_host_impl_.get()); | 200 layer_tree_host_->BeginCommitOnImplThread(layer_tree_host_impl_.get()); |
| 205 | 201 |
| 206 scoped_ptr<ResourceUpdateController> update_controller = | 202 scoped_ptr<ResourceUpdateController> update_controller = |
| 207 ResourceUpdateController::Create( | 203 ResourceUpdateController::Create( |
| (...skipping 12 matching lines...) Expand all Loading... |
| 220 | 216 |
| 221 #ifndef NDEBUG | 217 #ifndef NDEBUG |
| 222 // In the single-threaded case, the scale and scroll deltas should never be | 218 // In the single-threaded case, the scale and scroll deltas should never be |
| 223 // touched on the impl layer tree. | 219 // touched on the impl layer tree. |
| 224 scoped_ptr<ScrollAndScaleSet> scroll_info = | 220 scoped_ptr<ScrollAndScaleSet> scroll_info = |
| 225 layer_tree_host_impl_->ProcessScrollDeltas(); | 221 layer_tree_host_impl_->ProcessScrollDeltas(); |
| 226 DCHECK(!scroll_info->scrolls.size()); | 222 DCHECK(!scroll_info->scrolls.size()); |
| 227 DCHECK_EQ(1.f, scroll_info->page_scale_delta); | 223 DCHECK_EQ(1.f, scroll_info->page_scale_delta); |
| 228 #endif | 224 #endif |
| 229 | 225 |
| 230 base::TimeDelta duration = stats_instrumentation->EndRecording(start_time); | 226 RenderingStatsInstrumentation* stats_instrumentation = |
| 231 stats_instrumentation->AddCommit(duration); | 227 layer_tree_host_->rendering_stats_instrumentation(); |
| 232 stats_instrumentation->IssueTraceEventForMainThreadStats(); | 228 stats_instrumentation->IssueTraceEventForMainThreadStats(); |
| 233 stats_instrumentation->AccumulateAndClearMainThreadStats(); | 229 stats_instrumentation->AccumulateAndClearMainThreadStats(); |
| 234 } | 230 } |
| 235 layer_tree_host_->CommitComplete(); | 231 layer_tree_host_->CommitComplete(); |
| 236 next_frame_is_newly_committed_frame_ = true; | 232 next_frame_is_newly_committed_frame_ = true; |
| 237 } | 233 } |
| 238 | 234 |
| 239 void SingleThreadProxy::SetNeedsCommit() { | 235 void SingleThreadProxy::SetNeedsCommit() { |
| 240 DCHECK(Proxy::IsMainThread()); | 236 DCHECK(Proxy::IsMainThread()); |
| 241 layer_tree_host_->ScheduleComposite(); | 237 layer_tree_host_->ScheduleComposite(); |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 void SingleThreadProxy::DidSwapFrame() { | 525 void SingleThreadProxy::DidSwapFrame() { |
| 530 if (next_frame_is_newly_committed_frame_) { | 526 if (next_frame_is_newly_committed_frame_) { |
| 531 next_frame_is_newly_committed_frame_ = false; | 527 next_frame_is_newly_committed_frame_ = false; |
| 532 layer_tree_host_->DidCommitAndDrawFrame(); | 528 layer_tree_host_->DidCommitAndDrawFrame(); |
| 533 } | 529 } |
| 534 } | 530 } |
| 535 | 531 |
| 536 bool SingleThreadProxy::CommitPendingForTesting() { return false; } | 532 bool SingleThreadProxy::CommitPendingForTesting() { return false; } |
| 537 | 533 |
| 538 } // namespace cc | 534 } // namespace cc |
| OLD | NEW |