Index: src/gpu/GrTexture.cpp |
diff --git a/src/gpu/GrTexture.cpp b/src/gpu/GrTexture.cpp |
index 594444743614ad17331b1f9d9a754b8dbba511e0..fdde9a322c268d9acfb0069748cf0d1bba26c319 100644 |
--- a/src/gpu/GrTexture.cpp |
+++ b/src/gpu/GrTexture.cpp |
@@ -58,12 +58,12 @@ void GrTextureImpl::dirtyMipMaps(bool mipMapsDirty) { |
} |
size_t GrTexture::gpuMemorySize() const { |
- size_t textureSize = (size_t) fDesc.fWidth * |
- fDesc.fHeight * |
- GrBytesPerPixel(fDesc.fConfig); |
+ size_t textureSize; |
if (GrPixelConfigIsCompressed(fDesc.fConfig)) { |
textureSize = GrCompressedFormatDataSize(fDesc.fConfig, fDesc.fWidth, fDesc.fHeight); |
+ } else { |
+ textureSize = (size_t) fDesc.fWidth * fDesc.fHeight * GrBytesPerPixel(fDesc.fConfig); |
} |
if (this->impl()->hasMipMaps()) { |