Bug 1136508 - Remove redundent READ_BUFFER != NONE validation. - r=mtseng draft
authorJeff Gilbert <jgilbert@mozilla.com>
Wed, 13 Jul 2016 00:50:45 -0700
changeset 387003 e6bc4ef8547646c04e8d158806664553ec1cc13f
parent 387002 2567f6a324f8c4dfa3880ec3c8e88710612e24b2
child 387004 2298735fe2e6d48df6b2cbbb3d348d215270412f
push id22882
push userbmo:jgilbert@mozilla.com
push dateWed, 13 Jul 2016 08:08:18 +0000
reviewersmtseng
bugs1136508
milestone50.0a1
Bug 1136508 - Remove redundent READ_BUFFER != NONE validation. - r=mtseng MozReview-Commit-ID: D1yZ4m6p8Wk
dom/canvas/WebGLTextureUpload.cpp
--- a/dom/canvas/WebGLTextureUpload.cpp
+++ b/dom/canvas/WebGLTextureUpload.cpp
@@ -1751,25 +1751,16 @@ WebGLTexture::CopyTexImage2D(TexImageTar
     if (!mContext->ValidateCurFBForRead(funcName, &srcUsage, &srcWidth, &srcHeight,
                                         &srcMode))
         return;
     auto srcFormat = srcUsage->format;
 
     if (!ValidateCopyTexImageForFeedback(funcName, level))
         return;
 
-    // GLES 3.0.4 p145:
-    // "Calling CopyTexSubImage3D, CopyTexImage2D, or CopyTexSubImage2D will result in an
-    //  INVALID_OPERATION error if any of the following conditions is true: READ_BUFFER
-    //  is NONE"
-    if (srcMode == LOCAL_GL_NONE) {
-        mContext->ErrorInvalidOperation("%s: READ_BUFFER is NONE. ", funcName);
-        return;
-    }
-
     ////////////////////////////////////
     // Check that source and dest info are compatible
 
     const auto& fua = mContext->mFormatUsage;
 
     auto dstUsage = fua->GetSizedTexUsage(internalFormat);
     if (!dstUsage) {
         // It must be an unsized format then...
@@ -1915,25 +1906,16 @@ WebGLTexture::CopyTexSubImage(const char
     if (!mContext->ValidateCurFBForRead(funcName, &srcUsage, &srcWidth, &srcHeight,
                                         &srcMode))
         return;
     auto srcFormat = srcUsage->format;
 
     if (!ValidateCopyTexImageForFeedback(funcName, level))
         return;
 
-    // GLES 3.0.4 p145:
-    // "Calling CopyTexSubImage3D, CopyTexImage2D, or CopyTexSubImage2D will result in an
-    //  INVALID_OPERATION error if any of the following conditions is true: READ_BUFFER
-    //  is NONE"
-    if (srcMode == LOCAL_GL_NONE) {
-        mContext->ErrorInvalidOperation("%s: READ_BUFFER is NONE. ", funcName);
-        return;
-    }
-
     ////////////////////////////////////
     // Check that source and dest info are compatible
 
     if (!ValidateCopyTexImageFormats(mContext, funcName, srcFormat, dstFormat))
         return;
 
     ////////////////////////////////////
     // Do the thing!