| 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 3439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3450 } | 3450 } |
| 3451 } | 3451 } |
| 3452 | 3452 |
| 3453 if (m_unpackAlignment != 1) | 3453 if (m_unpackAlignment != 1) |
| 3454 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, 1); | 3454 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, 1); |
| 3455 texImage2DBase(target, level, internalformat, imageExtractor.imageWidth(), i
mageExtractor.imageHeight(), 0, format, type, needConversion ? data.data() : ima
gePixelData, exceptionState); | 3455 texImage2DBase(target, level, internalformat, imageExtractor.imageWidth(), i
mageExtractor.imageHeight(), 0, format, type, needConversion ? data.data() : ima
gePixelData, exceptionState); |
| 3456 if (m_unpackAlignment != 1) | 3456 if (m_unpackAlignment != 1) |
| 3457 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); | 3457 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); |
| 3458 } | 3458 } |
| 3459 | 3459 |
| 3460 bool WebGLRenderingContextBase::validateTexFunc(const char* functionName, TexFun
cValidationFunctionType functionType, TexFuncValidationSourceType sourceType, GL
enum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height,
GLint border, GLenum format, GLenum type, GLint xoffset, GLint yoffset) | 3460 bool WebGLRenderingContextBase::validateTexFunc(const char* functionName, TexIma
geFunctionType functionType, TexFuncValidationSourceType sourceType, GLenum targ
et, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint bor
der, GLenum format, GLenum type, GLint xoffset, GLint yoffset) |
| 3461 { | 3461 { |
| 3462 if (!validateTexFuncParameters(functionName, functionType, target, level, in
ternalformat, width, height, border, format, type)) | 3462 if (!validateTexFuncParameters(functionName, functionType, target, level, in
ternalformat, width, height, border, format, type)) |
| 3463 return false; | 3463 return false; |
| 3464 | 3464 |
| 3465 WebGLTexture* texture = validateTextureBinding(functionName, target, true); | 3465 WebGLTexture* texture = validateTextureBinding(functionName, target, true); |
| 3466 if (!texture) | 3466 if (!texture) |
| 3467 return false; | 3467 return false; |
| 3468 | 3468 |
| 3469 if (functionType == NotTexSubImage2D) { | 3469 if (functionType == NotTexSubImage2D) { |
| 3470 if (level && WebGLTexture::isNPOT(width, height)) { | 3470 if (level && WebGLTexture::isNPOT(width, height)) { |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3586 RefPtr<Image> imageForRender = image->cachedImage()->imageForRenderer(image-
>renderer()); | 3586 RefPtr<Image> imageForRender = image->cachedImage()->imageForRenderer(image-
>renderer()); |
| 3587 if (imageForRender->isSVGImage()) | 3587 if (imageForRender->isSVGImage()) |
| 3588 imageForRender = drawImageIntoBuffer(imageForRender.get(), image->width(
), image->height(), "texImage2D"); | 3588 imageForRender = drawImageIntoBuffer(imageForRender.get(), image->width(
), image->height(), "texImage2D"); |
| 3589 | 3589 |
| 3590 if (!imageForRender || !validateTexFunc("texImage2D", NotTexSubImage2D, Sour
ceHTMLImageElement, target, level, internalformat, imageForRender->width(), imag
eForRender->height(), 0, format, type, 0, 0)) | 3590 if (!imageForRender || !validateTexFunc("texImage2D", NotTexSubImage2D, Sour
ceHTMLImageElement, target, level, internalformat, imageForRender->width(), imag
eForRender->height(), 0, format, type, 0, 0)) |
| 3591 return; | 3591 return; |
| 3592 | 3592 |
| 3593 texImage2DImpl(target, level, internalformat, format, type, imageForRender.g
et(), WebGLImageConversion::HtmlDomImage, m_unpackFlipY, m_unpackPremultiplyAlph
a, exceptionState); | 3593 texImage2DImpl(target, level, internalformat, format, type, imageForRender.g
et(), WebGLImageConversion::HtmlDomImage, m_unpackFlipY, m_unpackPremultiplyAlph
a, exceptionState); |
| 3594 } | 3594 } |
| 3595 | 3595 |
| 3596 void WebGLRenderingContextBase::texImage2DCanvasByGPU(TexImageFunctionType funct
ionType, WebGLTexture* texture, GLenum target, |
| 3597 GLint level, GLenum internalformat, GLenum type, GLint xoffset, GLint yoffse
t, HTMLCanvasElement* canvas) |
| 3598 { |
| 3599 ScopedTexture2DRestorer restorer(this); |
| 3600 |
| 3601 Platform3DObject targetTexture = texture->object(); |
| 3602 GLenum targetType = type; |
| 3603 GLenum targetInternalformat = internalformat; |
| 3604 GLint targetLevel = level; |
| 3605 bool possibleDirectCopy = false; |
| 3606 if (functionType == NotTexSubImage2D) { |
| 3607 possibleDirectCopy = GL_TEXTURE_2D == target && Extensions3DUtil::canUse
CopyTextureCHROMIUM(internalformat, type, level); |
| 3608 } else if (functionType == TexSubImage2D) { |
| 3609 possibleDirectCopy = false; |
| 3610 } |
| 3611 // if direct copy is not possible, create a temporary texture and then copy
from canvas to temporary texture to target texture. |
| 3612 if (!possibleDirectCopy) { |
| 3613 targetLevel = 0; |
| 3614 targetInternalformat = GL_RGBA; |
| 3615 targetType = GL_UNSIGNED_BYTE; |
| 3616 targetTexture = webContext()->createTexture(); |
| 3617 webContext()->bindTexture(GL_TEXTURE_2D, targetTexture); |
| 3618 webContext()->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEA
REST); |
| 3619 webContext()->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEA
REST); |
| 3620 webContext()->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_T
O_EDGE); |
| 3621 webContext()->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_T
O_EDGE); |
| 3622 webContext()->texImage2D(GL_TEXTURE_2D, 0, targetInternalformat, canvas-
>width(), |
| 3623 canvas->height(), 0, GL_RGBA, targetType, 0); |
| 3624 } |
| 3625 |
| 3626 if (!canvas->is3D()) { |
| 3627 ImageBuffer* buffer = canvas->buffer(); |
| 3628 if (!buffer) |
| 3629 return; |
| 3630 if (!buffer->copyToPlatformTexture(webContext(), targetTexture, targetIn
ternalformat, targetType, |
| 3631 targetLevel, m_unpackPremultiplyAlpha, m_unpackFlipY)) { |
| 3632 ASSERT_NOT_REACHED(); |
| 3633 } |
| 3634 } else { |
| 3635 WebGLRenderingContextBase* gl = toWebGLRenderingContextBase(canvas->rend
eringContext()); |
| 3636 if (!gl) |
| 3637 return; |
| 3638 ScopedTexture2DRestorer restorer(gl); |
| 3639 if (!gl->drawingBuffer()->copyToPlatformTexture(webContext(), targetText
ure, targetInternalformat, targetType, |
| 3640 targetLevel, m_unpackPremultiplyAlpha, !m_unpackFlipY, BackBuffer))
{ |
| 3641 ASSERT_NOT_REACHED(); |
| 3642 } |
| 3643 } |
| 3644 |
| 3645 if (!possibleDirectCopy) { |
| 3646 WebGLId tmpFBO = webContext()->createFramebuffer(); |
| 3647 webContext()->bindFramebuffer(GL_FRAMEBUFFER, tmpFBO); |
| 3648 webContext()->framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
GL_TEXTURE_2D, targetTexture, 0); |
| 3649 webContext()->bindTexture(texture->getTarget(), texture->object()); |
| 3650 if (functionType == NotTexSubImage2D) { |
| 3651 webContext()->copyTexImage2D(target, level, internalformat, 0, 0, ca
nvas->width(), canvas->height(), 0); |
| 3652 } else if (functionType == TexSubImage2D) { |
| 3653 webContext()->copyTexSubImage2D(target, level, xoffset, yoffset, 0,
0, canvas->width(), canvas->height()); |
| 3654 } |
| 3655 webContext()->framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
GL_TEXTURE_2D, 0, 0); |
| 3656 restoreCurrentFramebuffer(); |
| 3657 webContext()->deleteFramebuffer(tmpFBO); |
| 3658 webContext()->deleteTexture(targetTexture); |
| 3659 } |
| 3660 } |
| 3661 |
| 3596 void WebGLRenderingContextBase::texImage2D(GLenum target, GLint level, GLenum in
ternalformat, | 3662 void WebGLRenderingContextBase::texImage2D(GLenum target, GLint level, GLenum in
ternalformat, |
| 3597 GLenum format, GLenum type, HTMLCanvasElement* canvas, ExceptionState& excep
tionState) | 3663 GLenum format, GLenum type, HTMLCanvasElement* canvas, ExceptionState& excep
tionState) |
| 3598 { | 3664 { |
| 3599 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)) | 3665 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)) |
| 3600 return; | 3666 return; |
| 3601 | 3667 |
| 3602 WebGLTexture* texture = validateTextureBinding("texImage2D", target, true); | 3668 WebGLTexture* texture = validateTextureBinding("texImage2D", target, true); |
| 3669 ASSERT(texture); |
| 3603 | 3670 |
| 3604 // If possible, copy from the canvas element directly to the texture | 3671 if (!canvas->renderingContext() || !canvas->renderingContext()->isAccelerate
d()) { |
| 3605 // via the GPU, without a read-back to system memory. | 3672 ASSERT(!canvas->renderingContext() || canvas->renderingContext()->is2d()
); |
| 3606 if (GL_TEXTURE_2D == target && texture) { | 3673 texImage2DImpl(target, level, internalformat, format, type, canvas->copi
edImage(), |
| 3607 ScopedTexture2DRestorer restorer(this); | 3674 WebGLImageConversion::HtmlDomCanvas, m_unpackFlipY, m_unpackPremulti
plyAlpha, exceptionState); |
| 3608 | 3675 return; |
| 3609 if (!canvas->is3D()) { | |
| 3610 ImageBuffer* buffer = canvas->buffer(); | |
| 3611 if (buffer && buffer->copyToPlatformTexture(webContext(), texture->o
bject(), internalformat, type, | |
| 3612 level, m_unpackPremultiplyAlpha, m_unpackFlipY)) { | |
| 3613 texture->setLevelInfo(target, level, internalformat, canvas->wid
th(), canvas->height(), type); | |
| 3614 return; | |
| 3615 } | |
| 3616 } else { | |
| 3617 WebGLRenderingContextBase* gl = toWebGLRenderingContextBase(canvas->
renderingContext()); | |
| 3618 ScopedTexture2DRestorer restorer(gl); | |
| 3619 if (gl && gl->drawingBuffer()->copyToPlatformTexture(webContext(), t
exture->object(), internalformat, type, | |
| 3620 level, m_unpackPremultiplyAlpha, !m_unpackFlipY, BackBuffer)) { | |
| 3621 texture->setLevelInfo(target, level, internalformat, canvas->wid
th(), canvas->height(), type); | |
| 3622 return; | |
| 3623 } | |
| 3624 } | |
| 3625 } | 3676 } |
| 3626 | 3677 |
| 3627 texImage2DImpl(target, level, internalformat, format, type, canvas->copiedIm
age(BackBuffer), WebGLImageConversion::HtmlDomCanvas, m_unpackFlipY, m_unpackPre
multiplyAlpha, exceptionState); | 3678 texImage2DCanvasByGPU(NotTexSubImage2D, texture, target, level, internalform
at, type, 0, 0, canvas); |
| 3679 texture->setLevelInfo(target, level, internalformat, canvas->width(), canvas
->height(), type); |
| 3628 } | 3680 } |
| 3629 | 3681 |
| 3630 PassRefPtr<Image> WebGLRenderingContextBase::videoFrameToImage(HTMLVideoElement*
video, BackingStoreCopy backingStoreCopy) | 3682 PassRefPtr<Image> WebGLRenderingContextBase::videoFrameToImage(HTMLVideoElement*
video, BackingStoreCopy backingStoreCopy) |
| 3631 { | 3683 { |
| 3632 IntSize size(video->videoWidth(), video->videoHeight()); | 3684 IntSize size(video->videoWidth(), video->videoHeight()); |
| 3633 ImageBuffer* buf = m_generatedImageCache.imageBuffer(size); | 3685 ImageBuffer* buf = m_generatedImageCache.imageBuffer(size); |
| 3634 if (!buf) { | 3686 if (!buf) { |
| 3635 synthesizeGLError(GL_OUT_OF_MEMORY, "texImage2D", "out of memory"); | 3687 synthesizeGLError(GL_OUT_OF_MEMORY, "texImage2D", "out of memory"); |
| 3636 return nullptr; | 3688 return nullptr; |
| 3637 } | 3689 } |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3851 texSubImage2DImpl(target, level, xoffset, yoffset, format, type, imageForRen
der.get(), WebGLImageConversion::HtmlDomImage, m_unpackFlipY, m_unpackPremultipl
yAlpha, exceptionState); | 3903 texSubImage2DImpl(target, level, xoffset, yoffset, format, type, imageForRen
der.get(), WebGLImageConversion::HtmlDomImage, m_unpackFlipY, m_unpackPremultipl
yAlpha, exceptionState); |
| 3852 } | 3904 } |
| 3853 | 3905 |
| 3854 void WebGLRenderingContextBase::texSubImage2D(GLenum target, GLint level, GLint
xoffset, GLint yoffset, | 3906 void WebGLRenderingContextBase::texSubImage2D(GLenum target, GLint level, GLint
xoffset, GLint yoffset, |
| 3855 GLenum format, GLenum type, HTMLCanvasElement* canvas, ExceptionState& excep
tionState) | 3907 GLenum format, GLenum type, HTMLCanvasElement* canvas, ExceptionState& excep
tionState) |
| 3856 { | 3908 { |
| 3857 if (isContextLost() || !validateHTMLCanvasElement("texSubImage2D", canvas, e
xceptionState) | 3909 if (isContextLost() || !validateHTMLCanvasElement("texSubImage2D", canvas, e
xceptionState) |
| 3858 || !validateTexFunc("texSubImage2D", TexSubImage2D, SourceHTMLCanvasElem
ent, target, level, format, canvas->width(), canvas->height(), 0, format, type,
xoffset, yoffset)) | 3910 || !validateTexFunc("texSubImage2D", TexSubImage2D, SourceHTMLCanvasElem
ent, target, level, format, canvas->width(), canvas->height(), 0, format, type,
xoffset, yoffset)) |
| 3859 return; | 3911 return; |
| 3860 | 3912 |
| 3861 texSubImage2DImpl(target, level, xoffset, yoffset, format, type, canvas->cop
iedImage(BackBuffer), WebGLImageConversion::HtmlDomCanvas, m_unpackFlipY, m_unpa
ckPremultiplyAlpha, exceptionState); | 3913 WebGLTexture* texture = validateTextureBinding("texImage2D", target, true); |
| 3914 ASSERT(texture); |
| 3915 |
| 3916 if (!canvas->renderingContext() || !canvas->renderingContext()->isAccelerate
d()) { |
| 3917 ASSERT(!canvas->renderingContext() || canvas->renderingContext()->is2d()
); |
| 3918 texSubImage2DImpl(target, level, xoffset, yoffset, format, type, canvas-
>copiedImage(), |
| 3919 WebGLImageConversion::HtmlDomCanvas, m_unpackFlipY, m_unpackPremulti
plyAlpha, exceptionState); |
| 3920 return; |
| 3921 } |
| 3922 |
| 3923 texImage2DCanvasByGPU(TexSubImage2D, texture, target, level, GL_RGBA, type,
xoffset, yoffset, canvas); |
| 3862 } | 3924 } |
| 3863 | 3925 |
| 3864 void WebGLRenderingContextBase::texSubImage2D(GLenum target, GLint level, GLint
xoffset, GLint yoffset, | 3926 void WebGLRenderingContextBase::texSubImage2D(GLenum target, GLint level, GLint
xoffset, GLint yoffset, |
| 3865 GLenum format, GLenum type, HTMLVideoElement* video, ExceptionState& excepti
onState) | 3927 GLenum format, GLenum type, HTMLVideoElement* video, ExceptionState& excepti
onState) |
| 3866 { | 3928 { |
| 3867 if (isContextLost() || !validateHTMLVideoElement("texSubImage2D", video, exc
eptionState) | 3929 if (isContextLost() || !validateHTMLVideoElement("texSubImage2D", video, exc
eptionState) |
| 3868 || !validateTexFunc("texSubImage2D", TexSubImage2D, SourceHTMLVideoEleme
nt, target, level, format, video->videoWidth(), video->videoHeight(), 0, format,
type, xoffset, yoffset)) | 3930 || !validateTexFunc("texSubImage2D", TexSubImage2D, SourceHTMLVideoEleme
nt, target, level, format, video->videoWidth(), video->videoHeight(), 0, format,
type, xoffset, yoffset)) |
| 3869 return; | 3931 return; |
| 3870 | 3932 |
| 3871 RefPtr<Image> image = videoFrameToImage(video, ImageBuffer::fastCopyImageMod
e()); | 3933 RefPtr<Image> image = videoFrameToImage(video, ImageBuffer::fastCopyImageMod
e()); |
| (...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4812 synthesizeGLError(GL_INVALID_VALUE, functionName, "level out of rang
e"); | 4874 synthesizeGLError(GL_INVALID_VALUE, functionName, "level out of rang
e"); |
| 4813 return false; | 4875 return false; |
| 4814 } | 4876 } |
| 4815 break; | 4877 break; |
| 4816 } | 4878 } |
| 4817 // This function only checks if level is legal, so we return true and don't | 4879 // This function only checks if level is legal, so we return true and don't |
| 4818 // generate INVALID_ENUM if target is illegal. | 4880 // generate INVALID_ENUM if target is illegal. |
| 4819 return true; | 4881 return true; |
| 4820 } | 4882 } |
| 4821 | 4883 |
| 4822 bool WebGLRenderingContextBase::validateTexFuncDimensions(const char* functionNa
me, TexFuncValidationFunctionType functionType, | 4884 bool WebGLRenderingContextBase::validateTexFuncDimensions(const char* functionNa
me, TexImageFunctionType functionType, |
| 4823 GLenum target, GLint level, GLsizei width, GLsizei height) | 4885 GLenum target, GLint level, GLsizei width, GLsizei height) |
| 4824 { | 4886 { |
| 4825 if (width < 0 || height < 0) { | 4887 if (width < 0 || height < 0) { |
| 4826 synthesizeGLError(GL_INVALID_VALUE, functionName, "width or height < 0")
; | 4888 synthesizeGLError(GL_INVALID_VALUE, functionName, "width or height < 0")
; |
| 4827 return false; | 4889 return false; |
| 4828 } | 4890 } |
| 4829 | 4891 |
| 4830 switch (target) { | 4892 switch (target) { |
| 4831 case GL_TEXTURE_2D: | 4893 case GL_TEXTURE_2D: |
| 4832 if (width > (m_maxTextureSize >> level) || height > (m_maxTextureSize >>
level)) { | 4894 if (width > (m_maxTextureSize >> level) || height > (m_maxTextureSize >>
level)) { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 4851 return false; | 4913 return false; |
| 4852 } | 4914 } |
| 4853 break; | 4915 break; |
| 4854 default: | 4916 default: |
| 4855 synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid target"); | 4917 synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid target"); |
| 4856 return false; | 4918 return false; |
| 4857 } | 4919 } |
| 4858 return true; | 4920 return true; |
| 4859 } | 4921 } |
| 4860 | 4922 |
| 4861 bool WebGLRenderingContextBase::validateTexFuncParameters(const char* functionNa
me, TexFuncValidationFunctionType functionType, GLenum target, | 4923 bool WebGLRenderingContextBase::validateTexFuncParameters(const char* functionNa
me, TexImageFunctionType functionType, GLenum target, |
| 4862 GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint bor
der, GLenum format, GLenum type) | 4924 GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint bor
der, GLenum format, GLenum type) |
| 4863 { | 4925 { |
| 4864 // We absolutely have to validate the format and type combination. | 4926 // We absolutely have to validate the format and type combination. |
| 4865 // The texImage2D entry points taking HTMLImage, etc. will produce | 4927 // The texImage2D entry points taking HTMLImage, etc. will produce |
| 4866 // temporary data based on this combination, so it must be legal. | 4928 // temporary data based on this combination, so it must be legal. |
| 4867 if (!validateTexFuncFormatAndType(functionName, format, type, level) || !val
idateTexFuncLevel(functionName, target, level)) | 4929 if (!validateTexFuncFormatAndType(functionName, format, type, level) || !val
idateTexFuncLevel(functionName, target, level)) |
| 4868 return false; | 4930 return false; |
| 4869 | 4931 |
| 4870 if (!validateTexFuncDimensions(functionName, functionType, target, level, wi
dth, height)) | 4932 if (!validateTexFuncDimensions(functionName, functionType, target, level, wi
dth, height)) |
| 4871 return false; | 4933 return false; |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5024 } | 5086 } |
| 5025 | 5087 |
| 5026 if (pixels->byteLength() != bytesRequired) { | 5088 if (pixels->byteLength() != bytesRequired) { |
| 5027 synthesizeGLError(GL_INVALID_VALUE, functionName, "length of ArrayBuffer
View is not correct for dimensions"); | 5089 synthesizeGLError(GL_INVALID_VALUE, functionName, "length of ArrayBuffer
View is not correct for dimensions"); |
| 5028 return false; | 5090 return false; |
| 5029 } | 5091 } |
| 5030 | 5092 |
| 5031 return true; | 5093 return true; |
| 5032 } | 5094 } |
| 5033 | 5095 |
| 5034 bool WebGLRenderingContextBase::validateCompressedTexDimensions(const char* func
tionName, TexFuncValidationFunctionType functionType, GLenum target, GLint level
, GLsizei width, GLsizei height, GLenum format) | 5096 bool WebGLRenderingContextBase::validateCompressedTexDimensions(const char* func
tionName, TexImageFunctionType functionType, GLenum target, GLint level, GLsizei
width, GLsizei height, GLenum format) |
| 5035 { | 5097 { |
| 5036 if (!validateTexFuncDimensions(functionName, functionType, target, level, wi
dth, height)) | 5098 if (!validateTexFuncDimensions(functionName, functionType, target, level, wi
dth, height)) |
| 5037 return false; | 5099 return false; |
| 5038 | 5100 |
| 5039 bool widthValid = false; | 5101 bool widthValid = false; |
| 5040 bool heightValid = false; | 5102 bool heightValid = false; |
| 5041 | 5103 |
| 5042 switch (format) { | 5104 switch (format) { |
| 5043 case GC3D_COMPRESSED_ATC_RGB_AMD: | 5105 case GC3D_COMPRESSED_ATC_RGB_AMD: |
| 5044 case GC3D_COMPRESSED_ATC_RGBA_EXPLICIT_ALPHA_AMD: | 5106 case GC3D_COMPRESSED_ATC_RGBA_EXPLICIT_ALPHA_AMD: |
| (...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5866 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB
uffer() : 0; | 5928 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB
uffer() : 0; |
| 5867 } | 5929 } |
| 5868 #else | 5930 #else |
| 5869 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const | 5931 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const |
| 5870 { | 5932 { |
| 5871 return m_drawingBuffer.get(); | 5933 return m_drawingBuffer.get(); |
| 5872 } | 5934 } |
| 5873 #endif | 5935 #endif |
| 5874 | 5936 |
| 5875 } // namespace blink | 5937 } // namespace blink |
| OLD | NEW |