| Index: src/gpu/GrTexture.cpp
|
| diff --git a/src/gpu/GrTexture.cpp b/src/gpu/GrTexture.cpp
|
| index 3186d89d77535cf734c2cc70319a2d0a21e5e892..8651d1090ec96529f08d19008f7eb8ae008e8fa7 100644
|
| --- a/src/gpu/GrTexture.cpp
|
| +++ b/src/gpu/GrTexture.cpp
|
| @@ -26,13 +26,12 @@ GrTexture::~GrTexture() {
|
| * textures back in the texture cache when their ref count goes to zero.
|
| */
|
| void GrTexture::internal_dispose() const {
|
| -
|
| - if (this->isSetFlag((GrTextureFlags) kReturnToCache_FlagBit) &&
|
| + if (this->impl()->isSetFlag((GrTextureFlags) GrTextureImpl::kReturnToCache_FlagBit) &&
|
| NULL != this->INHERITED::getContext()) {
|
| GrTexture* nonConstThis = const_cast<GrTexture *>(this);
|
| this->fRefCnt = 1; // restore ref count to initial setting
|
|
|
| - nonConstThis->resetFlag((GrTextureFlags) kReturnToCache_FlagBit);
|
| + nonConstThis->impl()->resetFlag((GrTextureFlags) GrTextureImpl::kReturnToCache_FlagBit);
|
| nonConstThis->INHERITED::getContext()->addExistingTextureToCache(nonConstThis);
|
|
|
| // Note: "this" texture might be freed inside addExistingTextureToCache
|
| @@ -44,7 +43,7 @@ void GrTexture::internal_dispose() const {
|
| this->INHERITED::internal_dispose();
|
| }
|
|
|
| -void GrTexture::dirtyMipMaps(bool mipMapsDirty) {
|
| +void GrTextureImpl::dirtyMipMaps(bool mipMapsDirty) {
|
| if (mipMapsDirty) {
|
| if (kValid_MipMapsStatus == fMipMapsStatus) {
|
| fMipMapsStatus = kAllocated_MipMapsStatus;
|
| @@ -63,7 +62,7 @@ size_t GrTexture::gpuMemorySize() const {
|
| size_t textureSize = (size_t) fDesc.fWidth *
|
| fDesc.fHeight *
|
| GrBytesPerPixel(fDesc.fConfig);
|
| - if (kNotAllocated_MipMapsStatus != fMipMapsStatus) {
|
| + if (this->impl()->hasMipMaps()) {
|
| // We don't have to worry about the mipmaps being a different size than
|
| // we'd expect because we never change fDesc.fWidth/fHeight.
|
| textureSize *= 2;
|
| @@ -100,7 +99,7 @@ void GrTexture::writePixels(int left, int top, int width, int height,
|
| }
|
|
|
| void GrTexture::onRelease() {
|
| - SkASSERT(!this->isSetFlag((GrTextureFlags) kReturnToCache_FlagBit));
|
| + SkASSERT(!this->impl()->isSetFlag((GrTextureFlags) GrTextureImpl::kReturnToCache_FlagBit));
|
| INHERITED::onRelease();
|
| }
|
|
|
| @@ -130,6 +129,8 @@ void GrTexture::validateDesc() const {
|
| }
|
| }
|
|
|
| +//////////////////////////////////////////////////////////////////////////////
|
| +
|
| // These flags need to fit in a GrResourceKey::ResourceFlags so they can be folded into the texture
|
| // key
|
| enum TextureFlags {
|
| @@ -186,7 +187,9 @@ GrSurfaceOrigin resolve_origin(const GrTextureDesc& desc) {
|
| }
|
| }
|
|
|
| -GrResourceKey GrTexture::ComputeKey(const GrGpu* gpu,
|
| +//////////////////////////////////////////////////////////////////////////////
|
| +
|
| +GrResourceKey GrTextureImpl::ComputeKey(const GrGpu* gpu,
|
| const GrTextureParams* params,
|
| const GrTextureDesc& desc,
|
| const GrCacheID& cacheID) {
|
| @@ -194,7 +197,7 @@ GrResourceKey GrTexture::ComputeKey(const GrGpu* gpu,
|
| return GrResourceKey(cacheID, texture_resource_type(), flags);
|
| }
|
|
|
| -GrResourceKey GrTexture::ComputeScratchKey(const GrTextureDesc& desc) {
|
| +GrResourceKey GrTextureImpl::ComputeScratchKey(const GrTextureDesc& desc) {
|
| GrCacheID::Key idKey;
|
| // Instead of a client-provided key of the texture contents we create a key from the
|
| // descriptor.
|
| @@ -213,10 +216,10 @@ GrResourceKey GrTexture::ComputeScratchKey(const GrTextureDesc& desc) {
|
| return GrResourceKey(cacheID, texture_resource_type(), 0);
|
| }
|
|
|
| -bool GrTexture::NeedsResizing(const GrResourceKey& key) {
|
| +bool GrTextureImpl::NeedsResizing(const GrResourceKey& key) {
|
| return SkToBool(key.getResourceFlags() & kStretchToPOT_TextureFlag);
|
| }
|
|
|
| -bool GrTexture::NeedsBilerp(const GrResourceKey& key) {
|
| +bool GrTextureImpl::NeedsBilerp(const GrResourceKey& key) {
|
| return SkToBool(key.getResourceFlags() & kBilerp_TextureFlag);
|
| }
|
|
|