Move filter/wrap out of GrSamplerState into GrTextureParams

Review URL: http://codereview.appspot.com/6440046/




git-svn-id: http://skia.googlecode.com/svn/trunk@4773 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrTexture.cpp b/src/gpu/GrTexture.cpp
index 8c12bd2..fbc3893 100644
--- a/src/gpu/GrTexture.cpp
+++ b/src/gpu/GrTexture.cpp
@@ -135,7 +135,7 @@
 
 namespace {
 void gen_texture_key_values(const GrGpu* gpu,
-                            const GrSamplerState* sampler,
+                            const GrTextureParams* params,
                             const GrTextureDesc& desc,
                             bool scratch,
                             uint32_t v[4]) {
@@ -163,13 +163,11 @@
     if (!gpu->getCaps().fNPOTTextureTileSupport) {
         bool isPow2 = GrIsPow2(desc.fWidth) && GrIsPow2(desc.fHeight);
 
-        bool tiled = NULL != sampler &&
-                   ((sampler->getWrapX() != GrSamplerState::kClamp_WrapMode) ||
-                    (sampler->getWrapY() != GrSamplerState::kClamp_WrapMode));
+        bool tiled = NULL != params && params->isTiled();
 
         if (tiled && !isPow2) {
             v[3] |= kNPOT_TextureBit;
-            if (GrSamplerState::kNearest_Filter != sampler->getFilter()) {
+            if (params->isBilerp()) {
                 v[3] |= kFilter_TextureBit;
             }
         }
@@ -184,11 +182,11 @@
 }
 
 GrResourceKey GrTexture::ComputeKey(const GrGpu* gpu,
-                                    const GrSamplerState* sampler,
+                                    const GrTextureParams* params,
                                     const GrTextureDesc& desc,
                                     bool scratch) {
     uint32_t v[4];
-    gen_texture_key_values(gpu, sampler, desc, scratch, v);
+    gen_texture_key_values(gpu, params, desc, scratch, v);
     return GrResourceKey(v);
 }