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

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

Issue 1427943002: Wrap SVGImage for container during paint (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use IntSize for SVGImageForContainer Created 5 years, 1 month 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 "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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698