framebuffer binding should not be changed after canvas resize or compositing
authorzmo@google.com <zmo@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Apr 2012 19:31:22 +0000 (19:31 +0000)
committerzmo@google.com <zmo@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Apr 2012 19:31:22 +0000 (19:31 +0000)
commitd005fad082cc321af6e2b609218d43988f6d71aa
treed2456aeacd525d51a0bbd5aa5e9c016161ed42c8
parent4ec552315ebfc0640b43c60190d8d8b0ffd4d6cb
framebuffer binding should not be changed after canvas resize or compositing
https://bugs.webkit.org/show_bug.cgi?id=84609

Reviewed by Kenneth Russell.

Source/WebCore:

Test: fast/canvas/webgl/framebuffer-bindings-unaffected-on-resize.html

* html/canvas/WebGLRenderingContext.cpp: set framebuffer binding to DrawingBuffer.
(WebCore):
(WebCore::WebGLRenderingContext::bindFramebuffer):
(WebCore::WebGLRenderingContext::deleteFramebuffer):
(WebCore::WebGLRenderingContext::loseContextImpl):
* platform/graphics/cairo/DrawingBufferCairo.cpp: initialize m_framebufferBinding.
(WebCore::DrawingBuffer::DrawingBuffer):
* platform/graphics/chromium/DrawingBufferChromium.cpp: Ditto.
(WebCore::DrawingBuffer::DrawingBuffer):
* platform/graphics/chromium/WebGLLayerChromium.cpp: Recover framebuffer binding after update().
(WebCore::WebGLLayerChromium::update):
* platform/graphics/gpu/DrawingBuffer.cpp: Add a function to restore framebuffer binding.
(WebCore::DrawingBuffer::restoreFramebufferBinding):
(WebCore):
* platform/graphics/gpu/DrawingBuffer.h: Ditto.
(WebCore::DrawingBuffer::setTexture2DBinding):
(DrawingBuffer):
(WebCore::DrawingBuffer::setFramebufferBinding):
* platform/graphics/gpu/mac/DrawingBufferMac.mm: initialize m_framebufferBinding.
(WebCore::DrawingBuffer::DrawingBuffer):
* platform/graphics/gpu/qt/DrawingBufferQt.cpp: initialize m_framebufferBinding.
(WebCore::DrawingBuffer::DrawingBuffer):

LayoutTests:

* fast/canvas/webgl/framebuffer-bindings-unaffected-on-resize-expected.txt: Added.
* fast/canvas/webgl/framebuffer-bindings-unaffected-on-resize.html: Added.
* fast/canvas/webgl/resources/webgl-test-utils.js: Sync with khronos side (partial)
(WebGLTestUtils.):
(WebGLTestUtils):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@114929 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/canvas/webgl/framebuffer-bindings-unaffected-on-resize-expected.txt [new file with mode: 0644]
LayoutTests/fast/canvas/webgl/framebuffer-bindings-unaffected-on-resize.html [new file with mode: 0644]
LayoutTests/fast/canvas/webgl/resources/webgl-test-utils.js
Source/WebCore/ChangeLog
Source/WebCore/html/canvas/WebGLRenderingContext.cpp
Source/WebCore/platform/graphics/cairo/DrawingBufferCairo.cpp
Source/WebCore/platform/graphics/chromium/DrawingBufferChromium.cpp
Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp
Source/WebCore/platform/graphics/gpu/DrawingBuffer.cpp
Source/WebCore/platform/graphics/gpu/DrawingBuffer.h
Source/WebCore/platform/graphics/gpu/mac/DrawingBufferMac.mm
Source/WebCore/platform/graphics/gpu/qt/DrawingBufferQt.cpp