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

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

Issue 234403005: cc: Add CopyResource function to ResourceProvider API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address review feedback Created 6 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 | Annotate | Revision Log
« no previous file with comments | « cc/resources/pixel_buffer_raster_worker_pool.cc ('k') | cc/resources/resource_pool.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 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 #ifndef CC_RESOURCES_RESOURCE_POOL_H_ 5 #ifndef CC_RESOURCES_RESOURCE_POOL_H_
6 #define CC_RESOURCES_RESOURCE_POOL_H_ 6 #define CC_RESOURCES_RESOURCE_POOL_H_
7 7
8 #include <list> 8 #include <list>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 22 matching lines...) Expand all
33 size_t max_unused_memory_usage_bytes, 33 size_t max_unused_memory_usage_bytes,
34 size_t max_resource_count); 34 size_t max_resource_count);
35 35
36 void ReduceResourceUsage(); 36 void ReduceResourceUsage();
37 void CheckBusyResources(); 37 void CheckBusyResources();
38 38
39 size_t total_memory_usage_bytes() const { return memory_usage_bytes_; } 39 size_t total_memory_usage_bytes() const { return memory_usage_bytes_; }
40 size_t acquired_memory_usage_bytes() const { 40 size_t acquired_memory_usage_bytes() const {
41 return memory_usage_bytes_ - unused_memory_usage_bytes_; 41 return memory_usage_bytes_ - unused_memory_usage_bytes_;
42 } 42 }
43 size_t total_resource_count() const { return resource_count_; }
43 size_t acquired_resource_count() const { 44 size_t acquired_resource_count() const {
44 return resource_count_ - unused_resources_.size(); 45 return resource_count_ - unused_resources_.size();
45 } 46 }
46 47
47 ResourceFormat resource_format() const { return format_; } 48 ResourceFormat resource_format() const { return format_; }
48 49
49 protected: 50 protected:
50 ResourcePool(ResourceProvider* resource_provider, 51 ResourcePool(ResourceProvider* resource_provider,
51 GLenum target, 52 GLenum target,
52 ResourceFormat format); 53 ResourceFormat format);
(...skipping 16 matching lines...) Expand all
69 typedef std::list<ScopedResource*> ResourceList; 70 typedef std::list<ScopedResource*> ResourceList;
70 ResourceList unused_resources_; 71 ResourceList unused_resources_;
71 ResourceList busy_resources_; 72 ResourceList busy_resources_;
72 73
73 DISALLOW_COPY_AND_ASSIGN(ResourcePool); 74 DISALLOW_COPY_AND_ASSIGN(ResourcePool);
74 }; 75 };
75 76
76 } // namespace cc 77 } // namespace cc
77 78
78 #endif // CC_RESOURCES_RESOURCE_POOL_H_ 79 #endif // CC_RESOURCES_RESOURCE_POOL_H_
OLDNEW
« no previous file with comments | « cc/resources/pixel_buffer_raster_worker_pool.cc ('k') | cc/resources/resource_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698