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

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

Issue 634083002: gpu: Compositor management of GpuMemoryBuffer instances. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cc-pre-chromium-image-refactor
Patch Set: rebase Created 6 years, 2 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_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('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 #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
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
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 requires_high_res_to_draw_(false) { 275 requires_high_res_to_draw_(false) {
268 DCHECK(proxy_->IsImplThread()); 276 DCHECK(proxy_->IsImplThread());
269 DidVisibilityChange(this, visible_); 277 DidVisibilityChange(this, visible_);
270 animation_registrar_->set_supports_scroll_animations( 278 animation_registrar_->set_supports_scroll_animations(
271 proxy_->SupportsImplScrolling()); 279 proxy_->SupportsImplScrolling());
272 280
273 SetDebugState(settings.initial_debug_state); 281 SetDebugState(settings.initial_debug_state);
274 282
275 // LTHI always has an active tree. 283 // LTHI always has an active tree.
(...skipping 1779 matching lines...) Expand 10 before | Expand all | Expand 10 after
2055 resource_provider_ = nullptr; 2063 resource_provider_ = nullptr;
2056 output_surface_ = nullptr; 2064 output_surface_ = nullptr;
2057 2065
2058 if (!output_surface->BindToClient(this)) 2066 if (!output_surface->BindToClient(this))
2059 return false; 2067 return false;
2060 2068
2061 output_surface_ = output_surface.Pass(); 2069 output_surface_ = output_surface.Pass();
2062 resource_provider_ = 2070 resource_provider_ =
2063 ResourceProvider::Create(output_surface_.get(), 2071 ResourceProvider::Create(output_surface_.get(),
2064 shared_bitmap_manager_, 2072 shared_bitmap_manager_,
2073 gpu_memory_buffer_manager_,
2065 proxy_->blocking_main_thread_task_runner(), 2074 proxy_->blocking_main_thread_task_runner(),
2066 settings_.highp_threshold_min, 2075 settings_.highp_threshold_min,
2067 settings_.use_rgba_4444_textures, 2076 settings_.use_rgba_4444_textures,
2068 settings_.texture_id_allocation_chunk_size, 2077 settings_.texture_id_allocation_chunk_size,
2069 settings_.use_distance_field_text); 2078 settings_.use_distance_field_text);
2070 2079
2071 if (output_surface_->capabilities().deferred_gl_initialization) 2080 if (output_surface_->capabilities().deferred_gl_initialization)
2072 EnforceZeroBudget(true); 2081 EnforceZeroBudget(true);
2073 2082
2074 CreateAndSetRenderer(); 2083 CreateAndSetRenderer();
(...skipping 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after
3385 } 3394 }
3386 3395
3387 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { 3396 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) {
3388 std::vector<PictureLayerImpl*>::iterator it = 3397 std::vector<PictureLayerImpl*>::iterator it =
3389 std::find(picture_layers_.begin(), picture_layers_.end(), layer); 3398 std::find(picture_layers_.begin(), picture_layers_.end(), layer);
3390 DCHECK(it != picture_layers_.end()); 3399 DCHECK(it != picture_layers_.end());
3391 picture_layers_.erase(it); 3400 picture_layers_.erase(it);
3392 } 3401 }
3393 3402
3394 } // namespace cc 3403 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698