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

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

Issue 1808633002: Use preferred format to allocate memory for decoded images (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 2127 matching lines...) Expand 10 before | Expand all | Expand 10 after
2138 client_->UpdateRendererCapabilitiesOnImplThread(); 2138 client_->UpdateRendererCapabilitiesOnImplThread();
2139 } 2139 }
2140 2140
2141 void LayerTreeHostImpl::CreateTileManagerResources() { 2141 void LayerTreeHostImpl::CreateTileManagerResources() {
2142 CreateResourceAndTileTaskWorkerPool(&tile_task_worker_pool_, &resource_pool_); 2142 CreateResourceAndTileTaskWorkerPool(&tile_task_worker_pool_, &resource_pool_);
2143 2143
2144 if (use_gpu_rasterization_) { 2144 if (use_gpu_rasterization_) {
2145 image_decode_controller_ = make_scoped_ptr(new GpuImageDecodeController); 2145 image_decode_controller_ = make_scoped_ptr(new GpuImageDecodeController);
2146 } else { 2146 } else {
2147 image_decode_controller_ = 2147 image_decode_controller_ =
2148 make_scoped_ptr(new SoftwareImageDecodeController); 2148 make_scoped_ptr(new SoftwareImageDecodeController(
2149 settings_.renderer_settings.preferred_tile_format));
2149 } 2150 }
2150 2151
2151 // TODO(vmpstr): Initialize tile task limit at ctor time. 2152 // TODO(vmpstr): Initialize tile task limit at ctor time.
2152 tile_manager_->SetResources( 2153 tile_manager_->SetResources(
2153 resource_pool_.get(), tile_task_worker_pool_->AsTileTaskRunner(), 2154 resource_pool_.get(), tile_task_worker_pool_->AsTileTaskRunner(),
2154 image_decode_controller_.get(), 2155 image_decode_controller_.get(),
2155 is_synchronous_single_threaded_ ? std::numeric_limits<size_t>::max() 2156 is_synchronous_single_threaded_ ? std::numeric_limits<size_t>::max()
2156 : settings_.scheduled_raster_task_limit, 2157 : settings_.scheduled_raster_task_limit,
2157 use_gpu_rasterization_); 2158 use_gpu_rasterization_);
2158 UpdateTileManagerMemoryPolicy(ActualManagedMemoryPolicy()); 2159 UpdateTileManagerMemoryPolicy(ActualManagedMemoryPolicy());
(...skipping 1768 matching lines...) Expand 10 before | Expand all | Expand 10 after
3927 return task_runner_provider_->HasImplThread(); 3928 return task_runner_provider_->HasImplThread();
3928 } 3929 }
3929 3930
3930 bool LayerTreeHostImpl::CommitToActiveTree() const { 3931 bool LayerTreeHostImpl::CommitToActiveTree() const {
3931 // In single threaded mode we skip the pending tree and commit directly to the 3932 // In single threaded mode we skip the pending tree and commit directly to the
3932 // active tree. 3933 // active tree.
3933 return !task_runner_provider_->HasImplThread(); 3934 return !task_runner_provider_->HasImplThread();
3934 } 3935 }
3935 3936
3936 } // namespace cc 3937 } // namespace cc
OLDNEW
« cc/tiles/software_image_decode_controller.h ('K') | « cc/tiles/software_image_decode_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698