| 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 LayerTreeHostImpl::FrameData::FrameData() | 205 LayerTreeHostImpl::FrameData::FrameData() |
| 206 : contains_incomplete_tile(false), has_no_damage(false) {} | 206 : contains_incomplete_tile(false), has_no_damage(false) {} |
| 207 | 207 |
| 208 LayerTreeHostImpl::FrameData::~FrameData() {} | 208 LayerTreeHostImpl::FrameData::~FrameData() {} |
| 209 | 209 |
| 210 scoped_ptr<LayerTreeHostImpl> LayerTreeHostImpl::Create( | 210 scoped_ptr<LayerTreeHostImpl> LayerTreeHostImpl::Create( |
| 211 const LayerTreeSettings& settings, | 211 const LayerTreeSettings& settings, |
| 212 LayerTreeHostImplClient* client, | 212 LayerTreeHostImplClient* client, |
| 213 Proxy* proxy, | 213 Proxy* proxy, |
| 214 RenderingStatsInstrumentation* rendering_stats_instrumentation, | 214 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
| 215 SharedBitmapManager* manager, | 215 SharedBitmapManager* shared_bitmap_manager, |
| 216 GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 216 int id) { | 217 int id) { |
| 217 return make_scoped_ptr(new LayerTreeHostImpl( | 218 return make_scoped_ptr(new LayerTreeHostImpl(settings, |
| 218 settings, client, proxy, rendering_stats_instrumentation, manager, id)); | 219 client, |
| 220 proxy, |
| 221 rendering_stats_instrumentation, |
| 222 shared_bitmap_manager, |
| 223 gpu_memory_buffer_manager, |
| 224 id)); |
| 219 } | 225 } |
| 220 | 226 |
| 221 LayerTreeHostImpl::LayerTreeHostImpl( | 227 LayerTreeHostImpl::LayerTreeHostImpl( |
| 222 const LayerTreeSettings& settings, | 228 const LayerTreeSettings& settings, |
| 223 LayerTreeHostImplClient* client, | 229 LayerTreeHostImplClient* client, |
| 224 Proxy* proxy, | 230 Proxy* proxy, |
| 225 RenderingStatsInstrumentation* rendering_stats_instrumentation, | 231 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
| 226 SharedBitmapManager* manager, | 232 SharedBitmapManager* shared_bitmap_manager, |
| 233 GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 227 int id) | 234 int id) |
| 228 : BeginFrameSourceMixIn(), | 235 : BeginFrameSourceMixIn(), |
| 229 client_(client), | 236 client_(client), |
| 230 proxy_(proxy), | 237 proxy_(proxy), |
| 231 use_gpu_rasterization_(false), | 238 use_gpu_rasterization_(false), |
| 232 input_handler_client_(NULL), | 239 input_handler_client_(NULL), |
| 233 did_lock_scrolling_layer_(false), | 240 did_lock_scrolling_layer_(false), |
| 234 should_bubble_scrolls_(false), | 241 should_bubble_scrolls_(false), |
| 235 wheel_scrolling_(false), | 242 wheel_scrolling_(false), |
| 236 scroll_affects_scroll_handler_(false), | 243 scroll_affects_scroll_handler_(false), |
| (...skipping 18 matching lines...) Expand all Loading... |
| 255 max_memory_needed_bytes_(0), | 262 max_memory_needed_bytes_(0), |
| 256 zero_budget_(false), | 263 zero_budget_(false), |
| 257 device_scale_factor_(1.f), | 264 device_scale_factor_(1.f), |
| 258 overhang_ui_resource_id_(0), | 265 overhang_ui_resource_id_(0), |
| 259 resourceless_software_draw_(false), | 266 resourceless_software_draw_(false), |
| 260 begin_impl_frame_interval_(BeginFrameArgs::DefaultInterval()), | 267 begin_impl_frame_interval_(BeginFrameArgs::DefaultInterval()), |
| 261 animation_registrar_(AnimationRegistrar::Create()), | 268 animation_registrar_(AnimationRegistrar::Create()), |
| 262 rendering_stats_instrumentation_(rendering_stats_instrumentation), | 269 rendering_stats_instrumentation_(rendering_stats_instrumentation), |
| 263 micro_benchmark_controller_(this), | 270 micro_benchmark_controller_(this), |
| 264 need_to_update_visible_tiles_before_draw_(false), | 271 need_to_update_visible_tiles_before_draw_(false), |
| 265 shared_bitmap_manager_(manager), | 272 shared_bitmap_manager_(shared_bitmap_manager), |
| 273 gpu_memory_buffer_manager_(gpu_memory_buffer_manager), |
| 266 id_(id) { | 274 id_(id) { |
| 267 DCHECK(proxy_->IsImplThread()); | 275 DCHECK(proxy_->IsImplThread()); |
| 268 DidVisibilityChange(this, visible_); | 276 DidVisibilityChange(this, visible_); |
| 269 animation_registrar_->set_supports_scroll_animations( | 277 animation_registrar_->set_supports_scroll_animations( |
| 270 proxy_->SupportsImplScrolling()); | 278 proxy_->SupportsImplScrolling()); |
| 271 | 279 |
| 272 SetDebugState(settings.initial_debug_state); | 280 SetDebugState(settings.initial_debug_state); |
| 273 | 281 |
| 274 // LTHI always has an active tree. | 282 // LTHI always has an active tree. |
| 275 active_tree_ = LayerTreeImpl::create(this); | 283 active_tree_ = LayerTreeImpl::create(this); |
| (...skipping 1778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2054 resource_provider_ = nullptr; | 2062 resource_provider_ = nullptr; |
| 2055 output_surface_ = nullptr; | 2063 output_surface_ = nullptr; |
| 2056 | 2064 |
| 2057 if (!output_surface->BindToClient(this)) | 2065 if (!output_surface->BindToClient(this)) |
| 2058 return false; | 2066 return false; |
| 2059 | 2067 |
| 2060 output_surface_ = output_surface.Pass(); | 2068 output_surface_ = output_surface.Pass(); |
| 2061 resource_provider_ = | 2069 resource_provider_ = |
| 2062 ResourceProvider::Create(output_surface_.get(), | 2070 ResourceProvider::Create(output_surface_.get(), |
| 2063 shared_bitmap_manager_, | 2071 shared_bitmap_manager_, |
| 2072 gpu_memory_buffer_manager_, |
| 2064 proxy_->blocking_main_thread_task_runner(), | 2073 proxy_->blocking_main_thread_task_runner(), |
| 2065 settings_.highp_threshold_min, | 2074 settings_.highp_threshold_min, |
| 2066 settings_.use_rgba_4444_textures, | 2075 settings_.use_rgba_4444_textures, |
| 2067 settings_.texture_id_allocation_chunk_size, | 2076 settings_.texture_id_allocation_chunk_size, |
| 2068 settings_.use_distance_field_text); | 2077 settings_.use_distance_field_text); |
| 2069 | 2078 |
| 2070 if (output_surface_->capabilities().deferred_gl_initialization) | 2079 if (output_surface_->capabilities().deferred_gl_initialization) |
| 2071 EnforceZeroBudget(true); | 2080 EnforceZeroBudget(true); |
| 2072 | 2081 |
| 2073 CreateAndSetRenderer(); | 2082 CreateAndSetRenderer(); |
| (...skipping 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3380 } | 3389 } |
| 3381 | 3390 |
| 3382 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 3391 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
| 3383 std::vector<PictureLayerImpl*>::iterator it = | 3392 std::vector<PictureLayerImpl*>::iterator it = |
| 3384 std::find(picture_layers_.begin(), picture_layers_.end(), layer); | 3393 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
| 3385 DCHECK(it != picture_layers_.end()); | 3394 DCHECK(it != picture_layers_.end()); |
| 3386 picture_layers_.erase(it); | 3395 picture_layers_.erase(it); |
| 3387 } | 3396 } |
| 3388 | 3397 |
| 3389 } // namespace cc | 3398 } // namespace cc |
| OLD | NEW |