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

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

Issue 12502016: cc: Add command line switch to control resource usage for impl-side painting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: MRU eviction pattern Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | cc/resources/resource_pool.cc » ('j') | cc/resources/resource_pool.cc » ('J')
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 26 matching lines...) Expand all
37 virtual ~ResourcePool(); 37 virtual ~ResourcePool();
38 38
39 ResourceProvider* resource_provider() { return resource_provider_; }; 39 ResourceProvider* resource_provider() { return resource_provider_; };
40 40
41 scoped_ptr<ResourcePool::Resource> AcquireResource( 41 scoped_ptr<ResourcePool::Resource> AcquireResource(
42 const gfx::Size&, GLenum format); 42 const gfx::Size&, GLenum format);
43 void ReleaseResource(scoped_ptr<ResourcePool::Resource>); 43 void ReleaseResource(scoped_ptr<ResourcePool::Resource>);
44 44
45 void SetMaxMemoryUsageBytes(size_t max_memory_usage_bytes); 45 void SetMaxMemoryUsageBytes(size_t max_memory_usage_bytes);
46 46
47 void ReduceMemoryUsage();
48
47 protected: 49 protected:
48 ResourcePool(ResourceProvider* resource_provider); 50 ResourcePool(ResourceProvider* resource_provider);
49 51
52 void EvictOneResource();
53
50 private: 54 private:
51 ResourceProvider* resource_provider_; 55 ResourceProvider* resource_provider_;
52 size_t max_memory_usage_bytes_; 56 size_t max_memory_usage_bytes_;
53 size_t memory_usage_bytes_; 57 size_t memory_usage_bytes_;
58 size_t acquired_memory_usage_bytes_;
54 59
55 typedef std::list<Resource*> ResourceList; 60 typedef std::list<Resource*> ResourceList;
56 ResourceList resources_; 61 ResourceList resources_;
57 62
58 DISALLOW_COPY_AND_ASSIGN(ResourcePool); 63 DISALLOW_COPY_AND_ASSIGN(ResourcePool);
59 }; 64 };
60 65
61 } // namespace cc 66 } // namespace cc
62 67
63 #endif // CC_RESOURCES_RESOURCE_POOL_H_ 68 #endif // CC_RESOURCES_RESOURCE_POOL_H_
OLDNEW
« no previous file with comments | « no previous file | cc/resources/resource_pool.cc » ('j') | cc/resources/resource_pool.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698