| 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 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 size_t memory_nice_to_have_bytes; | 291 size_t memory_nice_to_have_bytes; |
| 292 size_t memory_used_bytes; | 292 size_t memory_used_bytes; |
| 293 tile_manager_->GetMemoryStats(&memory_required_bytes, | 293 tile_manager_->GetMemoryStats(&memory_required_bytes, |
| 294 &memory_nice_to_have_bytes, | 294 &memory_nice_to_have_bytes, |
| 295 &memory_used_bytes); | 295 &memory_used_bytes); |
| 296 SendManagedMemoryStats(memory_required_bytes, | 296 SendManagedMemoryStats(memory_required_bytes, |
| 297 memory_nice_to_have_bytes, | 297 memory_nice_to_have_bytes, |
| 298 memory_used_bytes); | 298 memory_used_bytes); |
| 299 } | 299 } |
| 300 | 300 |
| 301 void LayerTreeHostImpl::SetAnticipatedDrawTime(base::TimeTicks time) { | |
| 302 if (tile_manager_) | |
| 303 tile_manager_->SetAnticipatedDrawTime(time); | |
| 304 } | |
| 305 | |
| 306 void LayerTreeHostImpl::StartPageScaleAnimation(gfx::Vector2d target_offset, | 301 void LayerTreeHostImpl::StartPageScaleAnimation(gfx::Vector2d target_offset, |
| 307 bool anchor_point, | 302 bool anchor_point, |
| 308 float page_scale, | 303 float page_scale, |
| 309 base::TimeTicks start_time, | 304 base::TimeTicks start_time, |
| 310 base::TimeDelta duration) { | 305 base::TimeDelta duration) { |
| 311 if (!RootScrollLayer()) | 306 if (!RootScrollLayer()) |
| 312 return; | 307 return; |
| 313 | 308 |
| 314 gfx::Vector2dF scroll_total = | 309 gfx::Vector2dF scroll_total = |
| 315 RootScrollLayer()->scroll_offset() + RootScrollLayer()->scroll_delta(); | 310 RootScrollLayer()->scroll_offset() + RootScrollLayer()->scroll_delta(); |
| (...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1359 | 1354 |
| 1360 scoped_ptr<ResourceProvider> resource_provider = ResourceProvider::Create( | 1355 scoped_ptr<ResourceProvider> resource_provider = ResourceProvider::Create( |
| 1361 output_surface.get(), settings_.highp_threshold_min); | 1356 output_surface.get(), settings_.highp_threshold_min); |
| 1362 if (!resource_provider) | 1357 if (!resource_provider) |
| 1363 return false; | 1358 return false; |
| 1364 | 1359 |
| 1365 if (settings_.impl_side_painting) { | 1360 if (settings_.impl_side_painting) { |
| 1366 tile_manager_.reset(new TileManager(this, | 1361 tile_manager_.reset(new TileManager(this, |
| 1367 resource_provider.get(), | 1362 resource_provider.get(), |
| 1368 settings_.num_raster_threads, | 1363 settings_.num_raster_threads, |
| 1369 settings_.use_cheapness_estimator, | |
| 1370 settings_.use_color_estimator, | 1364 settings_.use_color_estimator, |
| 1371 settings_.prediction_benchmarking, | 1365 settings_.prediction_benchmarking, |
| 1372 rendering_stats_instrumentation_)); | 1366 rendering_stats_instrumentation_)); |
| 1373 } | 1367 } |
| 1374 | 1368 |
| 1375 if (output_surface->capabilities().has_parent_compositor) { | 1369 if (output_surface->capabilities().has_parent_compositor) { |
| 1376 renderer_ = DelegatingRenderer::Create(this, output_surface.get(), | 1370 renderer_ = DelegatingRenderer::Create(this, output_surface.get(), |
| 1377 resource_provider.get()); | 1371 resource_provider.get()); |
| 1378 } else if (output_surface->context3d()) { | 1372 } else if (output_surface->context3d()) { |
| 1379 renderer_ = GLRenderer::Create(this, | 1373 renderer_ = GLRenderer::Create(this, |
| (...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2128 } | 2122 } |
| 2129 | 2123 |
| 2130 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { | 2124 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { |
| 2131 if (debug_state_.continuous_painting != debug_state.continuous_painting) | 2125 if (debug_state_.continuous_painting != debug_state.continuous_painting) |
| 2132 paint_time_counter_->ClearHistory(); | 2126 paint_time_counter_->ClearHistory(); |
| 2133 | 2127 |
| 2134 debug_state_ = debug_state; | 2128 debug_state_ = debug_state; |
| 2135 } | 2129 } |
| 2136 | 2130 |
| 2137 } // namespace cc | 2131 } // namespace cc |
| OLD | NEW |