| 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 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 | 161 |
| 162 LayerTreeHostImpl::FrameData::~FrameData() {} | 162 LayerTreeHostImpl::FrameData::~FrameData() {} |
| 163 | 163 |
| 164 scoped_ptr<LayerTreeHostImpl> LayerTreeHostImpl::Create( | 164 scoped_ptr<LayerTreeHostImpl> LayerTreeHostImpl::Create( |
| 165 const LayerTreeSettings& settings, | 165 const LayerTreeSettings& settings, |
| 166 LayerTreeHostImplClient* client, | 166 LayerTreeHostImplClient* client, |
| 167 Proxy* proxy, | 167 Proxy* proxy, |
| 168 RenderingStatsInstrumentation* rendering_stats_instrumentation, | 168 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
| 169 SharedBitmapManager* shared_bitmap_manager, | 169 SharedBitmapManager* shared_bitmap_manager, |
| 170 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 170 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 171 CompositorMutator* compositor_mutator, |
| 171 int id) { | 172 int id) { |
| 172 return make_scoped_ptr(new LayerTreeHostImpl(settings, | 173 return make_scoped_ptr(new LayerTreeHostImpl( |
| 173 client, | 174 settings, client, proxy, rendering_stats_instrumentation, |
| 174 proxy, | 175 shared_bitmap_manager, gpu_memory_buffer_manager, compositor_mutator, |
| 175 rendering_stats_instrumentation, | 176 id)); |
| 176 shared_bitmap_manager, | |
| 177 gpu_memory_buffer_manager, | |
| 178 id)); | |
| 179 } | 177 } |
| 180 | 178 |
| 181 LayerTreeHostImpl::LayerTreeHostImpl( | 179 LayerTreeHostImpl::LayerTreeHostImpl( |
| 182 const LayerTreeSettings& settings, | 180 const LayerTreeSettings& settings, |
| 183 LayerTreeHostImplClient* client, | 181 LayerTreeHostImplClient* client, |
| 184 Proxy* proxy, | 182 Proxy* proxy, |
| 185 RenderingStatsInstrumentation* rendering_stats_instrumentation, | 183 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
| 186 SharedBitmapManager* shared_bitmap_manager, | 184 SharedBitmapManager* shared_bitmap_manager, |
| 187 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 185 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 186 CompositorMutator* compositor_mutator, |
| 188 int id) | 187 int id) |
| 189 : client_(client), | 188 : client_(client), |
| 190 proxy_(proxy), | 189 proxy_(proxy), |
| 191 use_gpu_rasterization_(false), | 190 use_gpu_rasterization_(false), |
| 192 gpu_rasterization_status_(GpuRasterizationStatus::OFF_DEVICE), | 191 gpu_rasterization_status_(GpuRasterizationStatus::OFF_DEVICE), |
| 193 input_handler_client_(NULL), | 192 input_handler_client_(NULL), |
| 194 did_lock_scrolling_layer_(false), | 193 did_lock_scrolling_layer_(false), |
| 195 should_bubble_scrolls_(false), | 194 should_bubble_scrolls_(false), |
| 196 wheel_scrolling_(false), | 195 wheel_scrolling_(false), |
| 197 scroll_affects_scroll_handler_(false), | 196 scroll_affects_scroll_handler_(false), |
| (...skipping 18 matching lines...) Expand all Loading... |
| 216 max_memory_needed_bytes_(0), | 215 max_memory_needed_bytes_(0), |
| 217 zero_budget_(false), | 216 zero_budget_(false), |
| 218 device_scale_factor_(1.f), | 217 device_scale_factor_(1.f), |
| 219 resourceless_software_draw_(false), | 218 resourceless_software_draw_(false), |
| 220 begin_impl_frame_interval_(BeginFrameArgs::DefaultInterval()), | 219 begin_impl_frame_interval_(BeginFrameArgs::DefaultInterval()), |
| 221 animation_registrar_(AnimationRegistrar::Create()), | 220 animation_registrar_(AnimationRegistrar::Create()), |
| 222 rendering_stats_instrumentation_(rendering_stats_instrumentation), | 221 rendering_stats_instrumentation_(rendering_stats_instrumentation), |
| 223 micro_benchmark_controller_(this), | 222 micro_benchmark_controller_(this), |
| 224 shared_bitmap_manager_(shared_bitmap_manager), | 223 shared_bitmap_manager_(shared_bitmap_manager), |
| 225 gpu_memory_buffer_manager_(gpu_memory_buffer_manager), | 224 gpu_memory_buffer_manager_(gpu_memory_buffer_manager), |
| 225 compositor_mutator_(compositor_mutator), |
| 226 id_(id), | 226 id_(id), |
| 227 requires_high_res_to_draw_(false), | 227 requires_high_res_to_draw_(false), |
| 228 is_likely_to_require_a_draw_(false), | 228 is_likely_to_require_a_draw_(false), |
| 229 frame_timing_tracker_(FrameTimingTracker::Create()) { | 229 frame_timing_tracker_(FrameTimingTracker::Create()) { |
| 230 DCHECK(proxy_->IsImplThread()); | 230 DCHECK(proxy_->IsImplThread()); |
| 231 DidVisibilityChange(this, visible_); | 231 DidVisibilityChange(this, visible_); |
| 232 animation_registrar_->set_supports_scroll_animations( | 232 animation_registrar_->set_supports_scroll_animations( |
| 233 proxy_->SupportsImplScrolling()); | 233 proxy_->SupportsImplScrolling()); |
| 234 | 234 |
| 235 SetDebugState(settings.initial_debug_state); | 235 SetDebugState(settings.initial_debug_state); |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 | 379 |
| 380 void LayerTreeHostImpl::Animate(base::TimeTicks monotonic_time) { | 380 void LayerTreeHostImpl::Animate(base::TimeTicks monotonic_time) { |
| 381 if (input_handler_client_) | 381 if (input_handler_client_) |
| 382 input_handler_client_->Animate(monotonic_time); | 382 input_handler_client_->Animate(monotonic_time); |
| 383 AnimatePageScale(monotonic_time); | 383 AnimatePageScale(monotonic_time); |
| 384 AnimateLayers(monotonic_time); | 384 AnimateLayers(monotonic_time); |
| 385 AnimateScrollbars(monotonic_time); | 385 AnimateScrollbars(monotonic_time); |
| 386 AnimateTopControls(monotonic_time); | 386 AnimateTopControls(monotonic_time); |
| 387 } | 387 } |
| 388 | 388 |
| 389 void LayerTreeHostImpl::ApplyCustomMutations(base::TimeTicks monotonic_time) { |
| 390 // ... |
| 391 compositor_mutator_->ApplyCustomMutations(monotonic_time, |
| 392 std::vector<Mutation>()); |
| 393 // ... |
| 394 } |
| 395 |
| 389 void LayerTreeHostImpl::PrepareTiles() { | 396 void LayerTreeHostImpl::PrepareTiles() { |
| 390 if (!tile_manager_) | 397 if (!tile_manager_) |
| 391 return; | 398 return; |
| 392 if (!tile_priorities_dirty_) | 399 if (!tile_priorities_dirty_) |
| 393 return; | 400 return; |
| 394 | 401 |
| 395 tile_priorities_dirty_ = false; | 402 tile_priorities_dirty_ = false; |
| 396 tile_manager_->PrepareTiles(global_tile_state_); | 403 tile_manager_->PrepareTiles(global_tile_state_); |
| 397 | 404 |
| 398 client_->DidPrepareTiles(); | 405 client_->DidPrepareTiles(); |
| (...skipping 3071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3470 new_target.SetToMin(layer_impl->MaxScrollOffset()); | 3477 new_target.SetToMin(layer_impl->MaxScrollOffset()); |
| 3471 | 3478 |
| 3472 curve->UpdateTarget( | 3479 curve->UpdateTarget( |
| 3473 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time) | 3480 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time) |
| 3474 .InSecondsF(), | 3481 .InSecondsF(), |
| 3475 new_target); | 3482 new_target); |
| 3476 | 3483 |
| 3477 return true; | 3484 return true; |
| 3478 } | 3485 } |
| 3479 } // namespace cc | 3486 } // namespace cc |
| OLD | NEW |