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

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

Issue 683263004: cc: Detect miss-behaving fence extensions when using 1-copy rasterizer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@one-copy-throttling
Patch Set: rebase Created 6 years, 1 month 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/one_copy_raster_worker_pool.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"
(...skipping 16 matching lines...) Expand all
27 virtual ~ResourcePool(); 27 virtual ~ResourcePool();
28 28
29 scoped_ptr<ScopedResource> AcquireResource(const gfx::Size& size); 29 scoped_ptr<ScopedResource> AcquireResource(const gfx::Size& size);
30 void ReleaseResource(scoped_ptr<ScopedResource>); 30 void ReleaseResource(scoped_ptr<ScopedResource>);
31 31
32 void SetResourceUsageLimits(size_t max_memory_usage_bytes, 32 void SetResourceUsageLimits(size_t max_memory_usage_bytes,
33 size_t max_unused_memory_usage_bytes, 33 size_t max_unused_memory_usage_bytes,
34 size_t max_resource_count); 34 size_t max_resource_count);
35 35
36 void ReduceResourceUsage(); 36 void ReduceResourceUsage();
37 void CheckBusyResources(); 37 // This might block if |wait_if_needed| is true and one of the currently
38 // busy resources has a read lock fence that needs to be waited upon before
39 // it can be locked for write again.
40 void CheckBusyResources(bool wait_if_needed);
38 41
39 size_t total_memory_usage_bytes() const { return memory_usage_bytes_; } 42 size_t total_memory_usage_bytes() const { return memory_usage_bytes_; }
40 size_t acquired_memory_usage_bytes() const { 43 size_t acquired_memory_usage_bytes() const {
41 return memory_usage_bytes_ - unused_memory_usage_bytes_; 44 return memory_usage_bytes_ - unused_memory_usage_bytes_;
42 } 45 }
43 size_t total_resource_count() const { return resource_count_; } 46 size_t total_resource_count() const { return resource_count_; }
44 size_t acquired_resource_count() const { 47 size_t acquired_resource_count() const {
45 return resource_count_ - unused_resources_.size(); 48 return resource_count_ - unused_resources_.size();
46 } 49 }
47 size_t busy_resource_count() const { return busy_resources_.size(); } 50 size_t busy_resource_count() const { return busy_resources_.size(); }
(...skipping 23 matching lines...) Expand all
71 typedef std::list<ScopedResource*> ResourceList; 74 typedef std::list<ScopedResource*> ResourceList;
72 ResourceList unused_resources_; 75 ResourceList unused_resources_;
73 ResourceList busy_resources_; 76 ResourceList busy_resources_;
74 77
75 DISALLOW_COPY_AND_ASSIGN(ResourcePool); 78 DISALLOW_COPY_AND_ASSIGN(ResourcePool);
76 }; 79 };
77 80
78 } // namespace cc 81 } // namespace cc
79 82
80 #endif // CC_RESOURCES_RESOURCE_POOL_H_ 83 #endif // CC_RESOURCES_RESOURCE_POOL_H_
OLDNEW
« no previous file with comments | « cc/resources/one_copy_raster_worker_pool.cc ('k') | cc/resources/resource_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698