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/single_thread_proxy.h" | 5 #include "cc/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/draw_quad.h" | 9 #include "cc/draw_quad.h" |
10 #include "cc/layer_tree_host.h" | 10 #include "cc/layer_tree_host.h" |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 | 340 |
341 // Called by the legacy scheduling path (e.g. where render_widget does the sched
uling) | 341 // Called by the legacy scheduling path (e.g. where render_widget does the sched
uling) |
342 void SingleThreadProxy::compositeImmediately() | 342 void SingleThreadProxy::compositeImmediately() |
343 { | 343 { |
344 if (commitAndComposite()) { | 344 if (commitAndComposite()) { |
345 m_layerTreeHostImpl->swapBuffers(); | 345 m_layerTreeHostImpl->swapBuffers(); |
346 didSwapFrame(); | 346 didSwapFrame(); |
347 } | 347 } |
348 } | 348 } |
349 | 349 |
| 350 scoped_ptr<base::Value> SingleThreadProxy::asValue() const |
| 351 { |
| 352 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
| 353 { |
| 354 // The following line casts away const modifiers because it is just |
| 355 // setting debug state. We still want the asValue() function and its |
| 356 // call chain to be const throughout. |
| 357 DebugScopedSetImplThread impl(const_cast<SingleThreadProxy*>(this)); |
| 358 |
| 359 state->Set("layer_tree_host_impl", m_layerTreeHostImpl->asValue().releas
e()); |
| 360 } |
| 361 return state.PassAs<base::Value>(); |
| 362 } |
| 363 |
350 void SingleThreadProxy::forceSerializeOnSwapBuffers() | 364 void SingleThreadProxy::forceSerializeOnSwapBuffers() |
351 { | 365 { |
352 { | 366 { |
353 DebugScopedSetImplThread impl(this); | 367 DebugScopedSetImplThread impl(this); |
354 if (m_rendererInitialized) | 368 if (m_rendererInitialized) |
355 m_layerTreeHostImpl->renderer()->doNoOp(); | 369 m_layerTreeHostImpl->renderer()->doNoOp(); |
356 } | 370 } |
357 } | 371 } |
358 | 372 |
359 void SingleThreadProxy::onSwapBuffersCompleteOnImplThread() | 373 void SingleThreadProxy::onSwapBuffersCompleteOnImplThread() |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 } | 443 } |
430 | 444 |
431 skia::RefPtr<SkPicture> SingleThreadProxy::capturePicture() | 445 skia::RefPtr<SkPicture> SingleThreadProxy::capturePicture() |
432 { | 446 { |
433 // Requires impl-side painting, which is only supported in threaded composit
ing. | 447 // Requires impl-side painting, which is only supported in threaded composit
ing. |
434 NOTREACHED(); | 448 NOTREACHED(); |
435 return skia::RefPtr<SkPicture>(); | 449 return skia::RefPtr<SkPicture>(); |
436 } | 450 } |
437 | 451 |
438 } // namespace cc | 452 } // namespace cc |
OLD | NEW |