Changeset 89393 in webkit
- Timestamp:
- Jun 21, 2011, 4:46:49 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r89391 r89393 1 2011-06-21 Zhenyao Mo <zmo@google.com> 2 3 Reviewed by Kenneth Russell. 4 5 Implement drawingBufferWidth/drawingBufferHeight in WebGL 6 https://bugs.webkit.org/show_bug.cgi?id=58497 7 8 * fast/canvas/webgl/webgl-specific-expected.txt: 9 * fast/canvas/webgl/webgl-specific.html: Test drawingBufferWidth/Height attributes. 10 * fast/canvas/webgl/canvas-zero-size-expected.txt: 11 * fast/canvas/webgl/canvas-zero-size.html: Added. 12 * fast/canvas/webgl/drawingbuffer-test-expected.txt: 13 * fast/canvas/webgl/drawingbuffer-test.html: Added. 14 1 15 2011-06-21 Dmitry Titov <dimich@chromium.org> 2 16 -
trunk/LayoutTests/fast/canvas/webgl/webgl-specific-expected.txt
r74820 r89393 48 48 PASS undefined is undefined. 49 49 50 Verify that *LENGTH are undefined 51 PASS undefined is undefined. 52 PASS undefined is undefined. 53 PASS undefined is undefined. 54 PASS undefined is undefined. 55 50 56 Verify that UNPACK_COLORSPACE_CONVERSION_WEBGL is supported 51 57 PASS gl.getParameter(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL) is gl.BROWSER_DEFAULT_WEBGL 52 58 PASS gl.getParameter(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL) is gl.NONE 53 59 PASS getError was expected value: NO_ERROR : set/get UNPACK_COLORSPACE_CONVERSION_WEBGL should generate no error 60 61 Verify that drawingBufferWidth and drawingBufferHeights are implemented 62 PASS gl.drawingBufferWidth >= 0 && gl.drawingBufferHeight >= 0 is true 54 63 PASS successfullyParsed is true 55 64 -
trunk/LayoutTests/fast/canvas/webgl/webgl-specific.html
r74820 r89393 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 2 "http://www.w3.org/TR/html4/loose.dtd"> 1 <!DOCTYPE html> 3 2 <html> 4 3 <head> 4 <meta charset="utf-8"> 5 5 <title>WebGL GLES2 difference test.</title> 6 6 <link rel="stylesheet" href="../../js/resources/js-test-style.css"/> … … 75 75 76 76 debug(""); 77 debug("Verify that *LENGTH are undefined"); 78 shouldBeUndefined(gl.INFO_LOG_LENGTH); 79 shouldBeUndefined(gl.SHADER_SOURCE_LENGTH); 80 shouldBeUndefined(gl.ACTIVE_UNIFORM_MAX_LENGTH); 81 shouldBeUndefined(gl.ACTIVE_ATTRIB_MAX_LENGTH); 82 83 debug(""); 77 84 debug("Verify that UNPACK_COLORSPACE_CONVERSION_WEBGL is supported"); 78 85 shouldBe("gl.getParameter(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL)", "gl.BROWSER_DEFAULT_WEBGL"); … … 80 87 shouldBe("gl.getParameter(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL)", "gl.NONE"); 81 88 glErrorShouldBe(gl, gl.NO_ERROR, "set/get UNPACK_COLORSPACE_CONVERSION_WEBGL should generate no error"); 89 90 debug(""); 91 debug("Verify that drawingBufferWidth and drawingBufferHeights are implemented"); 92 shouldBeTrue("gl.drawingBufferWidth >= 0 && gl.drawingBufferHeight >= 0"); 82 93 83 94 successfullyParsed = true; -
trunk/Source/WebCore/ChangeLog
r89390 r89393 1 2011-06-21 Zhenyao Mo <zmo@google.com> 2 3 Reviewed by Kenneth Russell. 4 5 Implement drawingBufferWidth/drawingBufferHeight in WebGL 6 https://bugs.webkit.org/show_bug.cgi?id=58497 7 8 * html/canvas/WebGLRenderingContext.cpp: Add drawingBufferWidth/Height method and call getInternalFramebufferSize(). 9 (WebCore::WebGLRenderingContext::drawingBufferWidth): 10 (WebCore::WebGLRenderingContext::drawingBufferHeight): 11 * html/canvas/WebGLRenderingContext.h: 12 * html/canvas/WebGLRenderingContext.idl: Add readonly attributes drawingBufferWidth/Height. 13 * platform/graphics/GraphicsContext3D.h: 14 * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp: Make getInternalFramebufferSize const. 15 (WebCore::GraphicsContext3D::getInternalFramebufferSize): 16 * platform/graphics/qt/GraphicsContext3DQt.cpp: Ditto. 17 (WebCore::GraphicsContext3D::getInternalFramebufferSize): 18 1 19 2011-06-21 Dmitry Lomov <dslomov@google.com> 2 20 -
trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp
r88489 r89393 110 110 } 111 111 112 GC3Dint clamp(GC3Dint value, GC3Dint min, GC3Dint max) 113 { 114 if (value < min) 115 value = min; 116 if (value > max) 117 value = max; 118 return value; 119 } 120 112 121 // Return true if a character belongs to the ASCII subset as defined in 113 122 // GLSL ES 1.0 spec section 3.1. … … 440 449 m_context->getIntegerv(GraphicsContext3D::MAX_CUBE_MAP_TEXTURE_SIZE, &m_maxCubeMapTextureSize); 441 450 m_maxCubeMapTextureLevel = WebGLTexture::computeLevelCount(m_maxCubeMapTextureSize, m_maxCubeMapTextureSize); 442 451 m_maxRenderbufferSize = 0; 452 m_context->getIntegerv(GraphicsContext3D::MAX_RENDERBUFFER_SIZE, &m_maxRenderbufferSize); 453 m_maxViewportDims[0] = m_maxViewportDims[1] = 0; 454 m_context->getIntegerv(GraphicsContext3D::MAX_VIEWPORT_DIMS, m_maxViewportDims); 455 443 456 m_defaultVertexArrayObject = WebGLVertexArrayObjectOES::create(this, WebGLVertexArrayObjectOES::VaoTypeDefault); 444 457 addObject(m_defaultVertexArrayObject.get()); … … 594 607 void WebGLRenderingContext::reshape(int width, int height) 595 608 { 609 // This is an approximation because at WebGLRenderingContext level we don't 610 // know if the underlying FBO uses textures or renderbuffers. 611 GC3Dint maxSize = std::min(m_maxTextureSize, m_maxRenderbufferSize); 612 GC3Dint maxWidth = std::min(maxSize, m_maxViewportDims[0]); 613 GC3Dint maxHeight = std::min(maxSize, m_maxViewportDims[1]); 614 width = clamp(width, 1, maxWidth); 615 height = clamp(height, 1, maxHeight); 616 596 617 if (m_needsUpdate) { 597 618 #if USE(ACCELERATED_COMPOSITING) … … 606 627 // clear (and this matches what reshape will do). 607 628 m_context->reshape(width, height); 629 } 630 631 int WebGLRenderingContext::drawingBufferWidth() const 632 { 633 return m_context->getInternalFramebufferSize().width(); 634 } 635 636 int WebGLRenderingContext::drawingBufferHeight() const 637 { 638 return m_context->getInternalFramebufferSize().height(); 608 639 } 609 640 -
trunk/Source/WebCore/html/canvas/WebGLRenderingContext.h
r88489 r89393 71 71 virtual bool isAccelerated() const { return true; } 72 72 virtual bool paintsIntoCanvasBuffer() const; 73 74 int drawingBufferWidth() const; 75 int drawingBufferHeight() const; 73 76 74 77 void activeTexture(GC3Denum texture, ExceptionCode&); … … 431 434 GC3Dint m_maxTextureSize; 432 435 GC3Dint m_maxCubeMapTextureSize; 436 GC3Dint m_maxRenderbufferSize; 437 GC3Dint m_maxViewportDims[2]; 433 438 GC3Dint m_maxTextureLevel; 434 439 GC3Dint m_maxCubeMapTextureLevel; -
trunk/Source/WebCore/html/canvas/WebGLRenderingContext.idl
r89148 r89393 452 452 const unsigned int BROWSER_DEFAULT_WEBGL = 0x9244; 453 453 454 readonly attribute long drawingBufferWidth; 455 readonly attribute long drawingBufferHeight; 456 454 457 [StrictTypeChecking] void activeTexture(in unsigned long texture) raises(DOMException); 455 458 [StrictTypeChecking] void attachShader(in WebGLProgram program, in WebGLShader shader) raises(DOMException); -
trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h
r87353 r89393 821 821 Extensions3D* getExtensions(); 822 822 823 IntSize getInternalFramebufferSize() ;823 IntSize getInternalFramebufferSize() const; 824 824 825 825 private: -
trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
r82878 r89393 318 318 } 319 319 320 IntSize GraphicsContext3D::getInternalFramebufferSize() 320 IntSize GraphicsContext3D::getInternalFramebufferSize() const 321 321 { 322 322 return IntSize(m_currentWidth, m_currentHeight); -
trunk/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
r88335 r89393 751 751 } 752 752 753 IntSize GraphicsContext3D::getInternalFramebufferSize() 753 IntSize GraphicsContext3D::getInternalFramebufferSize() const 754 754 { 755 755 return IntSize(m_currentWidth, m_currentHeight); -
trunk/Source/WebKit/chromium/ChangeLog
r89390 r89393 1 2011-06-21 Zhenyao Mo <zmo@google.com> 2 3 Reviewed by Kenneth Russell. 4 5 Implement drawingBufferWidth/drawingBufferHeight in WebGL 6 https://bugs.webkit.org/show_bug.cgi?id=58497 7 8 * src/GraphicsContext3DChromium.cpp: Make getInternalFramebufferSize method const. 9 (WebCore::GraphicsContext3DInternal::getInternalFramebufferSize): 10 (WebCore::GraphicsContext3D::getInternalFramebufferSize): 11 * src/GraphicsContext3DInternal.h: 12 1 13 2011-06-21 Dmitry Lomov <dslomov@google.com> 2 14 -
trunk/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp
r88429 r89393 288 288 } 289 289 290 IntSize GraphicsContext3DInternal::getInternalFramebufferSize() 290 IntSize GraphicsContext3DInternal::getInternalFramebufferSize() const 291 291 { 292 292 return IntSize(m_impl->width(), m_impl->height()); … … 968 968 } 969 969 970 IntSize GraphicsContext3D::getInternalFramebufferSize() const 971 { 972 return m_internal->getInternalFramebufferSize(); 973 } 974 970 975 #if USE(ACCELERATED_COMPOSITING) 971 976 PlatformLayer* GraphicsContext3D::platformLayer() const … … 979 984 DELEGATE_TO_INTERNAL(makeContextCurrent) 980 985 DELEGATE_TO_INTERNAL_2(reshape, int, int) 981 DELEGATE_TO_INTERNAL_R(getInternalFramebufferSize, IntSize)982 986 983 987 DELEGATE_TO_INTERNAL_1(activeTexture, GC3Denum) -
trunk/Source/WebKit/chromium/src/GraphicsContext3DInternal.h
r86278 r89393 67 67 68 68 void reshape(int width, int height); 69 IntSize getInternalFramebufferSize() ;69 IntSize getInternalFramebufferSize() const; 70 70 71 71 void markContextChanged();
Note:
See TracChangeset
for help on using the changeset viewer.