| 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 4279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4290 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)) | 4290 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)) |
| 4291 return; | 4291 return; |
| 4292 | 4292 |
| 4293 WebGLTexture* texture = validateTextureBinding("texImage2D", target, true); | 4293 WebGLTexture* texture = validateTextureBinding("texImage2D", target, true); |
| 4294 ASSERT(texture); | 4294 ASSERT(texture); |
| 4295 | 4295 |
| 4296 // texImage2DCanvasByGPU relies on copyTextureCHROMIUM which doesn't support
float type. | 4296 // texImage2DCanvasByGPU relies on copyTextureCHROMIUM which doesn't support
float type. |
| 4297 bool isFloatType = type == GL_FLOAT || type == GL_HALF_FLOAT || type == GL_H
ALF_FLOAT_OES; | 4297 bool isFloatType = type == GL_FLOAT || type == GL_HALF_FLOAT || type == GL_H
ALF_FLOAT_OES; |
| 4298 if (!canvas->renderingContext() || !canvas->renderingContext()->isAccelerate
d() || isFloatType) { | 4298 if (!canvas->renderingContext() || !canvas->renderingContext()->isAccelerate
d() || isFloatType) { |
| 4299 // 2D canvas has only FrontBuffer. | 4299 // 2D canvas has only FrontBuffer. |
| 4300 texImage2DImpl(target, level, internalformat, format, type, canvas->copi
edImage(FrontBuffer).get(), | 4300 texImage2DImpl(target, level, internalformat, format, type, canvas->copi
edImage(FrontBuffer, PreferAcceleration).get(), |
| 4301 WebGLImageConversion::HtmlDomCanvas, m_unpackFlipY, m_unpackPremulti
plyAlpha); | 4301 WebGLImageConversion::HtmlDomCanvas, m_unpackFlipY, m_unpackPremulti
plyAlpha); |
| 4302 return; | 4302 return; |
| 4303 } | 4303 } |
| 4304 | 4304 |
| 4305 texImage2DCanvasByGPU(NotTexSubImage2D, texture, target, level, internalform
at, type, 0, 0, canvas); | 4305 texImage2DCanvasByGPU(NotTexSubImage2D, texture, target, level, internalform
at, type, 0, 0, canvas); |
| 4306 texture->setLevelInfo(target, level, internalformat, canvas->width(), canvas
->height(), 1, type); | 4306 texture->setLevelInfo(target, level, internalformat, canvas->width(), canvas
->height(), 1, type); |
| 4307 } | 4307 } |
| 4308 | 4308 |
| 4309 PassRefPtr<Image> WebGLRenderingContextBase::videoFrameToImage(HTMLVideoElement*
video) | 4309 PassRefPtr<Image> WebGLRenderingContextBase::videoFrameToImage(HTMLVideoElement*
video) |
| 4310 { | 4310 { |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4550 if (isContextLost() || !validateHTMLCanvasElement("texSubImage2D", canvas, e
xceptionState) | 4550 if (isContextLost() || !validateHTMLCanvasElement("texSubImage2D", canvas, e
xceptionState) |
| 4551 || !validateTexFunc("texSubImage2D", TexSubImage2D, SourceHTMLCanvasElem
ent, target, level, 0, canvas->width(), canvas->height(), 0, format, type, xoffs
et, yoffset)) | 4551 || !validateTexFunc("texSubImage2D", TexSubImage2D, SourceHTMLCanvasElem
ent, target, level, 0, canvas->width(), canvas->height(), 0, format, type, xoffs
et, yoffset)) |
| 4552 return; | 4552 return; |
| 4553 | 4553 |
| 4554 WebGLTexture* texture = validateTextureBinding("texSubImage2D", target, true
); | 4554 WebGLTexture* texture = validateTextureBinding("texSubImage2D", target, true
); |
| 4555 ASSERT(texture); | 4555 ASSERT(texture); |
| 4556 | 4556 |
| 4557 bool isFloatType = type == GL_FLOAT || type == GL_HALF_FLOAT || type == GL_H
ALF_FLOAT_OES; | 4557 bool isFloatType = type == GL_FLOAT || type == GL_HALF_FLOAT || type == GL_H
ALF_FLOAT_OES; |
| 4558 if (!canvas->renderingContext() || !canvas->renderingContext()->isAccelerate
d() || isFloatType) { | 4558 if (!canvas->renderingContext() || !canvas->renderingContext()->isAccelerate
d() || isFloatType) { |
| 4559 // 2D canvas has only FrontBuffer. | 4559 // 2D canvas has only FrontBuffer. |
| 4560 texSubImage2DImpl(target, level, xoffset, yoffset, format, type, canvas-
>copiedImage(FrontBuffer).get(), | 4560 texSubImage2DImpl(target, level, xoffset, yoffset, format, type, canvas-
>copiedImage(FrontBuffer, PreferAcceleration).get(), |
| 4561 WebGLImageConversion::HtmlDomCanvas, m_unpackFlipY, m_unpackPremulti
plyAlpha); | 4561 WebGLImageConversion::HtmlDomCanvas, m_unpackFlipY, m_unpackPremulti
plyAlpha); |
| 4562 return; | 4562 return; |
| 4563 } | 4563 } |
| 4564 | 4564 |
| 4565 texImage2DCanvasByGPU(TexSubImage2D, texture, target, level, GL_RGBA, type,
xoffset, yoffset, canvas); | 4565 texImage2DCanvasByGPU(TexSubImage2D, texture, target, level, GL_RGBA, type,
xoffset, yoffset, canvas); |
| 4566 } | 4566 } |
| 4567 | 4567 |
| 4568 void WebGLRenderingContextBase::texSubImage2D(GLenum target, GLint level, GLint
xoffset, GLint yoffset, | 4568 void WebGLRenderingContextBase::texSubImage2D(GLenum target, GLint level, GLint
xoffset, GLint yoffset, |
| 4569 GLenum format, GLenum type, HTMLVideoElement* video, ExceptionState& excepti
onState) | 4569 GLenum format, GLenum type, HTMLVideoElement* video, ExceptionState& excepti
onState) |
| 4570 { | 4570 { |
| (...skipping 2164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6735 | 6735 |
| 6736 return totalBytesPerPixel; | 6736 return totalBytesPerPixel; |
| 6737 } | 6737 } |
| 6738 | 6738 |
| 6739 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const | 6739 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const |
| 6740 { | 6740 { |
| 6741 return m_drawingBuffer.get(); | 6741 return m_drawingBuffer.get(); |
| 6742 } | 6742 } |
| 6743 | 6743 |
| 6744 } // namespace blink | 6744 } // namespace blink |
| OLD | NEW |