OLD | NEW |
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 "config.h" | 5 #include "config.h" |
6 #include "modules/webgl/WebGL2RenderingContextBase.h" | 6 #include "modules/webgl/WebGL2RenderingContextBase.h" |
7 | 7 |
8 #include "bindings/modules/v8/WebGLAny.h" | 8 #include "bindings/modules/v8/WebGLAny.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 2193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2204 return String(); | 2204 return String(); |
2205 | 2205 |
2206 GLint maxNameLength = -1; | 2206 GLint maxNameLength = -1; |
2207 webContext()->getProgramiv(objectOrZero(program), GL_ACTIVE_UNIFORM_BLOCK_MA
X_NAME_LENGTH, &maxNameLength); | 2207 webContext()->getProgramiv(objectOrZero(program), GL_ACTIVE_UNIFORM_BLOCK_MA
X_NAME_LENGTH, &maxNameLength); |
2208 if (maxNameLength <= 0) { | 2208 if (maxNameLength <= 0) { |
2209 // This state indicates that there are no active uniform blocks | 2209 // This state indicates that there are no active uniform blocks |
2210 synthesizeGLError(GL_INVALID_VALUE, "getActiveUniformBlockName", "invali
d uniform block index"); | 2210 synthesizeGLError(GL_INVALID_VALUE, "getActiveUniformBlockName", "invali
d uniform block index"); |
2211 return String(); | 2211 return String(); |
2212 } | 2212 } |
2213 OwnPtr<GLchar[]> name = adoptArrayPtr(new GLchar[maxNameLength]); | 2213 OwnPtr<GLchar[]> name = adoptArrayPtr(new GLchar[maxNameLength]); |
2214 GLsizei length; | 2214 |
| 2215 GLsizei length = 0; |
2215 webContext()->getActiveUniformBlockName(objectOrZero(program), uniformBlockI
ndex, maxNameLength, &length, name.get()); | 2216 webContext()->getActiveUniformBlockName(objectOrZero(program), uniformBlockI
ndex, maxNameLength, &length, name.get()); |
| 2217 |
2216 return String(name.get(), length); | 2218 return String(name.get(), length); |
2217 } | 2219 } |
2218 | 2220 |
2219 void WebGL2RenderingContextBase::uniformBlockBinding(WebGLProgram* program, GLui
nt uniformBlockIndex, GLuint uniformBlockBinding) | 2221 void WebGL2RenderingContextBase::uniformBlockBinding(WebGLProgram* program, GLui
nt uniformBlockIndex, GLuint uniformBlockBinding) |
2220 { | 2222 { |
2221 if (isContextLost() || !validateWebGLObject("uniformBlockBinding", program)) | 2223 if (isContextLost() || !validateWebGLObject("uniformBlockBinding", program)) |
2222 return; | 2224 return; |
2223 | 2225 |
2224 webContext()->uniformBlockBinding(objectOrZero(program), uniformBlockIndex,
uniformBlockBinding); | 2226 webContext()->uniformBlockBinding(objectOrZero(program), uniformBlockIndex,
uniformBlockBinding); |
2225 } | 2227 } |
(...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3125 GLenum WebGL2RenderingContextBase::boundFramebufferColorFormat() | 3127 GLenum WebGL2RenderingContextBase::boundFramebufferColorFormat() |
3126 { | 3128 { |
3127 if (m_readFramebufferBinding && m_readFramebufferBinding->object()) | 3129 if (m_readFramebufferBinding && m_readFramebufferBinding->object()) |
3128 return m_readFramebufferBinding->colorBufferFormat(); | 3130 return m_readFramebufferBinding->colorBufferFormat(); |
3129 if (m_requestedAttributes.alpha()) | 3131 if (m_requestedAttributes.alpha()) |
3130 return GL_RGBA; | 3132 return GL_RGBA; |
3131 return GL_RGB; | 3133 return GL_RGB; |
3132 } | 3134 } |
3133 | 3135 |
3134 } // namespace blink | 3136 } // namespace blink |
OLD | NEW |