Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(382)

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp

Issue 2610393003: Fix the bug for VertexAttrib{I}Pointer when no array buffer bound (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/webgl/WebGL2RenderingContextBase.h" 5 #include "modules/webgl/WebGL2RenderingContextBase.h"
6 6
7 #include "bindings/modules/v8/WebGLAny.h" 7 #include "bindings/modules/v8/WebGLAny.h"
8 #include "core/frame/ImageBitmap.h" 8 #include "core/frame/ImageBitmap.h"
9 #include "core/html/HTMLCanvasElement.h" 9 #include "core/html/HTMLCanvasElement.h"
10 #include "core/html/HTMLImageElement.h" 10 #include "core/html/HTMLImageElement.h"
(...skipping 2421 matching lines...) Expand 10 before | Expand all | Expand 10 after
2432 long long offset) { 2432 long long offset) {
2433 if (isContextLost()) 2433 if (isContextLost())
2434 return; 2434 return;
2435 if (index >= m_maxVertexAttribs) { 2435 if (index >= m_maxVertexAttribs) {
2436 synthesizeGLError(GL_INVALID_VALUE, "vertexAttribIPointer", 2436 synthesizeGLError(GL_INVALID_VALUE, "vertexAttribIPointer",
2437 "index out of range"); 2437 "index out of range");
2438 return; 2438 return;
2439 } 2439 }
2440 if (!validateValueFitNonNegInt32("vertexAttribIPointer", "offset", offset)) 2440 if (!validateValueFitNonNegInt32("vertexAttribIPointer", "offset", offset))
2441 return; 2441 return;
2442 if (!m_boundArrayBuffer) { 2442 if (!m_boundArrayBuffer && offset != 0) {
2443 synthesizeGLError(GL_INVALID_OPERATION, "vertexAttribIPointer", 2443 synthesizeGLError(GL_INVALID_OPERATION, "vertexAttribIPointer",
2444 "no bound ARRAY_BUFFER"); 2444 "no ARRAY_BUFFER is bound and offset is non-zero");
2445 return; 2445 return;
2446 } 2446 }
2447 2447
2448 m_boundVertexArrayObject->setArrayBufferForAttrib(index, m_boundArrayBuffer); 2448 m_boundVertexArrayObject->setArrayBufferForAttrib(index, m_boundArrayBuffer);
2449 contextGL()->VertexAttribIPointer( 2449 contextGL()->VertexAttribIPointer(
2450 index, size, type, stride, 2450 index, size, type, stride,
2451 reinterpret_cast<void*>(static_cast<intptr_t>(offset))); 2451 reinterpret_cast<void*>(static_cast<intptr_t>(offset)));
2452 } 2452 }
2453 2453
2454 /* Writing to the drawing buffer */ 2454 /* Writing to the drawing buffer */
(...skipping 2403 matching lines...) Expand 10 before | Expand all | Expand 10 after
4858 4858
4859 void WebGL2RenderingContextBase:: 4859 void WebGL2RenderingContextBase::
4860 DrawingBufferClientRestorePixelUnpackBufferBinding() { 4860 DrawingBufferClientRestorePixelUnpackBufferBinding() {
4861 if (!contextGL()) 4861 if (!contextGL())
4862 return; 4862 return;
4863 contextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER, 4863 contextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER,
4864 objectOrZero(m_boundPixelUnpackBuffer.get())); 4864 objectOrZero(m_boundPixelUnpackBuffer.get()));
4865 } 4865 }
4866 4866
4867 } // namespace blink 4867 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698