Bug 1313584 - Add complete parameters handling for SamplerParameterX to cover test need. r=mtseng. a=gchang
authorvincentliu <vliu@mozilla.com>
Mon, 14 Nov 2016 11:38:46 +0800
changeset 439957 4e97dee28c6941a78f5ec342fbe95ce5e6a012b1
parent 439956 e9b3898d3366f830ce6acee568a7f68f6fc3eb8c
child 439958 1f41acac2aa680a42c0dc85062a0c0ff70c9b80f
push id36143
push userjkingston@mozilla.com
push dateWed, 16 Nov 2016 22:20:38 +0000
reviewersmtseng, gchang
bugs1313584
milestone51.0a2
Bug 1313584 - Add complete parameters handling for SamplerParameterX to cover test need. r=mtseng. a=gchang
dom/canvas/WebGLSampler.cpp
--- a/dom/canvas/WebGLSampler.cpp
+++ b/dom/canvas/WebGLSampler.cpp
@@ -80,16 +80,24 @@ WebGLSampler::SamplerParameter1i(GLenum 
     case LOCAL_GL_TEXTURE_COMPARE_MODE:
         mCompareMode = param;
         break;
 
     case LOCAL_GL_TEXTURE_COMPARE_FUNC:
         mCompareFunc = param;
         break;
 
+    case LOCAL_GL_TEXTURE_MIN_LOD:
+        mMinLod = param;
+        break;
+
+    case LOCAL_GL_TEXTURE_MAX_LOD:
+        mMaxLod = param;
+        break;
+
     default:
         MOZ_CRASH("GFX: Unhandled pname");
         break;
     }
 
     for (uint32_t i = 0; i < mContext->mBoundSamplers.Length(); ++i) {
         if (this == mContext->mBoundSamplers[i])
             mContext->InvalidateResolveCacheForTextureWithTexUnit(i);
@@ -103,16 +111,44 @@ WebGLSampler::SamplerParameter1f(GLenum 
     case LOCAL_GL_TEXTURE_MIN_LOD:
         mMinLod = param;
         break;
 
     case LOCAL_GL_TEXTURE_MAX_LOD:
         mMaxLod = param;
         break;
 
+    case LOCAL_GL_TEXTURE_WRAP_S:
+        mWrapS = param;
+        break;
+
+    case LOCAL_GL_TEXTURE_WRAP_T:
+        mWrapT = param;
+        break;
+
+    case LOCAL_GL_TEXTURE_WRAP_R:
+        mWrapR = param;
+        break;
+
+    case LOCAL_GL_TEXTURE_MAG_FILTER:
+        mMagFilter = param;
+        break;
+
+    case LOCAL_GL_TEXTURE_MIN_FILTER:
+        mMinFilter = param;
+        break;
+
+    case LOCAL_GL_TEXTURE_COMPARE_MODE:
+        mCompareMode = param;
+        break;
+
+    case LOCAL_GL_TEXTURE_COMPARE_FUNC:
+        mCompareFunc = param;
+        break;
+
     default:
         MOZ_CRASH("GFX: Unhandled pname");
         break;
     }
 
     for (uint32_t i = 0; i < mContext->mBoundSamplers.Length(); ++i) {
         if (this == mContext->mBoundSamplers[i])
             mContext->InvalidateResolveCacheForTextureWithTexUnit(i);