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/layer_tree_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 rendering_stats_instrumentation_(rendering_stats_instrumentation), | 235 rendering_stats_instrumentation_(rendering_stats_instrumentation), |
236 micro_benchmark_controller_(this), | 236 micro_benchmark_controller_(this), |
237 shared_bitmap_manager_(shared_bitmap_manager), | 237 shared_bitmap_manager_(shared_bitmap_manager), |
238 gpu_memory_buffer_manager_(gpu_memory_buffer_manager), | 238 gpu_memory_buffer_manager_(gpu_memory_buffer_manager), |
239 task_graph_runner_(task_graph_runner), | 239 task_graph_runner_(task_graph_runner), |
240 id_(id), | 240 id_(id), |
241 requires_high_res_to_draw_(false), | 241 requires_high_res_to_draw_(false), |
242 is_likely_to_require_a_draw_(false), | 242 is_likely_to_require_a_draw_(false), |
243 frame_timing_tracker_(FrameTimingTracker::Create(this)) { | 243 frame_timing_tracker_(FrameTimingTracker::Create(this)) { |
244 DCHECK(proxy_->IsImplThread()); | 244 DCHECK(proxy_->IsImplThread()); |
245 DCHECK_IMPLIES(settings.use_one_copy, !settings.use_zero_copy); | 245 DCHECK(!settings.use_one_copy || !settings.use_zero_copy); |
246 DCHECK_IMPLIES(settings.use_zero_copy, !settings.use_one_copy); | |
247 DidVisibilityChange(this, visible_); | 246 DidVisibilityChange(this, visible_); |
248 animation_registrar_->set_supports_scroll_animations( | 247 animation_registrar_->set_supports_scroll_animations( |
249 proxy_->SupportsImplScrolling()); | 248 proxy_->SupportsImplScrolling()); |
250 | 249 |
251 SetDebugState(settings.initial_debug_state); | 250 SetDebugState(settings.initial_debug_state); |
252 | 251 |
253 // LTHI always has an active tree. | 252 // LTHI always has an active tree. |
254 active_tree_ = | 253 active_tree_ = |
255 LayerTreeImpl::create(this, new SyncedProperty<ScaleGroup>(), | 254 LayerTreeImpl::create(this, new SyncedProperty<ScaleGroup>(), |
256 new SyncedTopControls, new SyncedElasticOverscroll); | 255 new SyncedTopControls, new SyncedElasticOverscroll); |
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
973 "draw_result", draw_result, "missing tiles", | 972 "draw_result", draw_result, "missing tiles", |
974 num_missing_tiles); | 973 num_missing_tiles); |
975 | 974 |
976 // Draw has to be successful to not drop the copy request layer. | 975 // Draw has to be successful to not drop the copy request layer. |
977 // When we have a copy request for a layer, we need to draw even if there | 976 // When we have a copy request for a layer, we need to draw even if there |
978 // would be animating checkerboards, because failing under those conditions | 977 // would be animating checkerboards, because failing under those conditions |
979 // triggers a new main frame, which may cause the copy request layer to be | 978 // triggers a new main frame, which may cause the copy request layer to be |
980 // destroyed. | 979 // destroyed. |
981 // TODO(weiliangc): Test copy request w/ output surface recreation. Would | 980 // TODO(weiliangc): Test copy request w/ output surface recreation. Would |
982 // trigger this DCHECK. | 981 // trigger this DCHECK. |
983 DCHECK_IMPLIES(have_copy_request, draw_result == DRAW_SUCCESS); | 982 DCHECK(!have_copy_request || draw_result == DRAW_SUCCESS); |
984 | 983 |
985 return draw_result; | 984 return draw_result; |
986 } | 985 } |
987 | 986 |
988 void LayerTreeHostImpl::MainThreadHasStoppedFlinging() { | 987 void LayerTreeHostImpl::MainThreadHasStoppedFlinging() { |
989 top_controls_manager_->MainThreadHasStoppedFlinging(); | 988 top_controls_manager_->MainThreadHasStoppedFlinging(); |
990 if (input_handler_client_) | 989 if (input_handler_client_) |
991 input_handler_client_->MainThreadHasStoppedFlinging(); | 990 input_handler_client_->MainThreadHasStoppedFlinging(); |
992 } | 991 } |
993 | 992 |
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2109 | 2108 |
2110 *tile_task_worker_pool = GpuTileTaskWorkerPool::Create( | 2109 *tile_task_worker_pool = GpuTileTaskWorkerPool::Create( |
2111 task_runner, task_graph_runner, context_provider, | 2110 task_runner, task_graph_runner, context_provider, |
2112 resource_provider_.get(), settings_.use_distance_field_text, | 2111 resource_provider_.get(), settings_.use_distance_field_text, |
2113 msaa_sample_count); | 2112 msaa_sample_count); |
2114 return; | 2113 return; |
2115 } | 2114 } |
2116 | 2115 |
2117 DCHECK(GetRendererCapabilities().using_image); | 2116 DCHECK(GetRendererCapabilities().using_image); |
2118 unsigned image_target = settings_.use_image_texture_target; | 2117 unsigned image_target = settings_.use_image_texture_target; |
2119 DCHECK_IMPLIES(image_target == GL_TEXTURE_RECTANGLE_ARB, | 2118 DCHECK(image_target != GL_TEXTURE_RECTANGLE_ARB || |
2120 context_provider->ContextCapabilities().gpu.texture_rectangle); | 2119 context_provider->ContextCapabilities().gpu.texture_rectangle); |
2121 DCHECK_IMPLIES( | 2120 DCHECK(image_target != GL_TEXTURE_EXTERNAL_OES || |
2122 image_target == GL_TEXTURE_EXTERNAL_OES, | 2121 context_provider->ContextCapabilities().gpu.egl_image_external); |
2123 context_provider->ContextCapabilities().gpu.egl_image_external); | |
2124 | 2122 |
2125 if (settings_.use_zero_copy) { | 2123 if (settings_.use_zero_copy) { |
2126 *resource_pool = | 2124 *resource_pool = |
2127 ResourcePool::Create(resource_provider_.get(), image_target); | 2125 ResourcePool::Create(resource_provider_.get(), image_target); |
2128 | 2126 |
2129 *tile_task_worker_pool = ZeroCopyTileTaskWorkerPool::Create( | 2127 *tile_task_worker_pool = ZeroCopyTileTaskWorkerPool::Create( |
2130 task_runner, task_graph_runner, resource_provider_.get()); | 2128 task_runner, task_graph_runner, resource_provider_.get()); |
2131 return; | 2129 return; |
2132 } | 2130 } |
2133 | 2131 |
(...skipping 1309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3443 new_target.SetToMin(layer_impl->MaxScrollOffset()); | 3441 new_target.SetToMin(layer_impl->MaxScrollOffset()); |
3444 | 3442 |
3445 curve->UpdateTarget( | 3443 curve->UpdateTarget( |
3446 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time) | 3444 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time) |
3447 .InSecondsF(), | 3445 .InSecondsF(), |
3448 new_target); | 3446 new_target); |
3449 | 3447 |
3450 return true; | 3448 return true; |
3451 } | 3449 } |
3452 } // namespace cc | 3450 } // namespace cc |
OLD | NEW |