Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(280)

Unified Diff: src/gpu/GrTexture.cpp

Issue 457333004: Consider index8 a compressed config. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comment Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/gpu/GrTypes.h ('k') | src/gpu/SkGr.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()) {
« no previous file with comments | « include/gpu/GrTypes.h ('k') | src/gpu/SkGr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698