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

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.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
« no previous file with comments | « third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 4332 matching lines...) Expand 10 before | Expand all | Expand 10 after
4343 void WebGLRenderingContextBase::texImage2D(GLenum target, GLint level, GLenum in ternalformat, 4343 void WebGLRenderingContextBase::texImage2D(GLenum target, GLint level, GLenum in ternalformat,
4344 GLenum format, GLenum type, HTMLImageElement* image, ExceptionState& excepti onState) 4344 GLenum format, GLenum type, HTMLImageElement* image, ExceptionState& excepti onState)
4345 { 4345 {
4346 if (isContextLost() || !validateHTMLImageElement("texImage2D", image, except ionState)) 4346 if (isContextLost() || !validateHTMLImageElement("texImage2D", image, except ionState))
4347 return; 4347 return;
4348 if (type == GL_UNSIGNED_INT_10F_11F_11F_REV) { 4348 if (type == GL_UNSIGNED_INT_10F_11F_11F_REV) {
4349 // The UNSIGNED_INT_10F_11F_11F_REV type pack/unpack isn't implemented. 4349 // The UNSIGNED_INT_10F_11F_11F_REV type pack/unpack isn't implemented.
4350 type = GL_FLOAT; 4350 type = GL_FLOAT;
4351 } 4351 }
4352 4352
4353 RefPtr<Image> imageForRender = image->cachedImage()->imageForLayoutObject(im age->layoutObject()); 4353 RefPtr<Image> imageForRender = image->cachedImage()->image();
4354 if (imageForRender && imageForRender->isSVGImage()) 4354 if (imageForRender && imageForRender->isSVGImage())
4355 imageForRender = drawImageIntoBuffer(imageForRender.release(), image->wi dth(), image->height(), "texImage2D"); 4355 imageForRender = drawImageIntoBuffer(imageForRender.release(), image->wi dth(), image->height(), "texImage2D");
4356 4356
4357 if (!imageForRender || !validateTexFunc("texImage2D", NotTexSubImage2D, Sour ceHTMLImageElement, target, level, internalformat, imageForRender->width(), imag eForRender->height(), 0, format, type, 0, 0)) 4357 if (!imageForRender || !validateTexFunc("texImage2D", NotTexSubImage2D, Sour ceHTMLImageElement, target, level, internalformat, imageForRender->width(), imag eForRender->height(), 0, format, type, 0, 0))
4358 return; 4358 return;
4359 4359
4360 texImage2DImpl(target, level, internalformat, format, type, imageForRender.g et(), WebGLImageConversion::HtmlDomImage, m_unpackFlipY, m_unpackPremultiplyAlph a); 4360 texImage2DImpl(target, level, internalformat, format, type, imageForRender.g et(), WebGLImageConversion::HtmlDomImage, m_unpackFlipY, m_unpackPremultiplyAlph a);
4361 } 4361 }
4362 4362
4363 bool WebGLRenderingContextBase::canUseTexImageCanvasByGPU(GLenum internalformat, GLenum type) 4363 bool WebGLRenderingContextBase::canUseTexImageCanvasByGPU(GLenum internalformat, GLenum type)
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
4669 GLenum format, GLenum type, HTMLImageElement* image, ExceptionState& excepti onState) 4669 GLenum format, GLenum type, HTMLImageElement* image, ExceptionState& excepti onState)
4670 { 4670 {
4671 if (isContextLost() || !validateHTMLImageElement("texSubImage2D", image, exc eptionState)) 4671 if (isContextLost() || !validateHTMLImageElement("texSubImage2D", image, exc eptionState))
4672 return; 4672 return;
4673 4673
4674 if (type == GL_UNSIGNED_INT_10F_11F_11F_REV) { 4674 if (type == GL_UNSIGNED_INT_10F_11F_11F_REV) {
4675 // The UNSIGNED_INT_10F_11F_11F_REV type pack/unpack isn't implemented. 4675 // The UNSIGNED_INT_10F_11F_11F_REV type pack/unpack isn't implemented.
4676 type = GL_FLOAT; 4676 type = GL_FLOAT;
4677 } 4677 }
4678 4678
4679 RefPtr<Image> imageForRender = image->cachedImage()->imageForLayoutObject(im age->layoutObject()); 4679 RefPtr<Image> imageForRender = image->cachedImage()->image();
4680 if (imageForRender && imageForRender->isSVGImage()) 4680 if (imageForRender && imageForRender->isSVGImage())
4681 imageForRender = drawImageIntoBuffer(imageForRender.release(), image->wi dth(), image->height(), "texSubImage2D"); 4681 imageForRender = drawImageIntoBuffer(imageForRender.release(), image->wi dth(), image->height(), "texSubImage2D");
4682 4682
4683 if (!imageForRender || !validateTexFunc("texSubImage2D", TexSubImage2D, Sour ceHTMLImageElement, target, level, 0, imageForRender->width(), imageForRender->h eight(), 0, format, type, xoffset, yoffset)) 4683 if (!imageForRender || !validateTexFunc("texSubImage2D", TexSubImage2D, Sour ceHTMLImageElement, target, level, 0, imageForRender->width(), imageForRender->h eight(), 0, format, type, xoffset, yoffset))
4684 return; 4684 return;
4685 4685
4686 texSubImage2DImpl(target, level, xoffset, yoffset, format, type, imageForRen der.get(), WebGLImageConversion::HtmlDomImage, m_unpackFlipY, m_unpackPremultipl yAlpha); 4686 texSubImage2DImpl(target, level, xoffset, yoffset, format, type, imageForRen der.get(), WebGLImageConversion::HtmlDomImage, m_unpackFlipY, m_unpackPremultipl yAlpha);
4687 } 4687 }
4688 4688
4689 void WebGLRenderingContextBase::texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, 4689 void WebGLRenderingContextBase::texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
(...skipping 2238 matching lines...) Expand 10 before | Expand all | Expand 10 after
6928 6928
6929 return totalBytesPerPixel; 6929 return totalBytesPerPixel;
6930 } 6930 }
6931 6931
6932 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const 6932 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const
6933 { 6933 {
6934 return m_drawingBuffer.get(); 6934 return m_drawingBuffer.get();
6935 } 6935 }
6936 6936
6937 } // namespace blink 6937 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698