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

Unified Diff: include/gpu/GrTextureAccess.h

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 | « include/gpu/GrTexture.h ('k') | src/core/SkBitmapProcShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrTextureAccess.h
diff --git a/include/gpu/GrTextureAccess.h b/include/gpu/GrTextureAccess.h
index e5ea535d99ae7360bb2f48c3735707f45ec8cc1a..20dc57de0740f4a9b23eddddc4e04887459fbf75 100644
--- a/include/gpu/GrTextureAccess.h
+++ b/include/gpu/GrTextureAccess.h
@@ -25,13 +25,19 @@ public:
GrTextureParams() {
this->reset();
}
-
- GrTextureParams(SkShader::TileMode tileXAndY, bool bilerp) {
- this->reset(tileXAndY, bilerp);
+
+ enum FilterMode {
+ kNone_FilterMode,
+ kBilerp_FilterMode,
+ kMipMap_FilterMode
+ };
+
+ GrTextureParams(SkShader::TileMode tileXAndY, FilterMode filterMode) {
+ this->reset(tileXAndY, filterMode);
}
- GrTextureParams(SkShader::TileMode tileModes[2], bool bilerp) {
- this->reset(tileModes, bilerp);
+ GrTextureParams(SkShader::TileMode tileModes[2], FilterMode filterMode) {
+ this->reset(tileModes, filterMode);
}
GrTextureParams(const GrTextureParams& params) {
@@ -41,35 +47,35 @@ public:
GrTextureParams& operator= (const GrTextureParams& params) {
fTileModes[0] = params.fTileModes[0];
fTileModes[1] = params.fTileModes[1];
- fBilerp = params.fBilerp;
+ fFilterMode = params.fFilterMode;
return *this;
}
void reset() {
- this->reset(SkShader::kClamp_TileMode, false);
+ this->reset(SkShader::kClamp_TileMode, kNone_FilterMode);
}
- void reset(SkShader::TileMode tileXAndY, bool bilerp) {
+ void reset(SkShader::TileMode tileXAndY, FilterMode filterMode) {
fTileModes[0] = fTileModes[1] = tileXAndY;
- fBilerp = bilerp;
+ fFilterMode = filterMode;
}
- void reset(SkShader::TileMode tileModes[2], bool bilerp) {
+ void reset(SkShader::TileMode tileModes[2], FilterMode filterMode) {
fTileModes[0] = tileModes[0];
fTileModes[1] = tileModes[1];
- fBilerp = bilerp;
+ fFilterMode = filterMode;
}
void setClampNoFilter() {
fTileModes[0] = fTileModes[1] = SkShader::kClamp_TileMode;
- fBilerp = false;
+ fFilterMode = kNone_FilterMode;
}
void setClamp() {
fTileModes[0] = fTileModes[1] = SkShader::kClamp_TileMode;
}
- void setBilerp(bool bilerp) { fBilerp = bilerp; }
+ void setFilterMode(FilterMode filterMode) { fFilterMode = filterMode; }
void setTileModeX(const SkShader::TileMode tm) { fTileModes[0] = tm; }
void setTileModeY(const SkShader::TileMode tm) { fTileModes[1] = tm; }
@@ -84,12 +90,12 @@ public:
SkShader::kClamp_TileMode != fTileModes[1];
}
- bool isBilerp() const { return fBilerp; }
+ FilterMode filterMode() const { return fFilterMode; }
bool operator== (const GrTextureParams& other) const {
return fTileModes[0] == other.fTileModes[0] &&
fTileModes[1] == other.fTileModes[1] &&
- fBilerp == other.fBilerp;
+ fFilterMode == other.fFilterMode;
}
bool operator!= (const GrTextureParams& other) const { return !(*this == other); }
@@ -97,7 +103,7 @@ public:
private:
SkShader::TileMode fTileModes[2];
- bool fBilerp;
+ FilterMode fFilterMode;
};
/** A class representing the swizzle access pattern for a texture. Note that if the texture is
@@ -119,7 +125,7 @@ public:
*/
GrTextureAccess(GrTexture*, const GrTextureParams&);
explicit GrTextureAccess(GrTexture*,
- bool bilerp = false,
+ GrTextureParams::FilterMode = GrTextureParams::kNone_FilterMode,
SkShader::TileMode tileXAndY = SkShader::kClamp_TileMode);
/**
@@ -129,17 +135,17 @@ public:
GrTextureAccess(GrTexture*, const char* swizzle, const GrTextureParams&);
GrTextureAccess(GrTexture*,
const char* swizzle,
- bool bilerp = false,
+ GrTextureParams::FilterMode = GrTextureParams::kNone_FilterMode,
SkShader::TileMode tileXAndY = SkShader::kClamp_TileMode);
void reset(GrTexture*, const GrTextureParams&);
void reset(GrTexture*,
- bool bilerp = false,
+ GrTextureParams::FilterMode = GrTextureParams::kNone_FilterMode,
SkShader::TileMode tileXAndY = SkShader::kClamp_TileMode);
void reset(GrTexture*, const char* swizzle, const GrTextureParams&);
void reset(GrTexture*,
const char* swizzle,
- bool bilerp = false,
+ GrTextureParams::FilterMode = GrTextureParams::kNone_FilterMode,
SkShader::TileMode tileXAndY = SkShader::kClamp_TileMode);
bool operator== (const GrTextureAccess& other) const {
« no previous file with comments | « include/gpu/GrTexture.h ('k') | src/core/SkBitmapProcShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698