Bug 1414977 - Skip DrawElements if !indexCount, not !lastVert. - r=daoshengmu draft
authorJeff Gilbert <jgilbert@mozilla.com>
Mon, 06 Nov 2017 15:29:16 -0800
changeset 693907 6054321b59de2f22db5720eafe255f7df6f2a7fd
parent 693906 a45c827cab51ac9043952e499b3b8b444336252a
child 739189 88e361f810db8ad81c9176393aa6f759af7c2a95
push id87970
push userbmo:jgilbert@mozilla.com
push dateTue, 07 Nov 2017 02:35:38 +0000
reviewersdaoshengmu
bugs1414977
milestone58.0a1
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);