diff options
author | aelias@chromium.org <aelias@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-08 07:03:44 +0000 |
---|---|---|
committer | aelias@chromium.org <aelias@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-08 07:03:44 +0000 |
commit | 61de581375ce3d76628772a78719cad63f0aabae (patch) | |
tree | 90e5818095cfa31182ceca09224c42d999644e4d /cc/prioritized_resource_manager.h | |
parent | de8686ed05a28324b0978b2bb81cf3407f13762b (diff) | |
download | chromium_src-61de581375ce3d76628772a78719cad63f0aabae.zip chromium_src-61de581375ce3d76628772a78719cad63f0aabae.tar.gz chromium_src-61de581375ce3d76628772a78719cad63f0aabae.tar.bz2 |
Remove static thread pointers from CC, attempt 3
BUG=152904
Review URL: https://chromiumcodereview.appspot.com/11232051
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166627 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/prioritized_resource_manager.h')
-rw-r--r-- | cc/prioritized_resource_manager.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/cc/prioritized_resource_manager.h b/cc/prioritized_resource_manager.h index 929f72f..13676ae 100644 --- a/cc/prioritized_resource_manager.h +++ b/cc/prioritized_resource_manager.h @@ -12,6 +12,7 @@ #include "base/hash_tables.h" #include "base/memory/scoped_ptr.h" #include "cc/cc_export.h" +#include "cc/proxy.h" #include "cc/prioritized_resource.h" #include "cc/priority_calculator.h" #include "cc/texture.h" @@ -32,12 +33,13 @@ struct hash<cc::PrioritizedResource*> { namespace cc { class PriorityCalculator; +class Proxy; class CC_EXPORT PrioritizedResourceManager { public: - static scoped_ptr<PrioritizedResourceManager> create(size_t maxMemoryLimitBytes, int maxTextureSize, int pool) + static scoped_ptr<PrioritizedResourceManager> create(size_t maxMemoryLimitBytes, int maxTextureSize, int pool, const Proxy* proxy) { - return make_scoped_ptr(new PrioritizedResourceManager(maxMemoryLimitBytes, maxTextureSize, pool)); + return make_scoped_ptr(new PrioritizedResourceManager(maxMemoryLimitBytes, maxTextureSize, pool, proxy)); } scoped_ptr<PrioritizedResource> createTexture(gfx::Size size, GLenum format) { @@ -108,6 +110,8 @@ public: // Mark all textures' backings as being in the drawing impl tree. void updateBackingsInDrawingImplTree(); + const Proxy* proxyForDebug() const; + private: friend class PrioritizedResourceTest; @@ -142,7 +146,7 @@ private: return a < b; } - PrioritizedResourceManager(size_t maxMemoryLimitBytes, int maxTextureSize, int pool); + PrioritizedResourceManager(size_t maxMemoryLimitBytes, int maxTextureSize, int pool, const Proxy* proxy); bool evictBackingsToReduceMemory(size_t limitBytes, int priorityCutoff, EvictionPolicy, ResourceProvider*); PrioritizedResource::Backing* createBacking(gfx::Size, GLenum format, ResourceProvider*); @@ -168,6 +172,8 @@ private: typedef base::hash_set<PrioritizedResource*> TextureSet; typedef std::vector<PrioritizedResource*> TextureVector; + const Proxy* m_proxy; + TextureSet m_textures; // This list is always sorted in eviction order, with the exception the // newly-allocated or recycled textures at the very end of the tail that |