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

Side by Side Diff: cc/resource_pool.h

Issue 11637022: Send memory management policies to the tile manager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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
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_RESOURCE_POOL_H_ 5 #ifndef CC_RESOURCE_POOL_H_
6 #define CC_RESOURCE_POOL_H_ 6 #define CC_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 23 matching lines...) Expand all
34 } 34 }
35 35
36 virtual ~ResourcePool(); 36 virtual ~ResourcePool();
37 37
38 ResourceProvider* resource_provider() { return resource_provider_; }; 38 ResourceProvider* resource_provider() { return resource_provider_; };
39 39
40 scoped_ptr<ResourcePool::Resource> AcquireResource( 40 scoped_ptr<ResourcePool::Resource> AcquireResource(
41 const gfx::Size&, GLenum format); 41 const gfx::Size&, GLenum format);
42 void ReleaseResource(scoped_ptr<ResourcePool::Resource>); 42 void ReleaseResource(scoped_ptr<ResourcePool::Resource>);
43 43
44 void SetMaxMemoryUsageBytes(size_t max_memory_usage_bytes);
45
46 protected: 44 protected:
47 ResourcePool(ResourceProvider* resource_provider); 45 ResourcePool(ResourceProvider* resource_provider);
48 46
49 private: 47 private:
50 ResourceProvider* resource_provider_; 48 ResourceProvider* resource_provider_;
51 size_t max_memory_usage_bytes_; 49 size_t max_memory_usage_bytes_;
52 size_t memory_usage_bytes_; 50 size_t memory_usage_bytes_;
53 51
54 typedef std::list<Resource*> ResourceList; 52 typedef std::list<Resource*> ResourceList;
55 ResourceList resources_; 53 ResourceList resources_;
56 54
57 DISALLOW_COPY_AND_ASSIGN(ResourcePool); 55 DISALLOW_COPY_AND_ASSIGN(ResourcePool);
58 }; 56 };
59 57
60 } // namespace cc 58 } // namespace cc
61 59
62 #endif // CC_RESOURCE_POOL_H_ 60 #endif // CC_RESOURCE_POOL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698