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 { |