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

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

Issue 1336703002: Revert of Re-land: cc: Use worker context for one-copy tile initialization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 <deque> 8 #include <deque>
9 9
10 #include "base/containers/scoped_ptr_map.h" 10 #include "base/containers/scoped_ptr_map.h"
(...skipping 23 matching lines...) Expand all
34 34
35 Resource* AcquireResource(const gfx::Size& size, ResourceFormat format); 35 Resource* AcquireResource(const gfx::Size& size, ResourceFormat format);
36 Resource* TryAcquireResourceWithContentId(uint64 content_id); 36 Resource* TryAcquireResourceWithContentId(uint64 content_id);
37 void ReleaseResource(Resource* resource, uint64_t content_id); 37 void ReleaseResource(Resource* resource, uint64_t content_id);
38 38
39 void SetResourceUsageLimits(size_t max_memory_usage_bytes, 39 void SetResourceUsageLimits(size_t max_memory_usage_bytes,
40 size_t max_unused_memory_usage_bytes, 40 size_t max_unused_memory_usage_bytes,
41 size_t max_resource_count); 41 size_t max_resource_count);
42 42
43 void ReduceResourceUsage(); 43 void ReduceResourceUsage();
44 void CheckBusyResources(); 44 // This might block if |wait_if_needed| is true and one of the currently
45 // busy resources has a read lock fence that needs to be waited upon before
46 // it can be locked for write again.
47 void CheckBusyResources(bool wait_if_needed);
45 48
46 size_t total_memory_usage_bytes() const { return memory_usage_bytes_; } 49 size_t total_memory_usage_bytes() const { return memory_usage_bytes_; }
47 size_t acquired_memory_usage_bytes() const { 50 size_t acquired_memory_usage_bytes() const {
48 return memory_usage_bytes_ - unused_memory_usage_bytes_; 51 return memory_usage_bytes_ - unused_memory_usage_bytes_;
49 } 52 }
50 size_t total_resource_count() const { return resource_count_; } 53 size_t total_resource_count() const { return resource_count_; }
51 size_t acquired_resource_count() const { 54 size_t acquired_resource_count() const {
52 return resource_count_ - unused_resources_.size(); 55 return resource_count_ - unused_resources_.size();
53 } 56 }
54 size_t busy_resource_count() const { return busy_resources_.size(); } 57 size_t busy_resource_count() const { return busy_resources_.size(); }
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 104
102 using ResourceMap = base::ScopedPtrMap<ResourceId, scoped_ptr<PoolResource>>; 105 using ResourceMap = base::ScopedPtrMap<ResourceId, scoped_ptr<PoolResource>>;
103 ResourceMap in_use_resources_; 106 ResourceMap in_use_resources_;
104 107
105 DISALLOW_COPY_AND_ASSIGN(ResourcePool); 108 DISALLOW_COPY_AND_ASSIGN(ResourcePool);
106 }; 109 };
107 110
108 } // namespace cc 111 } // namespace cc
109 112
110 #endif // CC_RESOURCES_RESOURCE_POOL_H_ 113 #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