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/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
(...skipping 1415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1426 if (output_surface->capabilities().deferred_gl_initialization) { | 1426 if (output_surface->capabilities().deferred_gl_initialization) { |
1427 // TODO(joth): Defer creating the Renderer too, until GL is initialized. | 1427 // TODO(joth): Defer creating the Renderer too, until GL is initialized. |
1428 // See http://crbug.com/230197 | 1428 // See http://crbug.com/230197 |
1429 renderer_ = SoftwareRenderer::Create(this, output_surface.get(), NULL); | 1429 renderer_ = SoftwareRenderer::Create(this, output_surface.get(), NULL); |
1430 } else { | 1430 } else { |
1431 scoped_ptr<ResourceProvider> resource_provider = ResourceProvider::Create( | 1431 scoped_ptr<ResourceProvider> resource_provider = ResourceProvider::Create( |
1432 output_surface.get(), settings_.highp_threshold_min); | 1432 output_surface.get(), settings_.highp_threshold_min); |
1433 if (!resource_provider) | 1433 if (!resource_provider) |
1434 return false; | 1434 return false; |
1435 | 1435 |
1436 if (settings_.impl_side_painting) { | |
1437 tile_manager_ = TileManager::Create(this, | |
1438 resource_provider.get(), | |
1439 settings_.num_raster_threads, | |
1440 settings_.use_color_estimator, | |
1441 rendering_stats_instrumentation_); | |
1442 UpdateTileManagerMemoryPolicy(ActualManagedMemoryPolicy()); | |
1443 } | |
1444 | |
1445 if (output_surface->capabilities().has_parent_compositor) { | 1436 if (output_surface->capabilities().has_parent_compositor) { |
1446 renderer_ = DelegatingRenderer::Create(this, output_surface.get(), | 1437 renderer_ = DelegatingRenderer::Create(this, output_surface.get(), |
1447 resource_provider.get()); | 1438 resource_provider.get()); |
1448 } else if (output_surface->context3d()) { | 1439 } else if (output_surface->context3d()) { |
1449 renderer_ = GLRenderer::Create(this, | 1440 renderer_ = GLRenderer::Create(this, |
1450 output_surface.get(), | 1441 output_surface.get(), |
1451 resource_provider.get(), | 1442 resource_provider.get(), |
1452 settings_.highp_threshold_min, | 1443 settings_.highp_threshold_min, |
1453 settings_.force_direct_layer_drawing); | 1444 settings_.force_direct_layer_drawing); |
1454 } else if (output_surface->software_device()) { | 1445 } else if (output_surface->software_device()) { |
1455 renderer_ = SoftwareRenderer::Create(this, | 1446 renderer_ = SoftwareRenderer::Create(this, |
1456 output_surface.get(), | 1447 output_surface.get(), |
1457 resource_provider.get()); | 1448 resource_provider.get()); |
1458 } | 1449 } |
1459 if (!renderer_) | 1450 if (!renderer_) |
1460 return false; | 1451 return false; |
1461 | 1452 |
| 1453 if (settings_.impl_side_painting) { |
| 1454 bool using_map_image = GetRendererCapabilities().using_map_image; |
| 1455 tile_manager_ = TileManager::Create(this, |
| 1456 resource_provider.get(), |
| 1457 settings_.num_raster_threads, |
| 1458 settings_.use_color_estimator, |
| 1459 rendering_stats_instrumentation_, |
| 1460 using_map_image); |
| 1461 UpdateTileManagerMemoryPolicy(ActualManagedMemoryPolicy()); |
| 1462 } |
| 1463 |
1462 resource_provider_ = resource_provider.Pass(); | 1464 resource_provider_ = resource_provider.Pass(); |
1463 } | 1465 } |
1464 | 1466 |
1465 output_surface_ = output_surface.Pass(); | 1467 output_surface_ = output_surface.Pass(); |
1466 | 1468 |
1467 if (!visible_) | 1469 if (!visible_) |
1468 renderer_->SetVisible(visible_); | 1470 renderer_->SetVisible(visible_); |
1469 | 1471 |
1470 client_->OnCanDrawStateChanged(CanDraw()); | 1472 client_->OnCanDrawStateChanged(CanDraw()); |
1471 | 1473 |
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2234 } | 2236 } |
2235 | 2237 |
2236 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { | 2238 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { |
2237 if (debug_state_.continuous_painting != debug_state.continuous_painting) | 2239 if (debug_state_.continuous_painting != debug_state.continuous_painting) |
2238 paint_time_counter_->ClearHistory(); | 2240 paint_time_counter_->ClearHistory(); |
2239 | 2241 |
2240 debug_state_ = debug_state; | 2242 debug_state_ = debug_state; |
2241 } | 2243 } |
2242 | 2244 |
2243 } // namespace cc | 2245 } // namespace cc |
OLD | NEW |