| 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 4272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4283 if (isContextLost() || !validateHTMLCanvasElement("texImage2D", canvas, exce
ptionState) || !validateTexFunc("texImage2D", NotTexSubImage2D, SourceHTMLCanvas
Element, target, level, internalformat, canvas->width(), canvas->height(), 0, fo
rmat, type, 0, 0)) | 4283 if (isContextLost() || !validateHTMLCanvasElement("texImage2D", canvas, exce
ptionState) || !validateTexFunc("texImage2D", NotTexSubImage2D, SourceHTMLCanvas
Element, target, level, internalformat, canvas->width(), canvas->height(), 0, fo
rmat, type, 0, 0)) |
| 4284 return; | 4284 return; |
| 4285 | 4285 |
| 4286 WebGLTexture* texture = validateTextureBinding("texImage2D", target, true); | 4286 WebGLTexture* texture = validateTextureBinding("texImage2D", target, true); |
| 4287 ASSERT(texture); | 4287 ASSERT(texture); |
| 4288 | 4288 |
| 4289 // texImage2DCanvasByGPU relies on copyTextureCHROMIUM which doesn't support
float type. | 4289 // texImage2DCanvasByGPU relies on copyTextureCHROMIUM which doesn't support
float type. |
| 4290 bool isFloatType = type == GL_FLOAT || type == GL_HALF_FLOAT_OES; | 4290 bool isFloatType = type == GL_FLOAT || type == GL_HALF_FLOAT_OES; |
| 4291 if (!canvas->renderingContext() || !canvas->renderingContext()->isAccelerate
d() || isFloatType) { | 4291 if (!canvas->renderingContext() || !canvas->renderingContext()->isAccelerate
d() || isFloatType) { |
| 4292 // 2D canvas has only FrontBuffer. | 4292 // 2D canvas has only FrontBuffer. |
| 4293 texImage2DImpl(target, level, internalformat, format, type, canvas->copi
edImage(FrontBuffer).get(), | 4293 texImage2DImpl(target, level, internalformat, format, type, canvas->copi
edImage(FrontBuffer, PreferAcceleration).get(), |
| 4294 WebGLImageConversion::HtmlDomCanvas, m_unpackFlipY, m_unpackPremulti
plyAlpha); | 4294 WebGLImageConversion::HtmlDomCanvas, m_unpackFlipY, m_unpackPremulti
plyAlpha); |
| 4295 return; | 4295 return; |
| 4296 } | 4296 } |
| 4297 | 4297 |
| 4298 texImage2DCanvasByGPU(NotTexSubImage2D, texture, target, level, internalform
at, type, 0, 0, canvas); | 4298 texImage2DCanvasByGPU(NotTexSubImage2D, texture, target, level, internalform
at, type, 0, 0, canvas); |
| 4299 texture->setLevelInfo(target, level, internalformat, canvas->width(), canvas
->height(), 1, type); | 4299 texture->setLevelInfo(target, level, internalformat, canvas->width(), canvas
->height(), 1, type); |
| 4300 } | 4300 } |
| 4301 | 4301 |
| 4302 PassRefPtr<Image> WebGLRenderingContextBase::videoFrameToImage(HTMLVideoElement*
video) | 4302 PassRefPtr<Image> WebGLRenderingContextBase::videoFrameToImage(HTMLVideoElement*
video) |
| 4303 { | 4303 { |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4531 if (isContextLost() || !validateHTMLCanvasElement("texSubImage2D", canvas, e
xceptionState) | 4531 if (isContextLost() || !validateHTMLCanvasElement("texSubImage2D", canvas, e
xceptionState) |
| 4532 || !validateTexFunc("texSubImage2D", TexSubImage2D, SourceHTMLCanvasElem
ent, target, level, 0, canvas->width(), canvas->height(), 0, format, type, xoffs
et, yoffset)) | 4532 || !validateTexFunc("texSubImage2D", TexSubImage2D, SourceHTMLCanvasElem
ent, target, level, 0, canvas->width(), canvas->height(), 0, format, type, xoffs
et, yoffset)) |
| 4533 return; | 4533 return; |
| 4534 | 4534 |
| 4535 WebGLTexture* texture = validateTextureBinding("texSubImage2D", target, true
); | 4535 WebGLTexture* texture = validateTextureBinding("texSubImage2D", target, true
); |
| 4536 ASSERT(texture); | 4536 ASSERT(texture); |
| 4537 | 4537 |
| 4538 bool isFloatType = type == GL_FLOAT || type == GL_HALF_FLOAT_OES; | 4538 bool isFloatType = type == GL_FLOAT || type == GL_HALF_FLOAT_OES; |
| 4539 if (!canvas->renderingContext() || !canvas->renderingContext()->isAccelerate
d() || isFloatType) { | 4539 if (!canvas->renderingContext() || !canvas->renderingContext()->isAccelerate
d() || isFloatType) { |
| 4540 // 2D canvas has only FrontBuffer. | 4540 // 2D canvas has only FrontBuffer. |
| 4541 texSubImage2DImpl(target, level, xoffset, yoffset, format, type, canvas-
>copiedImage(FrontBuffer).get(), | 4541 texSubImage2DImpl(target, level, xoffset, yoffset, format, type, canvas-
>copiedImage(FrontBuffer, PreferAcceleration).get(), |
| 4542 WebGLImageConversion::HtmlDomCanvas, m_unpackFlipY, m_unpackPremulti
plyAlpha); | 4542 WebGLImageConversion::HtmlDomCanvas, m_unpackFlipY, m_unpackPremulti
plyAlpha); |
| 4543 return; | 4543 return; |
| 4544 } | 4544 } |
| 4545 | 4545 |
| 4546 texImage2DCanvasByGPU(TexSubImage2D, texture, target, level, GL_RGBA, type,
xoffset, yoffset, canvas); | 4546 texImage2DCanvasByGPU(TexSubImage2D, texture, target, level, GL_RGBA, type,
xoffset, yoffset, canvas); |
| 4547 } | 4547 } |
| 4548 | 4548 |
| 4549 void WebGLRenderingContextBase::texSubImage2D(GLenum target, GLint level, GLint
xoffset, GLint yoffset, | 4549 void WebGLRenderingContextBase::texSubImage2D(GLenum target, GLint level, GLint
xoffset, GLint yoffset, |
| 4550 GLenum format, GLenum type, HTMLVideoElement* video, ExceptionState& excepti
onState) | 4550 GLenum format, GLenum type, HTMLVideoElement* video, ExceptionState& excepti
onState) |
| 4551 { | 4551 { |
| (...skipping 2164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6716 | 6716 |
| 6717 return totalBytesPerPixel; | 6717 return totalBytesPerPixel; |
| 6718 } | 6718 } |
| 6719 | 6719 |
| 6720 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const | 6720 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const |
| 6721 { | 6721 { |
| 6722 return m_drawingBuffer.get(); | 6722 return m_drawingBuffer.get(); |
| 6723 } | 6723 } |
| 6724 | 6724 |
| 6725 } // namespace blink | 6725 } // namespace blink |
| OLD | NEW |