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 3571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3582 GLenum format, GLenum type, HTMLVideoElement* video, ExceptionState& excepti
onState) | 3582 GLenum format, GLenum type, HTMLVideoElement* video, ExceptionState& excepti
onState) |
3583 { | 3583 { |
3584 if (isContextLost() || !validateHTMLVideoElement("texImage2D", video, except
ionState) | 3584 if (isContextLost() || !validateHTMLVideoElement("texImage2D", video, except
ionState) |
3585 || !validateTexFunc("texImage2D", NotTexSubImage2D, SourceHTMLVideoEleme
nt, target, level, internalformat, video->videoWidth(), video->videoHeight(), 0,
format, type, 0, 0)) | 3585 || !validateTexFunc("texImage2D", NotTexSubImage2D, SourceHTMLVideoEleme
nt, target, level, internalformat, video->videoWidth(), video->videoHeight(), 0,
format, type, 0, 0)) |
3586 return; | 3586 return; |
3587 | 3587 |
3588 // Go through the fast path doing a GPU-GPU textures copy without a readback
to system memory if possible. | 3588 // Go through the fast path doing a GPU-GPU textures copy without a readback
to system memory if possible. |
3589 // Otherwise, it will fall back to the normal SW path. | 3589 // Otherwise, it will fall back to the normal SW path. |
3590 WebGLTexture* texture = validateTextureBinding("texImage2D", target, true); | 3590 WebGLTexture* texture = validateTextureBinding("texImage2D", target, true); |
3591 if (GL_TEXTURE_2D == target && texture) { | 3591 if (GL_TEXTURE_2D == target && texture) { |
3592 if (video->copyVideoTextureToPlatformTexture(webContext(), texture->obje
ct(), level, type, internalformat, m_unpackPremultiplyAlpha, m_unpackFlipY)) { | 3592 if (video->copyVideoTextureToPlatformTexture(webContext(), texture->obje
ct(), level, internalformat, type, m_unpackPremultiplyAlpha, m_unpackFlipY)) { |
3593 texture->setLevelInfo(target, level, internalformat, video->videoWid
th(), video->videoHeight(), type); | 3593 texture->setLevelInfo(target, level, internalformat, video->videoWid
th(), video->videoHeight(), type); |
3594 return; | 3594 return; |
3595 } | 3595 } |
3596 } | 3596 } |
3597 | 3597 |
3598 // Normal pure SW path. | 3598 // Normal pure SW path. |
3599 RefPtr<Image> image = videoFrameToImage(video, ImageBuffer::fastCopyImageMod
e()); | 3599 RefPtr<Image> image = videoFrameToImage(video, ImageBuffer::fastCopyImageMod
e()); |
3600 if (!image) | 3600 if (!image) |
3601 return; | 3601 return; |
3602 texImage2DImpl(target, level, internalformat, format, type, image.get(), Web
GLImageConversion::HtmlDomVideo, m_unpackFlipY, m_unpackPremultiplyAlpha, except
ionState); | 3602 texImage2DImpl(target, level, internalformat, format, type, image.get(), Web
GLImageConversion::HtmlDomVideo, m_unpackFlipY, m_unpackPremultiplyAlpha, except
ionState); |
(...skipping 2197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5800 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB
uffer() : 0; | 5800 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB
uffer() : 0; |
5801 } | 5801 } |
5802 #else | 5802 #else |
5803 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const | 5803 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const |
5804 { | 5804 { |
5805 return m_drawingBuffer.get(); | 5805 return m_drawingBuffer.get(); |
5806 } | 5806 } |
5807 #endif | 5807 #endif |
5808 | 5808 |
5809 } // namespace blink | 5809 } // namespace blink |
OLD | NEW |