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 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
822 webContext()->texSubImage3D(target, level, xoffset, yoffset, zoffset, pixels
->width(), pixels->height(), 1, format, type, needConversion ? data.data() : pix
els->data()->data()); | 822 webContext()->texSubImage3D(target, level, xoffset, yoffset, zoffset, pixels
->width(), pixels->height(), 1, format, type, needConversion ? data.data() : pix
els->data()->data()); |
823 if (m_unpackAlignment != 1) | 823 if (m_unpackAlignment != 1) |
824 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); | 824 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); |
825 } | 825 } |
826 | 826 |
827 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, GLint level, GLint
xoffset, GLint yoffset, GLint zoffset, GLenum format, GLenum type, HTMLImageEle
ment* image, ExceptionState& exceptionState) | 827 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, GLint level, GLint
xoffset, GLint yoffset, GLint zoffset, GLenum format, GLenum type, HTMLImageEle
ment* image, ExceptionState& exceptionState) |
828 { | 828 { |
829 if (isContextLost() || !image || !validateHTMLImageElement("texSubImage3D",
image, exceptionState)) | 829 if (isContextLost() || !image || !validateHTMLImageElement("texSubImage3D",
image, exceptionState)) |
830 return; | 830 return; |
831 | 831 |
832 RefPtr<Image> imageForRender = image->cachedImage()->imageForLayoutObject(im
age->layoutObject()); | 832 RefPtr<Image> imageForRender = image->cachedImage()->image(); |
833 if (imageForRender->isSVGImage()) | 833 if (imageForRender->isSVGImage()) |
834 imageForRender = drawImageIntoBuffer(imageForRender.get(), image->width(
), image->height(), "texSubImage3D"); | 834 imageForRender = drawImageIntoBuffer(imageForRender.get(), image->width(
), image->height(), "texSubImage3D"); |
835 | 835 |
836 texSubImage3DImpl(target, level, xoffset, yoffset, zoffset, format, type, im
ageForRender.get(), WebGLImageConversion::HtmlDomImage, m_unpackFlipY, m_unpackP
remultiplyAlpha); | 836 texSubImage3DImpl(target, level, xoffset, yoffset, zoffset, format, type, im
ageForRender.get(), WebGLImageConversion::HtmlDomImage, m_unpackFlipY, m_unpackP
remultiplyAlpha); |
837 } | 837 } |
838 | 838 |
839 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, GLint level, GLint
xoffset, GLint yoffset, GLint zoffset, GLenum format, GLenum type, HTMLCanvasEl
ement* canvas, ExceptionState& exceptionState) | 839 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, GLint level, GLint
xoffset, GLint yoffset, GLint zoffset, GLenum format, GLenum type, HTMLCanvasEl
ement* canvas, ExceptionState& exceptionState) |
840 { | 840 { |
841 if (isContextLost() || !validateHTMLCanvasElement("texSubImage3D", canvas, e
xceptionState)) | 841 if (isContextLost() || !validateHTMLCanvasElement("texSubImage3D", canvas, e
xceptionState)) |
842 return; | 842 return; |
(...skipping 2243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3086 GLenum WebGL2RenderingContextBase::boundFramebufferColorFormat() | 3086 GLenum WebGL2RenderingContextBase::boundFramebufferColorFormat() |
3087 { | 3087 { |
3088 if (m_readFramebufferBinding && m_readFramebufferBinding->object()) | 3088 if (m_readFramebufferBinding && m_readFramebufferBinding->object()) |
3089 return m_readFramebufferBinding->colorBufferFormat(); | 3089 return m_readFramebufferBinding->colorBufferFormat(); |
3090 if (m_requestedAttributes.alpha()) | 3090 if (m_requestedAttributes.alpha()) |
3091 return GL_RGBA; | 3091 return GL_RGBA; |
3092 return GL_RGB; | 3092 return GL_RGB; |
3093 } | 3093 } |
3094 | 3094 |
3095 } // namespace blink | 3095 } // namespace blink |
OLD | NEW |