diff options
author | ccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-19 23:59:01 +0000 |
---|---|---|
committer | ccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-19 23:59:01 +0000 |
commit | 77a60b9b04457ab552e05751a0b863d6be875cc5 (patch) | |
tree | d5fbb5d77182954c12b81ae820637a34301f35e2 /cc/CCPrioritizedTexture.h | |
parent | 3196e42a57b359527039fff8873c5f6674d0d9a9 (diff) | |
download | chromium_src-77a60b9b04457ab552e05751a0b863d6be875cc5.zip chromium_src-77a60b9b04457ab552e05751a0b863d6be875cc5.tar.gz chromium_src-77a60b9b04457ab552e05751a0b863d6be875cc5.tar.bz2 |
Allow deletion of some (as opposed to all) textures on the impl thread.
Enable removing uploads to evicted textures from texture upload queues. Track whether not a CCPrioritizedTexture::Backing has been evicted in the structure itself. Purge texture upload queues of evicted backings instead of clearing the entire queue.
Added CCTextureUpdateControllerTest.ClearUploadsToEvictedResources to test the new eviction logic.
BUG=134750
Review URL: https://chromiumcodereview.appspot.com/10947017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157662 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/CCPrioritizedTexture.h')
-rw-r--r-- | cc/CCPrioritizedTexture.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/cc/CCPrioritizedTexture.h b/cc/CCPrioritizedTexture.h index a65a782..cd33d11 100644 --- a/cc/CCPrioritizedTexture.h +++ b/cc/CCPrioritizedTexture.h @@ -52,6 +52,8 @@ public: // taken away "soon". bool haveBackingTexture() const { return !!backing(); } + bool backingResourceWasEvicted() const; + // If canAcquireBackingTexture() is true acquireBackingTexture() will acquire // a backing texture for use. Call this whenever the texture is actually needed. void acquireBackingTexture(CCResourceProvider*); @@ -85,7 +87,7 @@ private: class Backing : public CCTexture { WTF_MAKE_NONCOPYABLE(Backing); public: - Backing(unsigned id, IntSize, GC3Denum format); + Backing(unsigned id, CCResourceProvider*, IntSize, GC3Denum format); ~Backing(); void updatePriority(); @@ -94,12 +96,19 @@ private: bool requestPriorityAtLastPriorityUpdate() const { return m_priorityAtLastPriorityUpdate; } bool wasAbovePriorityCutoffAtLastPriorityUpdate() const { return m_wasAbovePriorityCutoffAtLastPriorityUpdate; } + void deleteResource(CCResourceProvider*); + bool resourceHasBeenDeleted() const; + private: friend class CCPrioritizedTexture; CCPrioritizedTexture* m_owner; int m_priorityAtLastPriorityUpdate; bool m_ownerExistedAtLastPriorityUpdate; bool m_wasAbovePriorityCutoffAtLastPriorityUpdate; + bool m_resourceHasBeenDeleted; +#ifndef NDEBUG + CCResourceProvider* m_resourceProvider; +#endif }; CCPrioritizedTexture(CCPrioritizedTextureManager*, IntSize, GC3Denum format); |