Chromium Code Reviews| 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/thread_proxy.h" | 5 #include "cc/trees/thread_proxy.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/debug/trace_event.h" | 12 #include "base/debug/trace_event.h" |
| 13 #include "base/debug/trace_event_synthetic_delay.h" | 13 #include "base/debug/trace_event_synthetic_delay.h" |
| 14 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
| 15 #include "cc/base/swap_promise.h" | 15 #include "cc/base/swap_promise.h" |
| 16 #include "cc/debug/benchmark_instrumentation.h" | 16 #include "cc/debug/benchmark_instrumentation.h" |
| 17 #include "cc/debug/devtools_instrumentation.h" | 17 #include "cc/debug/devtools_instrumentation.h" |
| 18 #include "cc/input/input_handler.h" | 18 #include "cc/input/input_handler.h" |
| 19 #include "cc/output/context_provider.h" | 19 #include "cc/output/context_provider.h" |
| 20 #include "cc/output/output_surface.h" | 20 #include "cc/output/output_surface.h" |
| 21 #include "cc/quads/draw_quad.h" | 21 #include "cc/quads/draw_quad.h" |
| 22 #include "cc/resources/prioritized_resource_manager.h" | 22 #include "cc/resources/prioritized_resource_manager.h" |
| 23 #include "cc/scheduler/delay_based_time_source.h" | 23 #include "cc/scheduler/delay_based_time_source.h" |
| 24 #include "cc/scheduler/scheduler.h" | 24 #include "cc/scheduler/scheduler.h" |
| 25 #include "cc/trees/blocking_task_runner.h" | 25 #include "cc/trees/blocking_task_runner.h" |
| 26 #include "cc/trees/layer_tree_host.h" | 26 #include "cc/trees/layer_tree_host.h" |
| 27 #include "cc/trees/layer_tree_impl.h" | 27 #include "cc/trees/layer_tree_impl.h" |
| 28 #include "gpu/command_buffer/client/gles2_interface.h" | |
| 28 #include "ui/gfx/frame_time.h" | 29 #include "ui/gfx/frame_time.h" |
| 29 | 30 |
| 31 using gpu::gles2::GLES2Interface; | |
|
danakj
2014/07/14 15:29:12
not needed?
sohanjg
2014/07/14 15:59:28
Done.
| |
| 32 | |
| 30 namespace { | 33 namespace { |
| 31 | 34 |
| 32 // Measured in seconds. | 35 // Measured in seconds. |
| 33 const double kSmoothnessTakesPriorityExpirationDelay = 0.25; | 36 const double kSmoothnessTakesPriorityExpirationDelay = 0.25; |
| 34 | 37 |
| 35 unsigned int nextBeginFrameId = 0; | 38 unsigned int nextBeginFrameId = 0; |
| 36 | 39 |
| 37 class SwapPromiseChecker { | 40 class SwapPromiseChecker { |
| 38 public: | 41 public: |
| 39 explicit SwapPromiseChecker(cc::LayerTreeHost* layer_tree_host) | 42 explicit SwapPromiseChecker(cc::LayerTreeHost* layer_tree_host) |
| (...skipping 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1266 success, | 1269 success, |
| 1267 capabilities)); | 1270 capabilities)); |
| 1268 | 1271 |
| 1269 if (success) | 1272 if (success) |
| 1270 impl().scheduler->DidCreateAndInitializeOutputSurface(); | 1273 impl().scheduler->DidCreateAndInitializeOutputSurface(); |
| 1271 } | 1274 } |
| 1272 | 1275 |
| 1273 void ThreadProxy::FinishGLOnImplThread(CompletionEvent* completion) { | 1276 void ThreadProxy::FinishGLOnImplThread(CompletionEvent* completion) { |
| 1274 TRACE_EVENT0("cc", "ThreadProxy::FinishGLOnImplThread"); | 1277 TRACE_EVENT0("cc", "ThreadProxy::FinishGLOnImplThread"); |
| 1275 DCHECK(IsImplThread()); | 1278 DCHECK(IsImplThread()); |
| 1276 if (impl().layer_tree_host_impl->resource_provider()) | 1279 if (impl().layer_tree_host_impl->output_surface()->context_provider()) |
|
danakj
2014/07/14 15:29:11
need {} for multi-line body.
how about a temp var
sohanjg
2014/07/14 15:59:28
Done.
| |
| 1277 impl().layer_tree_host_impl->resource_provider()->Finish(); | 1280 impl() |
| 1281 .layer_tree_host_impl->output_surface() | |
| 1282 ->context_provider() | |
| 1283 ->ContextGL() | |
| 1284 ->Finish(); | |
| 1278 completion->Signal(); | 1285 completion->Signal(); |
| 1279 } | 1286 } |
| 1280 | 1287 |
| 1281 void ThreadProxy::LayerTreeHostClosedOnImplThread(CompletionEvent* completion) { | 1288 void ThreadProxy::LayerTreeHostClosedOnImplThread(CompletionEvent* completion) { |
| 1282 TRACE_EVENT0("cc", "ThreadProxy::LayerTreeHostClosedOnImplThread"); | 1289 TRACE_EVENT0("cc", "ThreadProxy::LayerTreeHostClosedOnImplThread"); |
| 1283 DCHECK(IsImplThread()); | 1290 DCHECK(IsImplThread()); |
| 1284 DCHECK(IsMainThreadBlocked()); | 1291 DCHECK(IsMainThreadBlocked()); |
| 1285 layer_tree_host()->DeleteContentsTexturesOnImplThread( | 1292 layer_tree_host()->DeleteContentsTexturesOnImplThread( |
| 1286 impl().layer_tree_host_impl->resource_provider()); | 1293 impl().layer_tree_host_impl->resource_provider()); |
| 1287 impl().current_resource_update_controller.reset(); | 1294 impl().current_resource_update_controller.reset(); |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1446 | 1453 |
| 1447 impl().timing_history.DidActivateSyncTree(); | 1454 impl().timing_history.DidActivateSyncTree(); |
| 1448 } | 1455 } |
| 1449 | 1456 |
| 1450 void ThreadProxy::DidManageTiles() { | 1457 void ThreadProxy::DidManageTiles() { |
| 1451 DCHECK(IsImplThread()); | 1458 DCHECK(IsImplThread()); |
| 1452 impl().scheduler->DidManageTiles(); | 1459 impl().scheduler->DidManageTiles(); |
| 1453 } | 1460 } |
| 1454 | 1461 |
| 1455 } // namespace cc | 1462 } // namespace cc |
| OLD | NEW |