diff --git a/include/gpu/GrTextureAccess.h b/include/gpu/GrTextureAccess.h
index e5ea535..20dc57d 100644
--- a/include/gpu/GrTextureAccess.h
+++ b/include/gpu/GrTextureAccess.h
@@ -25,13 +25,19 @@
     GrTextureParams() {
         this->reset();
     }
+    
+    enum FilterMode {
+        kNone_FilterMode,
+        kBilerp_FilterMode,
+        kMipMap_FilterMode
+    };
 
-    GrTextureParams(SkShader::TileMode tileXAndY, bool bilerp) {
-        this->reset(tileXAndY, bilerp);
+    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 @@
     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 @@
                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 @@
 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 @@
      */
     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 @@
     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 {
