Bug 1414977 - Skip DrawElements if !indexCount, not !lastVert. - r=daoshengmu
authorJeff Gilbert <jgilbert@mozilla.com>
Mon, 06 Nov 2017 15:29:16 -0800
changeset 390428 d2580222abc787c50573436a761be699778115d8
parent 390427 25856ffb9083d2b133178c3aad624b6fd3329559
child 390429 a84fff04d9384160bec16b22dbb7063c62149b2e
push id97044
push userjgilbert@mozilla.com
push dateTue, 07 Nov 2017 03:46:56 +0000
treeherdermozilla-inbound@d2580222abc7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdaoshengmu
bugs1414977
milestone58.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 1414977 - Skip DrawElements if !indexCount, not !lastVert. - r=daoshengmu MozReview-Commit-ID: KaGFV374G5
dom/canvas/WebGLContextDraw.cpp
--- a/dom/canvas/WebGLContextDraw.cpp
+++ b/dom/canvas/WebGLContextDraw.cpp
@@ -736,17 +736,17 @@ WebGLContext::DrawElements(GLenum mode, 
         ScopedDrawCallWrapper wrapper(*this);
         {
             UniquePtr<gl::GLContext::LocalErrorScope> errorScope;
 
             if (gl->IsANGLE()) {
                 errorScope.reset(new gl::GLContext::LocalErrorScope(*gl));
             }
 
-            if (lastVert) {
+            if (indexCount) {
                 AUTO_PROFILER_LABEL("glDrawElements", GRAPHICS);
                 gl->fDrawElements(mode, indexCount, type,
                                   reinterpret_cast<GLvoid*>(byteOffset));
             }
 
             if (errorScope) {
                 HandleDrawElementsErrors(this, funcName, *errorScope);
             }
@@ -788,17 +788,17 @@ WebGLContext::DrawElementsInstanced(GLen
         ScopedDrawCallWrapper wrapper(*this);
         {
             UniquePtr<gl::GLContext::LocalErrorScope> errorScope;
 
             if (gl->IsANGLE()) {
                 errorScope.reset(new gl::GLContext::LocalErrorScope(*gl));
             }
 
-            if (lastVert && instanceCount) {
+            if (indexCount && instanceCount) {
                 AUTO_PROFILER_LABEL("glDrawElementsInstanced", GRAPHICS);
                 gl->fDrawElementsInstanced(mode, indexCount, type,
                                            reinterpret_cast<GLvoid*>(byteOffset),
                                            instanceCount);
             }
 
             if (errorScope) {
                 HandleDrawElementsErrors(this, funcName, *errorScope);