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 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 | 633 |
634 WebGLTexture* tex = validateTextureBinding("texImage3D", target, true); | 634 WebGLTexture* tex = validateTextureBinding("texImage3D", target, true); |
635 if (!tex) | 635 if (!tex) |
636 return; | 636 return; |
637 | 637 |
638 if (tex->isImmutable()) { | 638 if (tex->isImmutable()) { |
639 synthesizeGLError(GL_INVALID_OPERATION, "texImage3D", "attempted to modi
fy immutable texture"); | 639 synthesizeGLError(GL_INVALID_OPERATION, "texImage3D", "attempted to modi
fy immutable texture"); |
640 return; | 640 return; |
641 } | 641 } |
642 | 642 |
643 webContext()->texImage3D(target, level, convertTexInternalFormat(internalfor
mat, type), width, height, depth, border, format, type, pixels); | 643 webContext()->texImage3D(target, level, convertTexInternalFormat(internalfor
mat, type), width, height, depth, border, format, type, data); |
644 tex->setLevelInfo(target, level, internalformat, width, height, depth, type)
; | 644 tex->setLevelInfo(target, level, internalformat, width, height, depth, type)
; |
645 } | 645 } |
646 | 646 |
647 bool WebGL2RenderingContextBase::validateTexSubImage3D(const char* functionName,
GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, | 647 bool WebGL2RenderingContextBase::validateTexSubImage3D(const char* functionName,
GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, |
648 GLenum format, GLenum type, GLsizei width, GLsizei height, GLsizei depth) | 648 GLenum format, GLenum type, GLsizei width, GLsizei height, GLsizei depth) |
649 { | 649 { |
650 switch (target) { | 650 switch (target) { |
651 case GL_TEXTURE_3D: | 651 case GL_TEXTURE_3D: |
652 case GL_TEXTURE_2D_ARRAY: | 652 case GL_TEXTURE_2D_ARRAY: |
653 break; | 653 break; |
(...skipping 2300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2954 GLenum WebGL2RenderingContextBase::boundFramebufferColorFormat() | 2954 GLenum WebGL2RenderingContextBase::boundFramebufferColorFormat() |
2955 { | 2955 { |
2956 if (m_readFramebufferBinding && m_readFramebufferBinding->object()) | 2956 if (m_readFramebufferBinding && m_readFramebufferBinding->object()) |
2957 return m_readFramebufferBinding->colorBufferFormat(); | 2957 return m_readFramebufferBinding->colorBufferFormat(); |
2958 if (m_requestedAttributes.alpha()) | 2958 if (m_requestedAttributes.alpha()) |
2959 return GL_RGBA; | 2959 return GL_RGBA; |
2960 return GL_RGB; | 2960 return GL_RGB; |
2961 } | 2961 } |
2962 | 2962 |
2963 } // namespace blink | 2963 } // namespace blink |
OLD | NEW |