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 4002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4013 void WebGLRenderingContextBase::texImage2D(GLenum target, GLint level, GLint int
ernalformat, | 4013 void WebGLRenderingContextBase::texImage2D(GLenum target, GLint level, GLint int
ernalformat, |
4014 GLenum format, GLenum type, HTMLImageElement* image, ExceptionState& excepti
onState) | 4014 GLenum format, GLenum type, HTMLImageElement* image, ExceptionState& excepti
onState) |
4015 { | 4015 { |
4016 if (isContextLost()) | 4016 if (isContextLost()) |
4017 return; | 4017 return; |
4018 if (!validateHTMLImageElement("texImage2D", image, exceptionState)) | 4018 if (!validateHTMLImageElement("texImage2D", image, exceptionState)) |
4019 return; | 4019 return; |
4020 if (!validateTexture2DBinding("texImage2D", target)) | 4020 if (!validateTexture2DBinding("texImage2D", target)) |
4021 return; | 4021 return; |
4022 | 4022 |
4023 RefPtr<Image> imageForRender = image->cachedImage()->image(); | 4023 RefPtr<Image> imageForRender = image->cachedImage()->getImage(); |
4024 if (imageForRender && imageForRender->isSVGImage()) | 4024 if (imageForRender && imageForRender->isSVGImage()) |
4025 imageForRender = drawImageIntoBuffer(imageForRender.release(), image->wi
dth(), image->height(), "texImage2D"); | 4025 imageForRender = drawImageIntoBuffer(imageForRender.release(), image->wi
dth(), image->height(), "texImage2D"); |
4026 | 4026 |
4027 if (!imageForRender || !validateTexFunc("texImage2D", TexImage, SourceHTMLIm
ageElement, target, level, internalformat, imageForRender->width(), imageForRend
er->height(), 1, 0, format, type, 0, 0, 0)) | 4027 if (!imageForRender || !validateTexFunc("texImage2D", TexImage, SourceHTMLIm
ageElement, target, level, internalformat, imageForRender->width(), imageForRend
er->height(), 1, 0, format, type, 0, 0, 0)) |
4028 return; | 4028 return; |
4029 | 4029 |
4030 if (type == GL_UNSIGNED_INT_10F_11F_11F_REV) { | 4030 if (type == GL_UNSIGNED_INT_10F_11F_11F_REV) { |
4031 // The UNSIGNED_INT_10F_11F_11F_REV type pack/unpack isn't implemented. | 4031 // The UNSIGNED_INT_10F_11F_11F_REV type pack/unpack isn't implemented. |
4032 type = GL_FLOAT; | 4032 type = GL_FLOAT; |
4033 } | 4033 } |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4387 void WebGLRenderingContextBase::texSubImage2D(GLenum target, GLint level, GLint
xoffset, GLint yoffset, | 4387 void WebGLRenderingContextBase::texSubImage2D(GLenum target, GLint level, GLint
xoffset, GLint yoffset, |
4388 GLenum format, GLenum type, HTMLImageElement* image, ExceptionState& excepti
onState) | 4388 GLenum format, GLenum type, HTMLImageElement* image, ExceptionState& excepti
onState) |
4389 { | 4389 { |
4390 if (isContextLost()) | 4390 if (isContextLost()) |
4391 return; | 4391 return; |
4392 if (!validateHTMLImageElement("texSubImage2D", image, exceptionState)) | 4392 if (!validateHTMLImageElement("texSubImage2D", image, exceptionState)) |
4393 return; | 4393 return; |
4394 if (!validateTexture2DBinding("texSubImage2D", target)) | 4394 if (!validateTexture2DBinding("texSubImage2D", target)) |
4395 return; | 4395 return; |
4396 | 4396 |
4397 RefPtr<Image> imageForRender = image->cachedImage()->image(); | 4397 RefPtr<Image> imageForRender = image->cachedImage()->getImage(); |
4398 if (imageForRender && imageForRender->isSVGImage()) | 4398 if (imageForRender && imageForRender->isSVGImage()) |
4399 imageForRender = drawImageIntoBuffer(imageForRender.release(), image->wi
dth(), image->height(), "texSubImage2D"); | 4399 imageForRender = drawImageIntoBuffer(imageForRender.release(), image->wi
dth(), image->height(), "texSubImage2D"); |
4400 | 4400 |
4401 if (!imageForRender || !validateTexFunc("texSubImage2D", TexSubImage, Source
HTMLImageElement, target, level, 0, imageForRender->width(), imageForRender->hei
ght(), 1, 0, format, type, xoffset, yoffset, 0)) | 4401 if (!imageForRender || !validateTexFunc("texSubImage2D", TexSubImage, Source
HTMLImageElement, target, level, 0, imageForRender->width(), imageForRender->hei
ght(), 1, 0, format, type, xoffset, yoffset, 0)) |
4402 return; | 4402 return; |
4403 | 4403 |
4404 if (type == GL_UNSIGNED_INT_10F_11F_11F_REV) { | 4404 if (type == GL_UNSIGNED_INT_10F_11F_11F_REV) { |
4405 // The UNSIGNED_INT_10F_11F_11F_REV type pack/unpack isn't implemented. | 4405 // The UNSIGNED_INT_10F_11F_11F_REV type pack/unpack isn't implemented. |
4406 type = GL_FLOAT; | 4406 type = GL_FLOAT; |
4407 } | 4407 } |
(...skipping 1877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6285 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, 1); | 6285 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, 1); |
6286 } | 6286 } |
6287 | 6287 |
6288 void WebGLRenderingContextBase::restoreUnpackParameters() | 6288 void WebGLRenderingContextBase::restoreUnpackParameters() |
6289 { | 6289 { |
6290 if (m_unpackAlignment != 1) | 6290 if (m_unpackAlignment != 1) |
6291 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); | 6291 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); |
6292 } | 6292 } |
6293 | 6293 |
6294 } // namespace blink | 6294 } // namespace blink |
OLD | NEW |