Unreviewed, rolling out r106376.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Jan 2012 22:58:23 +0000 (22:58 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Jan 2012 22:58:23 +0000 (22:58 +0000)
http://trac.webkit.org/changeset/106376
https://bugs.webkit.org/show_bug.cgi?id=77481

Broke WebGLLayerChromiumTest in webkit_unit_tests (Requested
by kbr_google on #webkit).

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

Source/WebCore:

* platform/graphics/gpu/DrawingBuffer.cpp:
(WebCore):
(WebCore::DrawingBuffer::reset):

LayoutTests:

* platform/chromium/test_expectations.txt:

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

LayoutTests/ChangeLog
LayoutTests/platform/chromium/test_expectations.txt
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/gpu/DrawingBuffer.cpp

index 5f7a462..929f69e 100644 (file)
@@ -1,3 +1,14 @@
+2012-01-31  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r106376.
+        http://trac.webkit.org/changeset/106376
+        https://bugs.webkit.org/show_bug.cgi?id=77481
+
+        Broke WebGLLayerChromiumTest in webkit_unit_tests (Requested
+        by kbr_google on #webkit).
+
+        * platform/chromium/test_expectations.txt:
+
 2012-01-31  David Grogan  <dgrogan@chromium.org>
 
         IndexedDB: refactor basics layout test so that it can be run on workers.
index 0eda12c..2f305ba 100644 (file)
@@ -3831,6 +3831,8 @@ BUGWK76558 : svg/dom/SVGScriptElement/script-load-and-error-events.svg = PASS TE
 
 BUGWK76580 : media/media-document-audio-repaint.html = IMAGE PASS
 
+BUGWK76562 : fast/canvas/webgl/drawingbuffer-test.html = TEXT
+
 // This test is passing, but it doesn't seem possible to add GPU+Leopard specific baselines.
 BUGJAMESR LEOPARD GPU : fast/canvas/quadraticCurveTo.xml = IMAGE
 
index f44375a..53168ee 100644 (file)
@@ -1,3 +1,16 @@
+2012-01-31  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r106376.
+        http://trac.webkit.org/changeset/106376
+        https://bugs.webkit.org/show_bug.cgi?id=77481
+
+        Broke WebGLLayerChromiumTest in webkit_unit_tests (Requested
+        by kbr_google on #webkit).
+
+        * platform/graphics/gpu/DrawingBuffer.cpp:
+        (WebCore):
+        (WebCore::DrawingBuffer::reset):
+
 2012-01-31  Mihnea Ovidenie  <mihnea@adobe.com>
 
         [CSSRegions]Reduce the cases when the box style in region is computed
index c2e8e04..9dd3b9d 100644 (file)
@@ -49,7 +49,6 @@ static int s_maximumResourceUsePixels = 16 * 1024 * 1024;
 static int s_maximumResourceUsePixels = 0;
 #endif
 static int s_currentResourceUsePixels = 0;
-static const float s_resourceAdjustedRatio = 0.5;
 
 PassRefPtr<DrawingBuffer> DrawingBuffer::create(GraphicsContext3D* context, const IntSize& size, bool separateBackingTexture)
 {
@@ -237,28 +236,19 @@ bool DrawingBuffer::reset(const IntSize& newSize)
     }
 
     int pixelDelta = newSize.width() * newSize.height();
-    int oldSize = 0;
-    if (!m_size.isEmpty()) {
-        oldSize = m_size.width() * m_size.height();
-        pixelDelta -= oldSize;
-    }
+    if (!m_size.isEmpty())
+        pixelDelta -= m_size.width() * m_size.height();
 
-    IntSize adjustedSize = newSize;
-    if (s_maximumResourceUsePixels) {
-        while ((s_currentResourceUsePixels + pixelDelta) > s_maximumResourceUsePixels) {
-            adjustedSize.scale(s_resourceAdjustedRatio);
-            if (adjustedSize.isEmpty()) {
-                clear();
-                return false;
-            }
-            pixelDelta = adjustedSize.width() * adjustedSize.height();
-            pixelDelta -= oldSize;
-        }
+    if (s_maximumResourceUsePixels && (s_currentResourceUsePixels + pixelDelta) > s_maximumResourceUsePixels) {
+        clear();
+        return false;
     }
+    s_currentResourceUsePixels += pixelDelta;
 
     const GraphicsContext3D::Attributes& attributes = m_context->getContextAttributes();
 
-    if (adjustedSize != m_size) {
+    if (newSize != m_size) {
+        m_size = newSize;
 
         unsigned internalColorFormat, colorFormat, internalRenderbufferFormat;
         if (attributes.alpha) {
@@ -271,57 +261,47 @@ bool DrawingBuffer::reset(const IntSize& newSize)
             internalRenderbufferFormat = Extensions3D::RGB8_OES;
         }
 
-        do {
-            m_size = adjustedSize;
 
-            // resize multisample FBO
-            if (multisample()) {
-                int maxSampleCount = 0;
+        // resize multisample FBO
+        if (multisample()) {
+            int maxSampleCount = 0;
+            
+            m_context->getIntegerv(Extensions3D::MAX_SAMPLES, &maxSampleCount);
+            int sampleCount = std::min(4, maxSampleCount);
 
-                m_context->getIntegerv(Extensions3D::MAX_SAMPLES, &maxSampleCount);
-                int sampleCount = std::min(4, maxSampleCount);
+            m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_multisampleFBO);
 
-                m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_multisampleFBO);
-
-                m_context->bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, m_multisampleColorBuffer);
-                m_context->getExtensions()->renderbufferStorageMultisample(GraphicsContext3D::RENDERBUFFER, sampleCount, internalRenderbufferFormat, m_size.width(), m_size.height());
-                m_context->framebufferRenderbuffer(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::RENDERBUFFER, m_multisampleColorBuffer);
-                resizeDepthStencil(sampleCount);
-                if (m_context->checkFramebufferStatus(GraphicsContext3D::FRAMEBUFFER) != GraphicsContext3D::FRAMEBUFFER_COMPLETE) {
-                    adjustedSize.scale(s_resourceAdjustedRatio);
-                    continue;
-                }
+            m_context->bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, m_multisampleColorBuffer);
+            m_context->getExtensions()->renderbufferStorageMultisample(GraphicsContext3D::RENDERBUFFER, sampleCount, internalRenderbufferFormat, m_size.width(), m_size.height());
+            m_context->framebufferRenderbuffer(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::RENDERBUFFER, m_multisampleColorBuffer);
+            resizeDepthStencil(sampleCount);
+            if (m_context->checkFramebufferStatus(GraphicsContext3D::FRAMEBUFFER) != GraphicsContext3D::FRAMEBUFFER_COMPLETE) {
+                // Cleanup
+                clear();
+                return false;
             }
+        }
 
-            // resize regular FBO
-            m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_fbo);
-
-            m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_colorBuffer);
-            m_context->texImage2D(GraphicsContext3D::TEXTURE_2D, 0, internalColorFormat, m_size.width(), m_size.height(), 0, colorFormat, GraphicsContext3D::UNSIGNED_BYTE, 0);
-
-            m_context->framebufferTexture2D(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::TEXTURE_2D, m_colorBuffer, 0);
-
-            // resize the backing color buffer
-            if (m_separateBackingTexture) {
-                m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_backingColorBuffer);
-                m_context->texImage2D(GraphicsContext3D::TEXTURE_2D, 0, internalColorFormat, m_size.width(), m_size.height(), 0, colorFormat, GraphicsContext3D::UNSIGNED_BYTE, 0);
-            }
+        // resize regular FBO
+        m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_fbo);
 
-            m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, 0);
+        m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_colorBuffer);
+        m_context->texImage2D(GraphicsContext3D::TEXTURE_2D, 0, internalColorFormat, m_size.width(), m_size.height(), 0, colorFormat, GraphicsContext3D::UNSIGNED_BYTE, 0);
 
-            if (!multisample())
-                resizeDepthStencil(0);
-            if (m_context->checkFramebufferStatus(GraphicsContext3D::FRAMEBUFFER) == GraphicsContext3D::FRAMEBUFFER_COMPLETE)
-                break;
-            adjustedSize.scale(s_resourceAdjustedRatio);
+        m_context->framebufferTexture2D(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::TEXTURE_2D, m_colorBuffer, 0);
 
-        } while (!adjustedSize.isEmpty());
+        // resize the backing color buffer
+        if (m_separateBackingTexture) {
+            m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_backingColorBuffer);
+            m_context->texImage2D(GraphicsContext3D::TEXTURE_2D, 0, internalColorFormat, m_size.width(), m_size.height(), 0, colorFormat, GraphicsContext3D::UNSIGNED_BYTE, 0);
+        }
 
-        pixelDelta = m_size.width() * m_size.height();
-        pixelDelta -= oldSize;
-        s_currentResourceUsePixels += pixelDelta;
+        m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, 0);
 
-        if (adjustedSize.isEmpty()) {
+        if (!multisample())
+            resizeDepthStencil(0);
+        if (m_context->checkFramebufferStatus(GraphicsContext3D::FRAMEBUFFER) != GraphicsContext3D::FRAMEBUFFER_COMPLETE) {
+            // Cleanup
             clear();
             return false;
         }