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

Unified Diff: src/gpu/GrTexture.cpp

Issue 1286203002: Defer flushes if kPreferNoIO is specified (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: use explicit size in test Created 5 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 | « src/gpu/GrSurface.cpp ('k') | src/gpu/GrTextureProvider.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 b76075747889f2fea50194c6be486c221a5d2c0a..7984460545db61d3b5dfb8c6120f24719e909365 100644
--- a/src/gpu/GrTexture.cpp
+++ b/src/gpu/GrTexture.cpp
@@ -42,8 +42,12 @@ size_t GrTexture::onGpuMemorySize() const {
if (this->texturePriv().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;
+ textureSize += textureSize/3;
}
+
+ SkASSERT(!SkToBool(fDesc.fFlags & kRenderTarget_GrSurfaceFlag));
+ SkASSERT(textureSize <= WorseCaseSize(fDesc));
+
return textureSize;
}
« no previous file with comments | « src/gpu/GrSurface.cpp ('k') | src/gpu/GrTextureProvider.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698