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

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

Issue 1273163004: Revert of 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, 4 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/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 18 matching lines...) Expand all
29 ResourceFormat format); 29 ResourceFormat format);
30 scoped_ptr<ScopedResource> TryAcquireResourceWithContentId(uint64 content_id); 30 scoped_ptr<ScopedResource> TryAcquireResourceWithContentId(uint64 content_id);
31 void ReleaseResource(scoped_ptr<ScopedResource> resource, 31 void ReleaseResource(scoped_ptr<ScopedResource> resource,
32 uint64_t content_id); 32 uint64_t content_id);
33 33
34 void SetResourceUsageLimits(size_t max_memory_usage_bytes, 34 void SetResourceUsageLimits(size_t max_memory_usage_bytes,
35 size_t max_unused_memory_usage_bytes, 35 size_t max_unused_memory_usage_bytes,
36 size_t max_resource_count); 36 size_t max_resource_count);
37 37
38 void ReduceResourceUsage(); 38 void ReduceResourceUsage();
39 void CheckBusyResources(); 39 // This might block if |wait_if_needed| is true and one of the currently
40 // busy resources has a read lock fence that needs to be waited upon before
41 // it can be locked for write again.
42 void CheckBusyResources(bool wait_if_needed);
40 43
41 size_t total_memory_usage_bytes() const { return memory_usage_bytes_; } 44 size_t total_memory_usage_bytes() const { return memory_usage_bytes_; }
42 size_t acquired_memory_usage_bytes() const { 45 size_t acquired_memory_usage_bytes() const {
43 return memory_usage_bytes_ - unused_memory_usage_bytes_; 46 return memory_usage_bytes_ - unused_memory_usage_bytes_;
44 } 47 }
45 size_t total_resource_count() const { return resource_count_; } 48 size_t total_resource_count() const { return resource_count_; }
46 size_t acquired_resource_count() const { 49 size_t acquired_resource_count() const {
47 return resource_count_ - unused_resources_.size(); 50 return resource_count_ - unused_resources_.size();
48 } 51 }
49 size_t busy_resource_count() const { return busy_resources_.size(); } 52 size_t busy_resource_count() const { return busy_resources_.size(); }
(...skipping 25 matching lines...) Expand all
75 typedef std::deque<PoolResource> ResourceList; 78 typedef std::deque<PoolResource> ResourceList;
76 ResourceList unused_resources_; 79 ResourceList unused_resources_;
77 ResourceList busy_resources_; 80 ResourceList busy_resources_;
78 81
79 DISALLOW_COPY_AND_ASSIGN(ResourcePool); 82 DISALLOW_COPY_AND_ASSIGN(ResourcePool);
80 }; 83 };
81 84
82 } // namespace cc 85 } // namespace cc
83 86
84 #endif // CC_RESOURCES_RESOURCE_POOL_H_ 87 #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