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

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: Created 5 years, 2 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
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 9
10 #include "base/containers/scoped_ptr_map.h" 10 #include "base/containers/scoped_ptr_map.h"
(...skipping 21 matching lines...) Expand all
32 ResourceProvider* resource_provider, 32 ResourceProvider* resource_provider,
33 base::SingleThreadTaskRunner* task_runner, 33 base::SingleThreadTaskRunner* task_runner,
34 GLenum target) { 34 GLenum target) {
35 DCHECK_NE(0u, target); 35 DCHECK_NE(0u, target);
36 return make_scoped_ptr( 36 return make_scoped_ptr(
37 new ResourcePool(resource_provider, task_runner, target)); 37 new ResourcePool(resource_provider, task_runner, target));
38 } 38 }
39 39
40 ~ResourcePool() override; 40 ~ResourcePool() override;
41 41
42 Resource* AcquireResource(const gfx::Size& size, ResourceFormat format); 42 Resource* AcquireResource(const gfx::Size& desired_size,
43 ResourceFormat format);
43 Resource* TryAcquireResourceWithContentId(uint64 content_id); 44 Resource* TryAcquireResourceWithContentId(uint64 content_id);
44 void ReleaseResource(Resource* resource, uint64_t content_id); 45 void ReleaseResource(Resource* resource, uint64_t content_id);
45 46
46 void SetResourceUsageLimits(size_t max_memory_usage_bytes, 47 void SetResourceUsageLimits(size_t max_memory_usage_bytes,
47 size_t max_resource_count); 48 size_t max_resource_count);
48 49
49 void ReduceResourceUsage(); 50 void ReduceResourceUsage();
50 void CheckBusyResources(); 51 void CheckBusyResources();
51 52
52 size_t memory_usage_bytes() const { return in_use_memory_usage_bytes_; } 53 size_t memory_usage_bytes() const { return in_use_memory_usage_bytes_; }
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 base::TimeDelta resource_expiration_delay_; 131 base::TimeDelta resource_expiration_delay_;
131 132
132 base::WeakPtrFactory<ResourcePool> weak_ptr_factory_; 133 base::WeakPtrFactory<ResourcePool> weak_ptr_factory_;
133 134
134 DISALLOW_COPY_AND_ASSIGN(ResourcePool); 135 DISALLOW_COPY_AND_ASSIGN(ResourcePool);
135 }; 136 };
136 137
137 } // namespace cc 138 } // namespace cc
138 139
139 #endif // CC_RESOURCES_RESOURCE_POOL_H_ 140 #endif // CC_RESOURCES_RESOURCE_POOL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698