Unreviewed, rolling out r114929.
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Apr 2012 20:12:20 +0000 (20:12 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Apr 2012 20:12:20 +0000 (20:12 +0000)
http://trac.webkit.org/changeset/114929
https://bugs.webkit.org/show_bug.cgi?id=84623

Broke 35 canvas/webgl tests (Requested by jernoble on
#webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-04-23

Source/WebCore:

* html/canvas/WebGLRenderingContext.cpp:
(WebCore):
(WebCore::WebGLRenderingContext::bindFramebuffer):
(WebCore::WebGLRenderingContext::deleteFramebuffer):
(WebCore::WebGLRenderingContext::loseContextImpl):
* platform/graphics/cairo/DrawingBufferCairo.cpp:
(WebCore::DrawingBuffer::DrawingBuffer):
* platform/graphics/chromium/DrawingBufferChromium.cpp:
(WebCore::DrawingBuffer::DrawingBuffer):
* platform/graphics/chromium/WebGLLayerChromium.cpp:
(WebCore::WebGLLayerChromium::update):
* platform/graphics/gpu/DrawingBuffer.cpp:
* platform/graphics/gpu/DrawingBuffer.h:
(WebCore::DrawingBuffer::setTexture2DBinding):
(DrawingBuffer):
* platform/graphics/gpu/mac/DrawingBufferMac.mm:
(WebCore::DrawingBuffer::DrawingBuffer):
* platform/graphics/gpu/qt/DrawingBufferQt.cpp:
(WebCore::DrawingBuffer::DrawingBuffer):

LayoutTests:

* fast/canvas/webgl/framebuffer-bindings-unaffected-on-resize-expected.txt: Removed.
* fast/canvas/webgl/framebuffer-bindings-unaffected-on-resize.html: Removed.
* fast/canvas/webgl/resources/webgl-test-utils.js:
(WebGLTestUtils):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@114935 268f45cc-cd09-0410-ab3c-d52691b4dbfc

13 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/canvas/webgl/framebuffer-bindings-unaffected-on-resize-expected.txt [deleted file]
LayoutTests/fast/canvas/webgl/framebuffer-bindings-unaffected-on-resize.html [deleted file]
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

index 56aa52f..55545f5 100644 (file)
@@ -1,3 +1,17 @@
+2012-04-23  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r114929.
+        http://trac.webkit.org/changeset/114929
+        https://bugs.webkit.org/show_bug.cgi?id=84623
+
+        Broke 35 canvas/webgl tests (Requested by jernoble on
+        #webkit).
+
+        * fast/canvas/webgl/framebuffer-bindings-unaffected-on-resize-expected.txt: Removed.
+        * fast/canvas/webgl/framebuffer-bindings-unaffected-on-resize.html: Removed.
+        * fast/canvas/webgl/resources/webgl-test-utils.js:
+        (WebGLTestUtils):
+
 2012-04-23  Zhenyao Mo  <zmo@google.com>
 
         framebuffer binding should not be changed after canvas resize or compositing
diff --git a/LayoutTests/fast/canvas/webgl/framebuffer-bindings-unaffected-on-resize-expected.txt b/LayoutTests/fast/canvas/webgl/framebuffer-bindings-unaffected-on-resize-expected.txt
deleted file mode 100644 (file)
index 45278b2..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-Verifies that GL framebuffer bindings do not change when canvas is resized
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-PASS fboSize < canvas.width is true
-PASS gl.checkFramebufferStatus(gl.FRAMEBUFFER) is gl.FRAMEBUFFER_COMPLETE
-test before resizing canvas
-PASS should be blue
-PASS area outside fbo should be transparent black
-PASS should be green
-PASS area outside fbo should be transparent black
-test after resizing canvas
-PASS should be blue
-PASS area outside fbo should be transparent black
-PASS should be green
-PASS area outside fbo should be transparent black
-test after resizing canvas and waiting for compositing
-PASS should be blue
-PASS area outside fbo should be transparent black
-PASS should be green
-PASS area outside fbo should be transparent black
-PASS getError was expected value: NO_ERROR : Should be no errors.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/fast/canvas/webgl/framebuffer-bindings-unaffected-on-resize.html b/LayoutTests/fast/canvas/webgl/framebuffer-bindings-unaffected-on-resize.html
deleted file mode 100644 (file)
index 86c2ab8..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8">
-<title>Verifies that GL framebuffer bindings do not change when canvas is resized</title>
-<link rel="stylesheet" href="../../js/resources/js-test-style.css"/>
-<script src="../../js/resources/js-test-pre.js"></script>
-<script src="resources/webgl-test.js"></script>
-<script src="resources/webgl-test-utils.js"></script>
-</head>
-<body>
-<canvas id="example" width="4px" height="4px"></canvas>
-<div id="description"></div>
-<div id="console"></div>
-<script>
-description("Verifies that GL framebuffer bindings do not change when canvas is resized");
-
-if (window.initNonKhronosFramework) {
-  window.initNonKhronosFramework(true);
-}
-
-var err;
-var wtu = WebGLTestUtils;
-var canvas = document.getElementById("example");
-var gl = wtu.create3DContext(canvas);
-var green = [0, 255, 0, 255];
-var blue = [0, 0, 255, 255];
-var fboSize = 2;
-shouldBeTrue("fboSize < canvas.width");
-var fbo = gl.createFramebuffer();
-gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
-var fboTex = gl.createTexture();
-gl.activeTexture(gl.TEXTURE1);
-gl.bindTexture(gl.TEXTURE_2D, fboTex);
-gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, fboTex, 0);
-gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, fboSize, fboSize, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
-gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
-gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
-gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
-gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
-shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
-
-function checkFBO(color, msg) {
-  wtu.checkCanvasRect(gl, 0, 0, fboSize, fboSize, color, msg);
-  wtu.checkCanvasRect(gl, fboSize, fboSize, fboSize, fboSize, [0, 0, 0, 0], "area outside fbo should be transparent black");
-}
-
-// The FBO is 2x2 and it's bound so clearing should clear a 2x2 area
-// and calling read pixels should read the clear color in that 2x2 area
-// and 0,0,0,0 outside that area.
-//
-// If the FBO is no longer bound because of a WebGL implementation error
-// then likely the clear will clear the backbuffer and reading outside
-// the 2x2 area will not be 0,0,0,0
-
-function test() {
-  gl.clearColor(0, 0, 1, 1);
-  gl.clear(gl.COLOR_BUFFER_BIT);
-  checkFBO(blue, "should be blue");
-  gl.clearColor(0, 1, 0, 1);
-  gl.clear(gl.COLOR_BUFFER_BIT);
-  checkFBO(green, "should be green");
-}
-
-debug("test before resizing canvas");
-test();
-debug("test after resizing canvas");
-canvas.width = 8;
-test();
-debug("test after resizing canvas and waiting for compositing");
-canvas.width = 16;
-wtu.waitFrames(5, function() {
-  test();
-  finishTest();
-  glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors.");
-});
-
-successfullyParsed = true;
-</script>
-</body>
-</html>
-
index b9c03e5..9a0929f 100644 (file)
@@ -1104,66 +1104,7 @@ var getUrlArguments = function() {
   return args;
 };
 
-/**
- * Provides requestAnimationFrame in a cross browser way.
- */
-var requestAnimFrameImpl_;
-
-var requestAnimFrame = function(callback, element) {
-  if (!requestAnimFrameImpl_) {
-    requestAnimFrameImpl_ = function() {
-      var functionNames = [
-        "requestAnimationFrame",
-        "webkitRequestAnimationFrame",
-        "mozRequestAnimationFrame",
-        "oRequestAnimationFrame",
-        "msRequestAnimationFrame"
-      ];
-      for (var jj = 0; jj < functionNames.length; ++jj) {
-        var functionName = functionNames[jj];
-        if (window[functionName]) {
-          return function(name) {
-            return function(callback, element) {
-              return window[name].call(window, callback, element);
-            };
-          }(functionName);
-        }
-      }
-      return function(callback, element) {
-           return window.setTimeout(callback, 1000 / 70);
-        };
-    }();
-  }
-
-  return requestAnimFrameImpl_(callback, element);
-};
-
-/**
- * Provides cancelAnimationFrame in a cross browser way.
- */
-var cancelRequestAnimFrame = (function() {
-  return window.cancelAnimationFrame ||
-         window.webkitCancelAnimationFrame ||
-         window.mozCancelAnimationFrame ||
-         window.oCancelAnimationFrame ||
-         window.msCancelAnimationFrame ||
-         window.clearTimeout;
-})();
-
-var waitFrames = function(frames, callback) {
-  var countDown = function() {
-    if (frames == 0) {
-      callback();
-    } else {
-      --frames;
-      requestAnimFrame(countDown);
-    }
-  };
-  countDown();
-};
-
 return {
-  cancelAnimFrame: cancelAnimFrame,
   create3DContext: create3DContext,
   create3DContextWithWrapperThatThrowsOnGLError:
     create3DContextWithWrapperThatThrowsOnGLError,
@@ -1206,8 +1147,6 @@ return {
   shouldGenerateGLError: shouldGenerateGLError,
   readFile: readFile,
   readFileList: readFileList,
-  requestAnimFrame: requestAnimFrame,
-  waitFrames: waitFrames,
 
   none: false
 };
index c3b8645..54d0b91 100644 (file)
@@ -1,3 +1,32 @@
+2012-04-23  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r114929.
+        http://trac.webkit.org/changeset/114929
+        https://bugs.webkit.org/show_bug.cgi?id=84623
+
+        Broke 35 canvas/webgl tests (Requested by jernoble on
+        #webkit).
+
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore):
+        (WebCore::WebGLRenderingContext::bindFramebuffer):
+        (WebCore::WebGLRenderingContext::deleteFramebuffer):
+        (WebCore::WebGLRenderingContext::loseContextImpl):
+        * platform/graphics/cairo/DrawingBufferCairo.cpp:
+        (WebCore::DrawingBuffer::DrawingBuffer):
+        * platform/graphics/chromium/DrawingBufferChromium.cpp:
+        (WebCore::DrawingBuffer::DrawingBuffer):
+        * platform/graphics/chromium/WebGLLayerChromium.cpp:
+        (WebCore::WebGLLayerChromium::update):
+        * platform/graphics/gpu/DrawingBuffer.cpp:
+        * platform/graphics/gpu/DrawingBuffer.h:
+        (WebCore::DrawingBuffer::setTexture2DBinding):
+        (DrawingBuffer):
+        * platform/graphics/gpu/mac/DrawingBufferMac.mm:
+        (WebCore::DrawingBuffer::DrawingBuffer):
+        * platform/graphics/gpu/qt/DrawingBufferQt.cpp:
+        (WebCore::DrawingBuffer::DrawingBuffer):
+
 2012-04-23  Kentaro Hara  <haraken@chromium.org>
 
         [V8] Pass Isolate around in V8Collection.h
index 044e9c3..07a3dd7 100644 (file)
@@ -920,8 +920,6 @@ void WebGLRenderingContext::bindFramebuffer(GC3Denum target, WebGLFramebuffer* b
         return;
     }
     m_framebufferBinding = buffer;
-    if (m_drawingBuffer)
-        m_drawingBuffer->setFramebufferBinding(objectOrZero(m_framebufferBinding.get()));
     if (!m_framebufferBinding && m_drawingBuffer) {
         // Instead of binding fb 0, bind the drawing buffer.
         m_drawingBuffer->bind();
@@ -1535,11 +1533,10 @@ void WebGLRenderingContext::deleteFramebuffer(WebGLFramebuffer* framebuffer)
         return;
     if (framebuffer == m_framebufferBinding) {
         m_framebufferBinding = 0;
-        if (m_drawingBuffer) {
-            m_drawingBuffer->setFramebufferBinding(0);
-            // Have to call bindFramebuffer here to bind back to internal fbo.
+        // Have to call bindFramebuffer here to bind back to internal fbo.
+        if (m_drawingBuffer)
             m_drawingBuffer->bind();
-        else
+        else
             m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, 0);
     }
 }
@@ -4310,9 +4307,8 @@ void WebGLRenderingContext::loseContextImpl(WebGLRenderingContext::LostContextMo
     detachAndRemoveAllObjects();
 
     if (m_drawingBuffer) {
-        // Make absolutely sure we do not refer to an already-deleted texture or framebuffer.
+        // Make absolutely sure we do not refer to an already-deleted texture.
         m_drawingBuffer->setTexture2DBinding(0);
-        m_drawingBuffer->setFramebufferBinding(0);
     }
 
     // There is no direct way to clear errors from a GL implementation and
index 114c7e1..ec1270d 100644 (file)
@@ -43,7 +43,6 @@ DrawingBuffer::DrawingBuffer(GraphicsContext3D* context,
     , m_alpha(alpha)
     , m_scissorEnabled(false)
     , m_texture2DBinding(0)
-    , m_framebufferBinding(0)
     , m_activeTextureUnit(GraphicsContext3D::TEXTURE0)
     , m_context(context)
     , m_size(-1, -1)
index 92956cf..4cd8942 100644 (file)
@@ -69,7 +69,6 @@ DrawingBuffer::DrawingBuffer(GraphicsContext3D* context,
     , m_alpha(alpha)
     , m_scissorEnabled(false)
     , m_texture2DBinding(0)
-    , m_framebufferBinding(0)
     , m_activeTextureUnit(GraphicsContext3D::TEXTURE0)
     , m_context(context)
     , m_size(-1, -1)
index a8457dd..2cf9e38 100644 (file)
@@ -86,8 +86,6 @@ void WebGLLayerChromium::update(CCTextureUpdater& updater, const CCOcclusionTrac
     m_textureId = m_drawingBuffer->frontColorBuffer();
     if (m_drawingBuffer->requiresCopyFromBackToFrontBuffer())
         updater.appendCopy(m_drawingBuffer->colorBuffer(), m_textureId, bounds());
-
-    m_drawingBuffer->restoreFramebufferBinding();
 }
 
 void WebGLLayerChromium::pushPropertiesTo(CCLayerImpl* layer)
index c58c3c6..c915f75 100644 (file)
@@ -336,14 +336,6 @@ void DrawingBuffer::commit(long x, long y, long width, long height)
     m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_fbo);
 }
 
-void DrawingBuffer::restoreFramebufferBinding()
-{
-    if (!m_context || !m_framebufferBinding)
-        return;
-
-    m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_framebufferBinding);
-}
-
 bool DrawingBuffer::multisample() const
 {
     return m_context && m_context->getContextAttributes().antialias && m_multisampleExtensionSupported;
index 3ec6357..95ea90f 100644 (file)
@@ -99,14 +99,7 @@ public:
 
     // The DrawingBuffer needs to track the texture bound to texture unit 0.
     // The bound texture is tracked to avoid costly queries during rendering.
-    void setTexture2DBinding(Platform3DObject texture) { m_texture2DBinding = texture; }
-
-    // The DrawingBuffer needs to track the currently bound framebuffer so it
-    // restore the binding when needed.
-    void setFramebufferBinding(Platform3DObject fbo) { m_framebufferBinding = fbo; }
-
-    // Bind to the m_framebufferBinding if it's not 0.
-    void restoreFramebufferBinding();
+    void setTexture2DBinding(GC3Dint texture) { m_texture2DBinding = texture; }
 
     // Track the currently active texture unit. Texture unit 0 is used as host for a scratch
     // texture.
@@ -142,7 +135,6 @@ private:
     AlphaRequirement m_alpha;
     bool m_scissorEnabled;
     Platform3DObject m_texture2DBinding;
-    Platform3DObject m_framebufferBinding;
     GC3Denum m_activeTextureUnit;
 
     RefPtr<GraphicsContext3D> m_context;
index 5154fd7..db288d7 100644 (file)
@@ -46,7 +46,6 @@ DrawingBuffer::DrawingBuffer(GraphicsContext3D* context,
     , m_alpha(alpha)
     , m_scissorEnabled(false)
     , m_texture2DBinding(0)
-    , m_framebufferBinding(0)
     , m_activeTextureUnit(GraphicsContext3D::TEXTURE0)
     , m_context(context)
     , m_size(-1, -1)
index 5eeac10..14cd562 100644 (file)
@@ -41,7 +41,6 @@ DrawingBuffer::DrawingBuffer(GraphicsContext3D* context,
     , m_alpha(alpha)
     , m_scissorEnabled(false)
     , m_texture2DBinding(0)
-    , m_framebufferBinding(0)
     , m_activeTextureUnit(GraphicsContext3D::TEXTURE0)
     , m_context(context)
     , m_size(-1, -1)