OLD | NEW |
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 4326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4337 void WebGLRenderingContextBase::texImage2D(GLenum target, GLint level, GLenum in
ternalformat, | 4337 void WebGLRenderingContextBase::texImage2D(GLenum target, GLint level, GLenum in
ternalformat, |
4338 GLenum format, GLenum type, HTMLImageElement* image, ExceptionState& excepti
onState) | 4338 GLenum format, GLenum type, HTMLImageElement* image, ExceptionState& excepti
onState) |
4339 { | 4339 { |
4340 if (isContextLost() || !validateHTMLImageElement("texImage2D", image, except
ionState)) | 4340 if (isContextLost() || !validateHTMLImageElement("texImage2D", image, except
ionState)) |
4341 return; | 4341 return; |
4342 if (type == GL_UNSIGNED_INT_10F_11F_11F_REV) { | 4342 if (type == GL_UNSIGNED_INT_10F_11F_11F_REV) { |
4343 // The UNSIGNED_INT_10F_11F_11F_REV type pack/unpack isn't implemented. | 4343 // The UNSIGNED_INT_10F_11F_11F_REV type pack/unpack isn't implemented. |
4344 type = GL_FLOAT; | 4344 type = GL_FLOAT; |
4345 } | 4345 } |
4346 | 4346 |
4347 RefPtr<Image> imageForRender = image->cachedImage()->imageForLayoutObject(im
age->layoutObject()); | 4347 RefPtr<Image> imageForRender = image->cachedImage()->image(); |
4348 if (imageForRender && imageForRender->isSVGImage()) | 4348 if (imageForRender && imageForRender->isSVGImage()) |
4349 imageForRender = drawImageIntoBuffer(imageForRender.release(), image->wi
dth(), image->height(), "texImage2D"); | 4349 imageForRender = drawImageIntoBuffer(imageForRender.release(), image->wi
dth(), image->height(), "texImage2D"); |
4350 | 4350 |
4351 if (!imageForRender || !validateTexFunc("texImage2D", NotTexSubImage2D, Sour
ceHTMLImageElement, target, level, internalformat, imageForRender->width(), imag
eForRender->height(), 0, format, type, 0, 0)) | 4351 if (!imageForRender || !validateTexFunc("texImage2D", NotTexSubImage2D, Sour
ceHTMLImageElement, target, level, internalformat, imageForRender->width(), imag
eForRender->height(), 0, format, type, 0, 0)) |
4352 return; | 4352 return; |
4353 | 4353 |
4354 texImage2DImpl(target, level, internalformat, format, type, imageForRender.g
et(), WebGLImageConversion::HtmlDomImage, m_unpackFlipY, m_unpackPremultiplyAlph
a); | 4354 texImage2DImpl(target, level, internalformat, format, type, imageForRender.g
et(), WebGLImageConversion::HtmlDomImage, m_unpackFlipY, m_unpackPremultiplyAlph
a); |
4355 } | 4355 } |
4356 | 4356 |
4357 bool WebGLRenderingContextBase::canUseTexImageCanvasByGPU(GLenum internalformat,
GLenum type) | 4357 bool WebGLRenderingContextBase::canUseTexImageCanvasByGPU(GLenum internalformat,
GLenum type) |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4663 GLenum format, GLenum type, HTMLImageElement* image, ExceptionState& excepti
onState) | 4663 GLenum format, GLenum type, HTMLImageElement* image, ExceptionState& excepti
onState) |
4664 { | 4664 { |
4665 if (isContextLost() || !validateHTMLImageElement("texSubImage2D", image, exc
eptionState)) | 4665 if (isContextLost() || !validateHTMLImageElement("texSubImage2D", image, exc
eptionState)) |
4666 return; | 4666 return; |
4667 | 4667 |
4668 if (type == GL_UNSIGNED_INT_10F_11F_11F_REV) { | 4668 if (type == GL_UNSIGNED_INT_10F_11F_11F_REV) { |
4669 // The UNSIGNED_INT_10F_11F_11F_REV type pack/unpack isn't implemented. | 4669 // The UNSIGNED_INT_10F_11F_11F_REV type pack/unpack isn't implemented. |
4670 type = GL_FLOAT; | 4670 type = GL_FLOAT; |
4671 } | 4671 } |
4672 | 4672 |
4673 RefPtr<Image> imageForRender = image->cachedImage()->imageForLayoutObject(im
age->layoutObject()); | 4673 RefPtr<Image> imageForRender = image->cachedImage()->image(); |
4674 if (imageForRender && imageForRender->isSVGImage()) | 4674 if (imageForRender && imageForRender->isSVGImage()) |
4675 imageForRender = drawImageIntoBuffer(imageForRender.release(), image->wi
dth(), image->height(), "texSubImage2D"); | 4675 imageForRender = drawImageIntoBuffer(imageForRender.release(), image->wi
dth(), image->height(), "texSubImage2D"); |
4676 | 4676 |
4677 if (!imageForRender || !validateTexFunc("texSubImage2D", TexSubImage2D, Sour
ceHTMLImageElement, target, level, 0, imageForRender->width(), imageForRender->h
eight(), 0, format, type, xoffset, yoffset)) | 4677 if (!imageForRender || !validateTexFunc("texSubImage2D", TexSubImage2D, Sour
ceHTMLImageElement, target, level, 0, imageForRender->width(), imageForRender->h
eight(), 0, format, type, xoffset, yoffset)) |
4678 return; | 4678 return; |
4679 | 4679 |
4680 texSubImage2DImpl(target, level, xoffset, yoffset, format, type, imageForRen
der.get(), WebGLImageConversion::HtmlDomImage, m_unpackFlipY, m_unpackPremultipl
yAlpha); | 4680 texSubImage2DImpl(target, level, xoffset, yoffset, format, type, imageForRen
der.get(), WebGLImageConversion::HtmlDomImage, m_unpackFlipY, m_unpackPremultipl
yAlpha); |
4681 } | 4681 } |
4682 | 4682 |
4683 void WebGLRenderingContextBase::texSubImage2D(GLenum target, GLint level, GLint
xoffset, GLint yoffset, | 4683 void WebGLRenderingContextBase::texSubImage2D(GLenum target, GLint level, GLint
xoffset, GLint yoffset, |
(...skipping 2229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6913 | 6913 |
6914 return totalBytesPerPixel; | 6914 return totalBytesPerPixel; |
6915 } | 6915 } |
6916 | 6916 |
6917 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const | 6917 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const |
6918 { | 6918 { |
6919 return m_drawingBuffer.get(); | 6919 return m_drawingBuffer.get(); |
6920 } | 6920 } |
6921 | 6921 |
6922 } // namespace blink | 6922 } // namespace blink |
OLD | NEW |