diff options
Diffstat (limited to 'include/gpu/GrTexture.h')
-rw-r--r-- | include/gpu/GrTexture.h | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/include/gpu/GrTexture.h b/include/gpu/GrTexture.h index 79b39ec9f8..783a147405 100644 --- a/include/gpu/GrTexture.h +++ b/include/gpu/GrTexture.h @@ -33,6 +33,29 @@ public: // from GrResource /** + * Informational texture flags + */ + enum FlagBits { + kFirstBit = (kLastPublic_GrTextureFlagBit << 1), + + /** + * This texture should be returned to the texture cache when + * it is no longer reffed + */ + kReturnToCache_FlagBit = kFirstBit, + }; + + void setFlag(GrTextureFlags flags) { + fDesc.fFlags = fDesc.fFlags | flags; + } + void resetFlag(GrTextureFlags flags) { + fDesc.fFlags = fDesc.fFlags & ~flags; + } + bool isSetFlag(GrTextureFlags flags) const { + return 0 != (fDesc.fFlags & flags); + } + + /** * Approximate number of bytes used by the texture */ virtual size_t sizeInBytes() const SK_OVERRIDE { @@ -162,11 +185,8 @@ protected: } // GrResource overrides - virtual void onRelease() { - this->releaseRenderTarget(); - } - - virtual void onAbandon(); + virtual void onRelease() SK_OVERRIDE; + virtual void onAbandon() SK_OVERRIDE; void validateDesc() const; @@ -176,6 +196,8 @@ private: int fShiftFixedX; int fShiftFixedY; + virtual void internal_dispose() const SK_OVERRIDE; + typedef GrSurface INHERITED; }; |