Bug 1228949 - Fix WebGLBuffer content type when the target is LOCAL_GL_COPY_READ_BUFFER or LOCAL_GL_COPY_WRITE_BUFFER. r=jgilbert
authorEthan Lin <ethlin@mozilla.com>
Mon, 30 Nov 2015 01:30:00 +0100
changeset 275099 241b3b45bf347c14a8ce5fcf05aab713b6e9de1f
parent 275098 d38f8cb67db321d8f1f53b3b51fef1ebd847149f
child 275100 19c2125592584778db90546a5b8538d983aea3e3
push id68763
push usercbook@mozilla.com
push dateWed, 02 Dec 2015 07:42:50 +0000
treeherdermozilla-inbound@241b3b45bf34 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert
bugs1228949
milestone45.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1228949 - Fix WebGLBuffer content type when the target is LOCAL_GL_COPY_READ_BUFFER or LOCAL_GL_COPY_WRITE_BUFFER. r=jgilbert
dom/canvas/WebGLBuffer.cpp
--- a/dom/canvas/WebGLBuffer.cpp
+++ b/dom/canvas/WebGLBuffer.cpp
@@ -41,17 +41,19 @@ WebGLBuffer::BindTo(GLenum target)
     case LOCAL_GL_PIXEL_UNPACK_BUFFER:
     case LOCAL_GL_UNIFORM_BUFFER:
     case LOCAL_GL_TRANSFORM_FEEDBACK_BUFFER:
         mContent = Kind::OtherData;
         break;
 
     case LOCAL_GL_COPY_READ_BUFFER:
     case LOCAL_GL_COPY_WRITE_BUFFER:
-        /* Do nothing. Doesn't set the type of the buffer contents. */
+        if (mContent == Kind::Undefined) {
+          mContent = Kind::OtherData;
+        }
         break;
 
     default:
         MOZ_CRASH();
     }
 }
 
 void