Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 14409006: cc: Changes to use GL API for GpuMemoryBuffers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@glapi
Patch Set: Add internalformat parameter to CreateImageCHROMIUM in fake_web_graphics_context_3d to fix clang bu… Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/trees/layer_tree_host.cc ('k') | cc/trees/layer_tree_settings.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host.cc ('k') | cc/trees/layer_tree_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698