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

Unified Diff: src/gpu/GrTexture.cpp

Issue 20362002: make the filter mode for GrTextureAccess an enum so we can plumb down (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fall back to mipmaps for HQ sampling (for now) Created 7 years, 5 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/GrTextContext.cpp ('k') | src/gpu/GrTextureAccess.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 6452aae9b1eee2dff070ce858c5457926ecca4bb..c05f35d9e39d88f6e0fa300a73f31504461fa719 100644
--- a/src/gpu/GrTexture.cpp
+++ b/src/gpu/GrTexture.cpp
@@ -113,10 +113,10 @@ enum TextureFlags {
*/
kStretchToPOT_TextureFlag = 0x1,
/**
- * The kFilter bit can only be set when the kStretchToPOT flag is set and indicates whether the
- * stretched texture should be bilerp filtered or point sampled.
+ * The kBilerp bit can only be set when the kStretchToPOT flag is set and indicates whether the
+ * stretched texture should be bilerped.
*/
- kFilter_TextureFlag = 0x2,
+ kBilerp_TextureFlag = 0x2,
};
namespace {
@@ -128,8 +128,13 @@ GrResourceKey::ResourceFlags get_texture_flags(const GrGpu* gpu,
if (tiled && !gpu->caps()->npotTextureTileSupport()) {
if (!GrIsPow2(desc.fWidth) || !GrIsPow2(desc.fHeight)) {
flags |= kStretchToPOT_TextureFlag;
- if (params->isBilerp()) {
- flags |= kFilter_TextureFlag;
+ switch(params->filterMode()) {
+ case GrTextureParams::kNone_FilterMode:
+ break;
+ case GrTextureParams::kBilerp_FilterMode:
+ case GrTextureParams::kMipMap_FilterMode:
+ flags |= kBilerp_TextureFlag;
+ break;
}
}
}
@@ -186,6 +191,6 @@ bool GrTexture::NeedsResizing(const GrResourceKey& key) {
return SkToBool(key.getResourceFlags() & kStretchToPOT_TextureFlag);
}
-bool GrTexture::NeedsFiltering(const GrResourceKey& key) {
- return SkToBool(key.getResourceFlags() & kFilter_TextureFlag);
+bool GrTexture::NeedsBilerp(const GrResourceKey& key) {
+ return SkToBool(key.getResourceFlags() & kBilerp_TextureFlag);
}
« no previous file with comments | « src/gpu/GrTextContext.cpp ('k') | src/gpu/GrTextureAccess.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698