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

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

Issue 21159007: cc: Adding support for RGBA_4444 tile textures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed a signed vs. unsigned comparison in video_resource_updater.cc Created 7 years, 3 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_format.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"
11 #include "cc/base/cc_export.h" 11 #include "cc/base/cc_export.h"
12 #include "cc/output/renderer.h" 12 #include "cc/output/renderer.h"
13 #include "cc/resources/resource.h" 13 #include "cc/resources/resource.h"
14 #include "cc/resources/resource_format.h"
14 15
15 namespace cc { 16 namespace cc {
16 class ResourceProvider;
17 17
18 class CC_EXPORT ResourcePool { 18 class CC_EXPORT ResourcePool {
19 public: 19 public:
20 class CC_EXPORT Resource : public cc::Resource { 20 class CC_EXPORT Resource : public cc::Resource {
21 public: 21 public:
22 Resource(ResourceProvider* resource_provider, 22 Resource(ResourceProvider* resource_provider,
23 gfx::Size size, 23 gfx::Size size,
24 GLenum format); 24 ResourceFormat format);
25 ~Resource(); 25 ~Resource();
26 26
27 private: 27 private:
28 ResourceProvider* resource_provider_; 28 ResourceProvider* resource_provider_;
29 29
30 DISALLOW_COPY_AND_ASSIGN(Resource); 30 DISALLOW_COPY_AND_ASSIGN(Resource);
31 }; 31 };
32 32
33 static scoped_ptr<ResourcePool> Create(ResourceProvider* resource_provider) { 33 static scoped_ptr<ResourcePool> Create(ResourceProvider* resource_provider) {
34 return make_scoped_ptr(new ResourcePool(resource_provider)); 34 return make_scoped_ptr(new ResourcePool(resource_provider));
35 } 35 }
36 36
37 virtual ~ResourcePool(); 37 virtual ~ResourcePool();
38 38
39 scoped_ptr<ResourcePool::Resource> AcquireResource(gfx::Size size, 39 scoped_ptr<ResourcePool::Resource> AcquireResource(
40 GLenum format); 40 gfx::Size size, ResourceFormat format);
41 void ReleaseResource(scoped_ptr<ResourcePool::Resource>); 41 void ReleaseResource(scoped_ptr<ResourcePool::Resource>);
42 42
43 void SetResourceUsageLimits(size_t max_memory_usage_bytes, 43 void SetResourceUsageLimits(size_t max_memory_usage_bytes,
44 size_t max_unused_memory_usage_bytes, 44 size_t max_unused_memory_usage_bytes,
45 size_t max_resource_count); 45 size_t max_resource_count);
46 46
47 void ReduceResourceUsage(); 47 void ReduceResourceUsage();
48 48
49 size_t total_memory_usage_bytes() const { 49 size_t total_memory_usage_bytes() const {
50 return memory_usage_bytes_; 50 return memory_usage_bytes_;
(...skipping 21 matching lines...) Expand all
72 72
73 typedef std::list<Resource*> ResourceList; 73 typedef std::list<Resource*> ResourceList;
74 ResourceList unused_resources_; 74 ResourceList unused_resources_;
75 75
76 DISALLOW_COPY_AND_ASSIGN(ResourcePool); 76 DISALLOW_COPY_AND_ASSIGN(ResourcePool);
77 }; 77 };
78 78
79 } // namespace cc 79 } // namespace cc
80 80
81 #endif // CC_RESOURCES_RESOURCE_POOL_H_ 81 #endif // CC_RESOURCES_RESOURCE_POOL_H_
OLDNEW
« no previous file with comments | « cc/resources/resource_format.cc ('k') | cc/resources/resource_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698