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

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: Created 7 years, 8 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
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/command_line.h"
10 #include "base/debug/trace_event.h" 11 #include "base/debug/trace_event.h"
11 #include "base/json/json_writer.h" 12 #include "base/json/json_writer.h"
12 #include "base/metrics/histogram.h" 13 #include "base/metrics/histogram.h"
13 #include "base/stl_util.h" 14 #include "base/stl_util.h"
14 #include "base/stringprintf.h" 15 #include "base/stringprintf.h"
15 #include "cc/animation/scrollbar_animation_controller.h" 16 #include "cc/animation/scrollbar_animation_controller.h"
16 #include "cc/base/math_util.h" 17 #include "cc/base/math_util.h"
18 #include "cc/base/switches.h"
17 #include "cc/base/util.h" 19 #include "cc/base/util.h"
18 #include "cc/debug/debug_rect_history.h" 20 #include "cc/debug/debug_rect_history.h"
19 #include "cc/debug/frame_rate_counter.h" 21 #include "cc/debug/frame_rate_counter.h"
20 #include "cc/debug/overdraw_metrics.h" 22 #include "cc/debug/overdraw_metrics.h"
21 #include "cc/debug/paint_time_counter.h" 23 #include "cc/debug/paint_time_counter.h"
22 #include "cc/debug/rendering_stats_instrumentation.h" 24 #include "cc/debug/rendering_stats_instrumentation.h"
23 #include "cc/input/page_scale_animation.h" 25 #include "cc/input/page_scale_animation.h"
24 #include "cc/input/top_controls_manager.h" 26 #include "cc/input/top_controls_manager.h"
25 #include "cc/layers/append_quads_data.h" 27 #include "cc/layers/append_quads_data.h"
26 #include "cc/layers/heads_up_display_layer_impl.h" 28 #include "cc/layers/heads_up_display_layer_impl.h"
(...skipping 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after
1333 output_surface_.reset(); 1335 output_surface_.reset();
1334 1336
1335 if (!output_surface->BindToClient(this)) 1337 if (!output_surface->BindToClient(this))
1336 return false; 1338 return false;
1337 1339
1338 scoped_ptr<ResourceProvider> resource_provider = ResourceProvider::Create( 1340 scoped_ptr<ResourceProvider> resource_provider = ResourceProvider::Create(
1339 output_surface.get(), settings_.highp_threshold_min); 1341 output_surface.get(), settings_.highp_threshold_min);
1340 if (!resource_provider) 1342 if (!resource_provider)
1341 return false; 1343 return false;
1342 1344
1345 if (CommandLine::ForCurrentProcess()->HasSwitch(
jamesr 2013/04/25 22:50:46 I don't think this is a good way to plumb this set
kaanb1 2013/04/25 23:55:05 Done.
1346 cc::switches::kUseGpuMemoryBuffers))
1347 resource_provider->SetUseGpuMemoryBuffers(true);
1348
1343 if (settings_.impl_side_painting) { 1349 if (settings_.impl_side_painting) {
1344 tile_manager_.reset(new TileManager(this, 1350 tile_manager_.reset(new TileManager(this,
1345 resource_provider.get(), 1351 resource_provider.get(),
1346 settings_.num_raster_threads, 1352 settings_.num_raster_threads,
1347 settings_.use_cheapness_estimator, 1353 settings_.use_cheapness_estimator,
1348 settings_.use_color_estimator, 1354 settings_.use_color_estimator,
1349 settings_.prediction_benchmarking, 1355 settings_.prediction_benchmarking,
1350 rendering_stats_instrumentation_)); 1356 rendering_stats_instrumentation_));
1351 } 1357 }
1352 1358
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after
2116 } 2122 }
2117 2123
2118 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { 2124 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) {
2119 if (debug_state_.continuous_painting != debug_state.continuous_painting) 2125 if (debug_state_.continuous_painting != debug_state.continuous_painting)
2120 paint_time_counter_->ClearHistory(); 2126 paint_time_counter_->ClearHistory();
2121 2127
2122 debug_state_ = debug_state; 2128 debug_state_ = debug_state;
2123 } 2129 }
2124 2130
2125 } // namespace cc 2131 } // namespace cc
OLDNEW
« cc/resources/resource_provider.cc ('K') | « cc/resources/resource_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698