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

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
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 void CheckBusyResources(bool wait_if_needed);
38 38
39 size_t total_memory_usage_bytes() const { return memory_usage_bytes_; } 39 size_t total_memory_usage_bytes() const { return memory_usage_bytes_; }
40 size_t acquired_memory_usage_bytes() const { 40 size_t acquired_memory_usage_bytes() const {
41 return memory_usage_bytes_ - unused_memory_usage_bytes_; 41 return memory_usage_bytes_ - unused_memory_usage_bytes_;
42 } 42 }
43 size_t total_resource_count() const { return resource_count_; } 43 size_t total_resource_count() const { return resource_count_; }
44 size_t acquired_resource_count() const { 44 size_t acquired_resource_count() const {
45 return resource_count_ - unused_resources_.size(); 45 return resource_count_ - unused_resources_.size();
46 } 46 }
47 size_t busy_resource_count() const { return busy_resources_.size(); } 47 size_t busy_resource_count() const { return busy_resources_.size(); }
(...skipping 23 matching lines...) Expand all
71 typedef std::list<ScopedResource*> ResourceList; 71 typedef std::list<ScopedResource*> ResourceList;
72 ResourceList unused_resources_; 72 ResourceList unused_resources_;
73 ResourceList busy_resources_; 73 ResourceList busy_resources_;
74 74
75 DISALLOW_COPY_AND_ASSIGN(ResourcePool); 75 DISALLOW_COPY_AND_ASSIGN(ResourcePool);
76 }; 76 };
77 77
78 } // namespace cc 78 } // namespace cc
79 79
80 #endif // CC_RESOURCES_RESOURCE_POOL_H_ 80 #endif // CC_RESOURCES_RESOURCE_POOL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698