Changeset 158798 in webkit
- Timestamp:
- Nov 6, 2013, 3:08:56 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r158796 r158798 1 2013-11-06 Brent Fulgham <bfulgham@apple.com> 2 3 [WebGL] We should not allow generateMipMap on compressed textures 4 https://bugs.webkit.org/show_bug.cgi?id=123915 5 <rdar://problem/15201274> 6 7 Reviewed by Dean Jackson. 8 9 Found by existing conformance/extensions/webgl-compressed-texture-s3tc.html 10 11 * html/canvas/WebGLRenderingContext.cpp: 12 (WebCore::WebGLRenderingContext::compressedTexImage2D): Set compressed flag. 13 (WebCore::WebGLRenderingContext::compressedTexSubImage2D): Ditto. 14 (WebCore::WebGLRenderingContext::generateMipmap): For Apple builds, check state 15 of compressed flag and generate appropriate WebGL error if necessary. 16 * html/canvas/WebGLTexture.cpp: 17 (WebCore::WebGLTexture::WebGLTexture): Set compressed flag to false by default 18 (WebCore::WebGLTexture::isCompressed): Added 19 (WebCore::WebGLTexture::setCompressed): Added 20 * html/canvas/WebGLTexture.h: 21 * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: 22 (WebCore::GraphicsContext3D::generateMipmap): Switch implementation to use proper 23 glGenerateMipmaps, rather than the glGenerateMipmapsEXT method. 24 1 25 2013-11-06 Joseph Pecoraro <pecoraro@apple.com> 2 26 -
trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp
r157971 r158798 1341 1341 border, data->byteLength(), data->baseAddress()); 1342 1342 tex->setLevelInfo(target, level, internalformat, width, height, GraphicsContext3D::UNSIGNED_BYTE); 1343 tex->setCompressed(); 1343 1344 cleanupAfterGraphicsCall(false); 1344 1345 } … … 1372 1373 graphicsContext3D()->compressedTexSubImage2D(target, level, xoffset, yoffset, 1373 1374 width, height, format, data->byteLength(), data->baseAddress()); 1375 tex->setCompressed(); 1374 1376 cleanupAfterGraphicsCall(false); 1375 1377 } … … 2221 2223 if (!tex->canGenerateMipmaps()) { 2222 2224 synthesizeGLError(GraphicsContext3D::INVALID_OPERATION, "generateMipmap", "level 0 not power of 2 or not all the same size"); 2225 return; 2226 } 2227 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=123916. Compressed textures should be allowed in WebGL 2: 2228 if (tex->isCompressed()) { 2229 synthesizeGLError(GraphicsContext3D::INVALID_OPERATION, "generateMipmap", "trying to generate mipmaps from compressed texture"); 2223 2230 return; 2224 2231 } -
trunk/Source/WebCore/html/canvas/WebGLTexture.cpp
r145669 r158798 51 51 , m_isComplete(false) 52 52 , m_needToUseBlackTexture(false) 53 , m_isCompressed(false) 53 54 { 54 55 setObject(ctx->graphicsContext3D()->createTexture()); … … 240 241 } 241 242 243 bool WebGLTexture::isCompressed() const 244 { 245 if (!object()) 246 return false; 247 return m_isCompressed; 248 } 249 250 void WebGLTexture::setCompressed() 251 { 252 ASSERT(object()); 253 m_isCompressed = true; 254 } 255 242 256 void WebGLTexture::deleteObjectImpl(GraphicsContext3D* context3d, Platform3DObject object) 243 257 { -
trunk/Source/WebCore/html/canvas/WebGLTexture.h
r157653 r158798 67 67 bool needToUseBlackTexture() const; 68 68 69 bool isCompressed() const; 70 void setCompressed(); 71 69 72 bool hasEverBeenBound() const { return object() && m_target; } 70 73 … … 124 127 bool m_isComplete; 125 128 bool m_needToUseBlackTexture; 129 bool m_isCompressed; 126 130 }; 127 131 -
trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
r156795 r158798 666 666 { 667 667 makeContextCurrent(); 668 ::glGenerateMipmap EXT(target);668 ::glGenerateMipmap(target); 669 669 } 670 670
Note:
See TracChangeset
for help on using the changeset viewer.