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

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

Issue 1379783002: Allow one-copy task tile worker pool to use compressed textures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use memory_efficient_format* settings and revert allocation modifications Created 5 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
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 <deque> 8 #include <deque>
9 #include <map> 9 #include <map>
10 10
(...skipping 18 matching lines...) Expand all
29 29
30 static scoped_ptr<ResourcePool> Create( 30 static scoped_ptr<ResourcePool> Create(
31 ResourceProvider* resource_provider, 31 ResourceProvider* resource_provider,
32 base::SingleThreadTaskRunner* task_runner) { 32 base::SingleThreadTaskRunner* task_runner) {
33 return make_scoped_ptr( 33 return make_scoped_ptr(
34 new ResourcePool(resource_provider, task_runner, false)); 34 new ResourcePool(resource_provider, task_runner, false));
35 } 35 }
36 36
37 ~ResourcePool() override; 37 ~ResourcePool() override;
38 38
39 Resource* AcquireResource(const gfx::Size& size, ResourceFormat format); 39 Resource* AcquireResource(const gfx::Size& desired_size,
40 ResourceFormat format);
40 Resource* TryAcquireResourceWithContentId(uint64 content_id); 41 Resource* TryAcquireResourceWithContentId(uint64 content_id);
41 void ReleaseResource(Resource* resource, uint64_t content_id); 42 void ReleaseResource(Resource* resource, uint64_t content_id);
42 43
43 void SetResourceUsageLimits(size_t max_memory_usage_bytes, 44 void SetResourceUsageLimits(size_t max_memory_usage_bytes,
44 size_t max_resource_count); 45 size_t max_resource_count);
45 46
46 void ReduceResourceUsage(); 47 void ReduceResourceUsage();
47 void CheckBusyResources(); 48 void CheckBusyResources();
48 49
49 size_t memory_usage_bytes() const { return in_use_memory_usage_bytes_; } 50 size_t memory_usage_bytes() const { return in_use_memory_usage_bytes_; }
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 base::TimeDelta resource_expiration_delay_; 128 base::TimeDelta resource_expiration_delay_;
128 129
129 base::WeakPtrFactory<ResourcePool> weak_ptr_factory_; 130 base::WeakPtrFactory<ResourcePool> weak_ptr_factory_;
130 131
131 DISALLOW_COPY_AND_ASSIGN(ResourcePool); 132 DISALLOW_COPY_AND_ASSIGN(ResourcePool);
132 }; 133 };
133 134
134 } // namespace cc 135 } // namespace cc
135 136
136 #endif // CC_RESOURCES_RESOURCE_POOL_H_ 137 #endif // CC_RESOURCES_RESOURCE_POOL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698