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

Side by Side Diff: cc/resources/resource_pool.cc

Issue 860813002: Remove the default format from ResourcePool. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove ResourceFormat from TileManager and call TileTaskRunner::GetResourceFormat() directly instea… Created 5 years, 11 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/resources/resource_pool.h ('k') | cc/resources/software_rasterizer.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/resources/resource_pool.h" 5 #include "cc/resources/resource_pool.h"
6 6
7 #include "cc/resources/resource_provider.h" 7 #include "cc/resources/resource_provider.h"
8 #include "cc/resources/scoped_resource.h" 8 #include "cc/resources/scoped_resource.h"
9 9
10 namespace cc { 10 namespace cc {
11 11
12 ResourcePool::ResourcePool(ResourceProvider* resource_provider, 12 ResourcePool::ResourcePool(ResourceProvider* resource_provider, GLenum target)
13 GLenum target,
14 ResourceFormat default_format)
15 : resource_provider_(resource_provider), 13 : resource_provider_(resource_provider),
16 target_(target), 14 target_(target),
17 default_format_(default_format),
18 max_memory_usage_bytes_(0), 15 max_memory_usage_bytes_(0),
19 max_unused_memory_usage_bytes_(0), 16 max_unused_memory_usage_bytes_(0),
20 max_resource_count_(0), 17 max_resource_count_(0),
21 memory_usage_bytes_(0), 18 memory_usage_bytes_(0),
22 unused_memory_usage_bytes_(0), 19 unused_memory_usage_bytes_(0),
23 resource_count_(0) {} 20 resource_count_(0) {}
24 21
25 ResourcePool::~ResourcePool() { 22 ResourcePool::~ResourcePool() {
26 while (!busy_resources_.empty()) { 23 while (!busy_resources_.empty()) {
27 DidFinishUsingResource(busy_resources_.front()); 24 DidFinishUsingResource(busy_resources_.front());
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 } 121 }
125 } 122 }
126 } 123 }
127 124
128 void ResourcePool::DidFinishUsingResource(ScopedResource* resource) { 125 void ResourcePool::DidFinishUsingResource(ScopedResource* resource) {
129 unused_memory_usage_bytes_ += resource->bytes(); 126 unused_memory_usage_bytes_ += resource->bytes();
130 unused_resources_.push_back(resource); 127 unused_resources_.push_back(resource);
131 } 128 }
132 129
133 } // namespace cc 130 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/resource_pool.h ('k') | cc/resources/software_rasterizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698