Changeset 60874 in webkit
- Timestamp:
- Jun 8, 2010 5:45:24 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r60873 r60874 1 2010-06-08 Zhenyao Mo <zmo@google.com> 2 3 Reviewed by Dimitri Glazkov. 4 5 Validate *tex* functions input parameters according to ES2 conformance 6 https://bugs.webkit.org/show_bug.cgi?id=38145 7 8 * fast/canvas/webgl/tex-image-and-sub-image-2d-with-image.html: Internalformat and format need to be the same. 9 * fast/canvas/webgl/tex-input-validation-expected.txt: Added. 10 * fast/canvas/webgl/tex-input-validation.html: Added. 11 1 12 2010-06-08 Erik Arvidsson <arv@chromium.org> 2 13 -
trunk/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image.html
r55282 r60874 118 118 if (useTexSubImage2D) { 119 119 // Initialize the texture to black first 120 gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB , image.width, image.height, 0,120 gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, image.width, image.height, 0, 121 121 gl.RGBA, gl.UNSIGNED_BYTE, null); 122 122 gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, image, flipY, false); … … 129 129 // Draw the triangles 130 130 gl.drawArrays(gl.TRIANGLES, 0, 6); 131 132 131 // Read back the rendering results 133 132 var width = 32; -
trunk/WebCore/ChangeLog
r60873 r60874 1 2010-06-08 Zhenyao Mo <zmo@google.com> 2 3 Reviewed by Dimitri Glazkov. 4 5 Validate *tex* functions input parameters according to ES2 conformance 6 https://bugs.webkit.org/show_bug.cgi?id=38145 7 8 Test: fast/canvas/webgl/tex-input-validation.html 9 10 * html/canvas/WebGLFramebuffer.cpp: 11 (WebCore::WebGLFramebuffer::getColorBufferFormat): Get color buffer internalformat. 12 * html/canvas/WebGLFramebuffer.h: Ditto. 13 * html/canvas/WebGLRenderingContext.cpp: 14 (WebCore::WebGLRenderingContext::WebGLRenderingContext): Deal with max tex units and max texture size. 15 (WebCore::WebGLRenderingContext::copyTexImage2D): Validate input parameters. 16 (WebCore::WebGLRenderingContext::copyTexSubImage2D): Ditto. 17 (WebCore::WebGLRenderingContext::texImage2DBase): Ditto. 18 (WebCore::WebGLRenderingContext::texParameterf): Ditto. 19 (WebCore::WebGLRenderingContext::texParameteri): Ditto. 20 (WebCore::WebGLRenderingContext::texSubImage2DBase): Ditto. 21 (WebCore::WebGLRenderingContext::handleNPOTTextures): Deal with max tex units. 22 (WebCore::WebGLRenderingContext::isTexInternalformatColorBufferCombinationValid): Check whether the texture format and framebuffer color buffer internalformat combination is valid. 23 (WebCore::WebGLRenderingContext::getTextureBinding): get the current bound texture for given target. 24 (WebCore::WebGLRenderingContext::validateTexFuncFormatAndType): Validate input format/type for *tex* functions. 25 (WebCore::WebGLRenderingContext::validateTexFuncParameters): Validate input parameters for *tex* functions. 26 (WebCore::WebGLRenderingContext::texParameter): Base function for texParameteri and texParameterf. 27 * html/canvas/WebGLRenderingContext.h: Deal with max tex units. 28 * html/canvas/WebGLTexture.cpp: 29 (WebCore::WebGLTexture::WebGLTexture): Cache internalformat. 30 * html/canvas/WebGLTexture.h: Ditto. 31 (WebCore::WebGLTexture::setInternalformat): 32 (WebCore::WebGLTexture::getInternalformat): 33 * platform/graphics/GraphicsContext3D.cpp: internalformat and format need to be the same. 34 (WebCore::GraphicsContext3D::extractImageData): 35 1 36 2010-06-08 Erik Arvidsson <arv@chromium.org> 2 37 -
trunk/WebCore/html/canvas/WebGLFramebuffer.cpp
r60290 r60874 88 88 } 89 89 90 unsigned long WebGLFramebuffer::getColorBufferFormat() 91 { 92 if (object() && m_colorAttachment && m_colorAttachment->object()) { 93 if (m_colorAttachment->isRenderbuffer()) { 94 unsigned long format = (reinterpret_cast<WebGLRenderbuffer*>(m_colorAttachment))->getInternalformat(); 95 switch (format) { 96 case GraphicsContext3D::RGBA4: 97 case GraphicsContext3D::RGB5_A1: 98 return GraphicsContext3D::RGBA; 99 case GraphicsContext3D::RGB565: 100 return GraphicsContext3D::RGB; 101 } 102 } else if (m_colorAttachment->isTexture()) 103 return (reinterpret_cast<WebGLTexture*>(m_colorAttachment))->getInternalformat(); 104 } 105 return 0; 106 } 107 90 108 void WebGLFramebuffer::_deleteObject(Platform3DObject object) 91 109 { -
trunk/WebCore/html/canvas/WebGLFramebuffer.h
r60290 r60874 58 58 void onAttachedObjectChange(CanvasObject*); 59 59 60 unsigned long getColorBufferFormat(); 61 60 62 protected: 61 63 WebGLFramebuffer(WebGLRenderingContext*); -
trunk/WebCore/html/canvas/WebGLRenderingContext.cpp
r60290 r60874 51 51 52 52 #include <wtf/ByteArray.h> 53 #include <wtf/MathExtras.h> 53 54 54 55 namespace WebCore { … … 94 95 { 95 96 ASSERT(m_context); 97 98 int numCombinedTextureImageUnits = 0; 99 m_context->getIntegerv(GraphicsContext3D::MAX_COMBINED_TEXTURE_IMAGE_UNITS, &numCombinedTextureImageUnits); 100 m_textureUnits.resize(numCombinedTextureImageUnits); 101 96 102 int numVertexAttribs = 0; 97 103 m_context->getIntegerv(GraphicsContext3D::MAX_VERTEX_ATTRIBS, &numVertexAttribs); 98 104 m_maxVertexAttribs = numVertexAttribs; 105 99 106 int implementationColorReadFormat = GraphicsContext3D::RGBA; 100 107 m_context->getIntegerv(GraphicsContext3D::IMPLEMENTATION_COLOR_READ_FORMAT, &implementationColorReadFormat); … … 103 110 m_context->getIntegerv(GraphicsContext3D::IMPLEMENTATION_COLOR_READ_TYPE, &implementationColorReadType); 104 111 m_implementationColorReadType = implementationColorReadType; 112 113 int maxTextureSize = 0; 114 m_context->getIntegerv(GraphicsContext3D::MAX_TEXTURE_SIZE, &maxTextureSize); 115 m_maxTextureSize = maxTextureSize; 116 int maxCubeMapTextureSize = 0; 117 m_context->getIntegerv(GraphicsContext3D::MAX_CUBE_MAP_TEXTURE_SIZE, &maxCubeMapTextureSize); 118 m_maxCubeMapTextureSize = maxCubeMapTextureSize; 119 105 120 if (!isGLES2Compliant()) 106 121 createFallbackBlackTextures1x1(); … … 434 449 void WebGLRenderingContext::copyTexImage2D(unsigned long target, long level, unsigned long internalformat, long x, long y, unsigned long width, unsigned long height, long border) 435 450 { 436 RefPtr<WebGLTexture> tex = 0; 437 switch (target) { 438 case GraphicsContext3D::TEXTURE_2D: 439 tex = m_textureUnits[m_activeTextureUnit].m_texture2DBinding; 440 break; 441 case GraphicsContext3D::TEXTURE_CUBE_MAP_POSITIVE_X: 442 case GraphicsContext3D::TEXTURE_CUBE_MAP_NEGATIVE_X: 443 case GraphicsContext3D::TEXTURE_CUBE_MAP_POSITIVE_Y: 444 case GraphicsContext3D::TEXTURE_CUBE_MAP_NEGATIVE_Y: 445 case GraphicsContext3D::TEXTURE_CUBE_MAP_POSITIVE_Z: 446 case GraphicsContext3D::TEXTURE_CUBE_MAP_NEGATIVE_Z: 447 tex = m_textureUnits[m_activeTextureUnit].m_textureCubeMapBinding; 448 break; 449 } 451 if (!validateTexFuncParameters(target, level, internalformat, width, height, border, internalformat, GraphicsContext3D::UNSIGNED_BYTE)) 452 return; 450 453 if (!isGLES2Compliant()) { 454 if (m_framebufferBinding && m_framebufferBinding->object() 455 && !isTexInternalformatColorBufferCombinationValid(internalformat, 456 m_framebufferBinding->getColorBufferFormat())) { 457 m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION); 458 return; 459 } 451 460 if (level && WebGLTexture::isNPOT(width, height)) { 452 461 m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE); 453 462 return; 454 463 } 464 } 465 m_context->copyTexImage2D(target, level, internalformat, x, y, width, height, border); 466 // FIXME: if the framebuffer is not complete, none of the below should be executed. 467 WebGLTexture* tex = getTextureBinding(target); 468 if (!isGLES2Compliant()) { 455 469 if (tex && !level) // only for level 0 456 470 tex->setSize(target, width, height); 457 } 458 m_context->copyTexImage2D(target, level, internalformat, x, y, width, height, border); 471 if (tex) 472 tex->setInternalformat(internalformat); 473 } 459 474 if (m_framebufferBinding && tex) 460 m_framebufferBinding->onAttachedObjectChange(tex .get());475 m_framebufferBinding->onAttachedObjectChange(tex); 461 476 cleanupAfterGraphicsCall(false); 462 477 } … … 464 479 void WebGLRenderingContext::copyTexSubImage2D(unsigned long target, long level, long xoffset, long yoffset, long x, long y, unsigned long width, unsigned long height) 465 480 { 481 if (!isGLES2Compliant()) { 482 WebGLTexture* tex = getTextureBinding(target); 483 if (m_framebufferBinding && m_framebufferBinding->object() && tex 484 && !isTexInternalformatColorBufferCombinationValid(tex->getInternalformat(), 485 m_framebufferBinding->getColorBufferFormat())) { 486 m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION); 487 return; 488 } 489 } 466 490 m_context->copyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height); 467 491 cleanupAfterGraphicsCall(false); … … 1806 1830 unsigned format, unsigned type, void* pixels, ExceptionCode& ec) 1807 1831 { 1808 RefPtr<WebGLTexture> tex = 0;1809 switch (target) {1810 case GraphicsContext3D::TEXTURE_2D:1811 tex = m_textureUnits[m_activeTextureUnit].m_texture2DBinding;1812 break;1813 case GraphicsContext3D::TEXTURE_CUBE_MAP_POSITIVE_X:1814 case GraphicsContext3D::TEXTURE_CUBE_MAP_NEGATIVE_X:1815 case GraphicsContext3D::TEXTURE_CUBE_MAP_POSITIVE_Y:1816 case GraphicsContext3D::TEXTURE_CUBE_MAP_NEGATIVE_Y:1817 case GraphicsContext3D::TEXTURE_CUBE_MAP_POSITIVE_Z:1818 case GraphicsContext3D::TEXTURE_CUBE_MAP_NEGATIVE_Z:1819 tex = m_textureUnits[m_activeTextureUnit].m_textureCubeMapBinding;1820 break;1821 }1822 1832 // FIXME: For now we ignore any errors returned 1823 1833 ec = 0; 1834 if (!validateTexFuncParameters(target, level, internalformat, width, height, border, format, type)) 1835 return; 1824 1836 if (!isGLES2Compliant()) { 1825 1837 if (level && WebGLTexture::isNPOT(width, height)) { … … 1827 1839 return; 1828 1840 } 1841 } 1842 m_context->texImage2D(target, level, internalformat, width, height, 1843 border, format, type, pixels); 1844 WebGLTexture* tex = getTextureBinding(target); 1845 if (!isGLES2Compliant()) { 1829 1846 if (tex && !level) // only for level 0 1830 1847 tex->setSize(target, width, height); 1831 }1832 m_context->texImage2D(target, level, internalformat, width, height,1833 border, format, type, pixels);1848 if (tex) 1849 tex->setInternalformat(internalformat); 1850 } 1834 1851 if (m_framebufferBinding && tex) 1835 m_framebufferBinding->onAttachedObjectChange(tex .get());1852 m_framebufferBinding->onAttachedObjectChange(tex); 1836 1853 cleanupAfterGraphicsCall(false); 1837 1854 } … … 1958 1975 } 1959 1976 1960 void WebGLRenderingContext::texParameterf(unsigned target, unsigned pname, float param) 1961 { 1962 m_context->texParameterf(target, pname, param); 1977 void WebGLRenderingContext::texParameter(unsigned long target, unsigned long pname, float paramf, int parami, bool isFloat) 1978 { 1963 1979 if (!isGLES2Compliant()) { 1964 1980 RefPtr<WebGLTexture> tex = 0; 1965 if (target == GraphicsContext3D::TEXTURE_2D) 1981 switch (target) { 1982 case GraphicsContext3D::TEXTURE_2D: 1966 1983 tex = m_textureUnits[m_activeTextureUnit].m_texture2DBinding; 1967 else if (target == GraphicsContext3D::TEXTURE_CUBE_MAP) 1984 break; 1985 case GraphicsContext3D::TEXTURE_CUBE_MAP: 1968 1986 tex = m_textureUnits[m_activeTextureUnit].m_textureCubeMapBinding; 1969 if (tex) 1970 tex->setParameterf(pname, param); 1971 } 1972 cleanupAfterGraphicsCall(false); 1987 break; 1988 default: 1989 m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM); 1990 return; 1991 } 1992 switch (pname) { 1993 case GraphicsContext3D::TEXTURE_MIN_FILTER: 1994 case GraphicsContext3D::TEXTURE_MAG_FILTER: 1995 break; 1996 case GraphicsContext3D::TEXTURE_WRAP_S: 1997 case GraphicsContext3D::TEXTURE_WRAP_T: 1998 if (isFloat && paramf != GraphicsContext3D::CLAMP_TO_EDGE && paramf != GraphicsContext3D::MIRRORED_REPEAT && paramf != GraphicsContext3D::REPEAT 1999 || !isFloat && parami != GraphicsContext3D::CLAMP_TO_EDGE && parami != GraphicsContext3D::MIRRORED_REPEAT && parami != GraphicsContext3D::REPEAT) { 2000 m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM); 2001 return; 2002 } 2003 break; 2004 default: 2005 m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM); 2006 return; 2007 } 2008 if (tex) { 2009 if (isFloat) 2010 tex->setParameterf(pname, paramf); 2011 else 2012 tex->setParameteri(pname, parami); 2013 } 2014 } 2015 if (isFloat) 2016 m_context->texParameterf(target, pname, paramf); 2017 else 2018 m_context->texParameteri(target, pname, parami); 2019 cleanupAfterGraphicsCall(false); 2020 } 2021 2022 void WebGLRenderingContext::texParameterf(unsigned target, unsigned pname, float param) 2023 { 2024 texParameter(target, pname, param, 0, true); 1973 2025 } 1974 2026 1975 2027 void WebGLRenderingContext::texParameteri(unsigned target, unsigned pname, int param) 1976 2028 { 1977 m_context->texParameteri(target, pname, param); 1978 if (!isGLES2Compliant()) { 1979 RefPtr<WebGLTexture> tex = 0; 1980 if (target == GraphicsContext3D::TEXTURE_2D) 1981 tex = m_textureUnits[m_activeTextureUnit].m_texture2DBinding; 1982 else if (target == GraphicsContext3D::TEXTURE_CUBE_MAP) 1983 tex = m_textureUnits[m_activeTextureUnit].m_textureCubeMapBinding; 1984 if (tex) 1985 tex->setParameteri(pname, param); 1986 } 1987 cleanupAfterGraphicsCall(false); 2029 texParameter(target, pname, 0, param, false); 1988 2030 } 1989 2031 … … 1994 2036 // FIXME: For now we ignore any errors returned 1995 2037 ec = 0; 2038 if (!validateTexFuncFormatAndType(format, type)) 2039 return; 2040 1996 2041 m_context->texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels); 1997 2042 cleanupAfterGraphicsCall(false); … … 3043 3088 return; 3044 3089 bool resetActiveUnit = false; 3045 // FIXME: active texture unit limits should be queries instead of 32. 3046 for (unsigned long ii = 0; ii < 32; ++ii) { 3090 for (unsigned ii = 0; ii < m_textureUnits.size(); ++ii) { 3047 3091 if (m_textureUnits[ii].m_texture2DBinding && m_textureUnits[ii].m_texture2DBinding->needToUseBlackTexture() 3048 3092 || m_textureUnits[ii].m_textureCubeMapBinding && m_textureUnits[ii].m_textureCubeMapBinding->needToUseBlackTexture()) { … … 3098 3142 } 3099 3143 3144 bool WebGLRenderingContext::isTexInternalformatColorBufferCombinationValid(unsigned long texInternalformat, 3145 unsigned long colorBufferFormat) 3146 { 3147 switch (colorBufferFormat) { 3148 case GraphicsContext3D::ALPHA: 3149 if (texInternalformat == GraphicsContext3D::ALPHA) 3150 return true; 3151 break; 3152 case GraphicsContext3D::RGB: 3153 if (texInternalformat == GraphicsContext3D::LUMINANCE 3154 || texInternalformat == GraphicsContext3D::RGB) 3155 return true; 3156 break; 3157 case GraphicsContext3D::RGBA: 3158 return true; 3159 } 3160 return false; 3161 } 3162 3163 WebGLTexture* WebGLRenderingContext::getTextureBinding(unsigned long target) 3164 { 3165 RefPtr<WebGLTexture> tex = 0; 3166 switch (target) { 3167 case GraphicsContext3D::TEXTURE_2D: 3168 tex = m_textureUnits[m_activeTextureUnit].m_texture2DBinding; 3169 break; 3170 case GraphicsContext3D::TEXTURE_CUBE_MAP_POSITIVE_X: 3171 case GraphicsContext3D::TEXTURE_CUBE_MAP_NEGATIVE_X: 3172 case GraphicsContext3D::TEXTURE_CUBE_MAP_POSITIVE_Y: 3173 case GraphicsContext3D::TEXTURE_CUBE_MAP_NEGATIVE_Y: 3174 case GraphicsContext3D::TEXTURE_CUBE_MAP_POSITIVE_Z: 3175 case GraphicsContext3D::TEXTURE_CUBE_MAP_NEGATIVE_Z: 3176 tex = m_textureUnits[m_activeTextureUnit].m_textureCubeMapBinding; 3177 break; 3178 } 3179 if (tex && tex->object()) 3180 return tex.get(); 3181 return 0; 3182 } 3183 3184 bool WebGLRenderingContext::validateTexFuncFormatAndType(unsigned long format, unsigned long type) 3185 { 3186 switch (format) { 3187 case GraphicsContext3D::ALPHA: 3188 case GraphicsContext3D::LUMINANCE: 3189 case GraphicsContext3D::LUMINANCE_ALPHA: 3190 case GraphicsContext3D::RGB: 3191 case GraphicsContext3D::RGBA: 3192 break; 3193 default: 3194 m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM); 3195 return false; 3196 } 3197 3198 switch (type) { 3199 case GraphicsContext3D::UNSIGNED_BYTE: 3200 case GraphicsContext3D::UNSIGNED_SHORT_5_6_5: 3201 case GraphicsContext3D::UNSIGNED_SHORT_4_4_4_4: 3202 case GraphicsContext3D::UNSIGNED_SHORT_5_5_5_1: 3203 break; 3204 default: 3205 m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM); 3206 return false; 3207 } 3208 3209 return true; 3210 } 3211 3212 bool WebGLRenderingContext::validateTexFuncParameters(unsigned long target, long level, 3213 unsigned long internalformat, 3214 long width, long height, long border, 3215 unsigned long format, unsigned long type) 3216 { 3217 if (isGLES2Compliant()) 3218 return true; 3219 3220 if (width < 0 || height < 0 || level < 0) { 3221 m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE); 3222 return false; 3223 } 3224 3225 switch (target) { 3226 case GraphicsContext3D::TEXTURE_2D: 3227 if (width > m_maxTextureSize || height > m_maxTextureSize || level > log2(m_maxTextureSize)) { 3228 m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE); 3229 return false; 3230 } 3231 break; 3232 case GraphicsContext3D::TEXTURE_CUBE_MAP_POSITIVE_X: 3233 case GraphicsContext3D::TEXTURE_CUBE_MAP_NEGATIVE_X: 3234 case GraphicsContext3D::TEXTURE_CUBE_MAP_POSITIVE_Y: 3235 case GraphicsContext3D::TEXTURE_CUBE_MAP_NEGATIVE_Y: 3236 case GraphicsContext3D::TEXTURE_CUBE_MAP_POSITIVE_Z: 3237 case GraphicsContext3D::TEXTURE_CUBE_MAP_NEGATIVE_Z: 3238 if (width != height || width > m_maxCubeMapTextureSize || level > log2(m_maxCubeMapTextureSize)) { 3239 m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE); 3240 return false; 3241 } 3242 break; 3243 default: 3244 m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM); 3245 return false; 3246 } 3247 3248 if (format != internalformat) { 3249 m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION); 3250 return false; 3251 } 3252 3253 if (border) { 3254 m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE); 3255 return false; 3256 } 3257 3258 return validateTexFuncFormatAndType(format, type); 3259 } 3260 3100 3261 } // namespace WebCore 3101 3262 -
trunk/WebCore/html/canvas/WebGLRenderingContext.h
r59499 r60874 354 354 RefPtr<WebGLTexture> m_textureCubeMapBinding; 355 355 }; 356 TextureUnitState m_textureUnits[32];356 Vector<TextureUnitState> m_textureUnits; 357 357 unsigned long m_activeTextureUnit; 358 358 359 359 RefPtr<WebGLTexture> m_blackTexture2D; 360 360 RefPtr<WebGLTexture> m_blackTextureCubeMap; 361 362 long m_maxTextureSize; 363 long m_maxCubeMapTextureSize; 361 364 362 365 int m_packAlignment; … … 390 393 void createFallbackBlackTextures1x1(); 391 394 395 // Helper function for copyTex{Sub}Image, check whether the internalformat 396 // and the color buffer format of the current bound framebuffer combination 397 // is valid. 398 bool isTexInternalformatColorBufferCombinationValid(unsigned long texInternalformat, 399 unsigned long colorBufferFormat); 400 401 // Helper function to get the current bound texture. 402 WebGLTexture* getTextureBinding(unsigned long target); 403 404 // Helper function to check input format/type for functions {copy}Tex{Sub}Image. 405 // Generate GL error and return false if parameters are invalid. 406 bool validateTexFuncFormatAndType(unsigned long format, unsigned long type); 407 408 // Helper function to check input parameters for functions {copy}Tex{Sub}Image. 409 // Generate GL error and return false if parameters are invalid. 410 bool validateTexFuncParameters(unsigned long target, long level, 411 unsigned long internalformat, 412 long width, long height, long border, 413 unsigned long format, unsigned long type); 414 415 // Helper function for texParameterf and texParameteri. 416 void texParameter(unsigned long target, unsigned long pname, float parami, int paramf, bool isFloat); 417 392 418 friend class WebGLStateRestorer; 393 419 }; -
trunk/WebCore/html/canvas/WebGLTexture.cpp
r59470 r60874 46 46 , m_wrapS(GraphicsContext3D::REPEAT) 47 47 , m_wrapT(GraphicsContext3D::REPEAT) 48 , m_internalformat(0) 48 49 , m_isNPOT(false) 49 50 , m_needToUseBlackTexture(false) -
trunk/WebCore/html/canvas/WebGLTexture.h
r59470 r60874 53 53 void setSize(unsigned long target, unsigned width, unsigned height); 54 54 55 void setInternalformat(unsigned long internalformat) { m_internalformat = internalformat; } 56 unsigned long getInternalformat() const { return m_internalformat; } 57 55 58 static bool isNPOT(unsigned, unsigned); 56 59 … … 78 81 int m_wrapT; 79 82 83 unsigned long m_internalformat; 84 80 85 unsigned m_width[6]; 81 86 unsigned m_height[6]; -
trunk/WebCore/platform/graphics/GraphicsContext3D.cpp
r55283 r60874 55 55 flipY, 56 56 alphaOp); 57 *internalFormat = (hasAlphaChannel ? RGBA : RGB); 57 // For GLES2 tex functions, internalformat has to match format. 58 *internalFormat = *format; 58 59 return true; 59 60 }
Note: See TracChangeset
for help on using the changeset viewer.