| 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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 // there as the main thread is not blocked, so any posted tasks inside | 362 // there as the main thread is not blocked, so any posted tasks inside |
| 363 // the swap buffers will execute first. | 363 // the swap buffers will execute first. |
| 364 BlockingTaskRunner::CapturePostTasks blocked; | 364 BlockingTaskRunner::CapturePostTasks blocked; |
| 365 | 365 |
| 366 layer_tree_host_impl_->SwapBuffers(frame); | 366 layer_tree_host_impl_->SwapBuffers(frame); |
| 367 } | 367 } |
| 368 DidSwapFrame(); | 368 DidSwapFrame(); |
| 369 } | 369 } |
| 370 } | 370 } |
| 371 | 371 |
| 372 void SingleThreadProxy::AsValueInto(base::debug::TracedValue* state) const { | 372 scoped_ptr<base::Value> SingleThreadProxy::AsValue() const { |
| 373 // The following line casts away const modifiers because it is just | 373 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
| 374 // setting debug state. We still want the AsValue() function and its | 374 { |
| 375 // call chain to be const throughout. | 375 // The following line casts away const modifiers because it is just |
| 376 DebugScopedSetImplThread impl(const_cast<SingleThreadProxy*>(this)); | 376 // setting debug state. We still want the AsValue() function and its |
| 377 // call chain to be const throughout. |
| 378 DebugScopedSetImplThread impl(const_cast<SingleThreadProxy*>(this)); |
| 377 | 379 |
| 378 state->BeginDictionary("layer_tree_host_impl"); | 380 state->Set("layer_tree_host_impl", |
| 379 layer_tree_host_impl_->AsValueInto(state); | 381 layer_tree_host_impl_->AsValue().release()); |
| 380 state->EndDictionary(); | 382 } |
| 383 return state.PassAs<base::Value>(); |
| 381 } | 384 } |
| 382 | 385 |
| 383 void SingleThreadProxy::ForceSerializeOnSwapBuffers() { | 386 void SingleThreadProxy::ForceSerializeOnSwapBuffers() { |
| 384 { | 387 { |
| 385 DebugScopedSetImplThread impl(this); | 388 DebugScopedSetImplThread impl(this); |
| 386 if (layer_tree_host_impl_->renderer()) { | 389 if (layer_tree_host_impl_->renderer()) { |
| 387 DCHECK(!layer_tree_host_->output_surface_lost()); | 390 DCHECK(!layer_tree_host_->output_surface_lost()); |
| 388 layer_tree_host_impl_->renderer()->DoNoOp(); | 391 layer_tree_host_impl_->renderer()->DoNoOp(); |
| 389 } | 392 } |
| 390 } | 393 } |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 void SingleThreadProxy::DidSwapFrame() { | 457 void SingleThreadProxy::DidSwapFrame() { |
| 455 if (next_frame_is_newly_committed_frame_) { | 458 if (next_frame_is_newly_committed_frame_) { |
| 456 next_frame_is_newly_committed_frame_ = false; | 459 next_frame_is_newly_committed_frame_ = false; |
| 457 layer_tree_host_->DidCommitAndDrawFrame(); | 460 layer_tree_host_->DidCommitAndDrawFrame(); |
| 458 } | 461 } |
| 459 } | 462 } |
| 460 | 463 |
| 461 bool SingleThreadProxy::CommitPendingForTesting() { return false; } | 464 bool SingleThreadProxy::CommitPendingForTesting() { return false; } |
| 462 | 465 |
| 463 } // namespace cc | 466 } // namespace cc |
| OLD | NEW |