Changeset 106400 in webkit


Ignore:
Timestamp:
Jan 31, 2012 2:58:23 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

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).

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:
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r106392 r106400  
     12012-01-31  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r106376.
     4        http://trac.webkit.org/changeset/106376
     5        https://bugs.webkit.org/show_bug.cgi?id=77481
     6
     7        Broke WebGLLayerChromiumTest in webkit_unit_tests (Requested
     8        by kbr_google on #webkit).
     9
     10        * platform/chromium/test_expectations.txt:
     11
    1122012-01-31  David Grogan  <dgrogan@chromium.org>
    213
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r106378 r106400  
    38323832BUGWK76580 : media/media-document-audio-repaint.html = IMAGE PASS
    38333833
     3834BUGWK76562 : fast/canvas/webgl/drawingbuffer-test.html = TEXT
     3835
    38343836// This test is passing, but it doesn't seem possible to add GPU+Leopard specific baselines.
    38353837BUGJAMESR LEOPARD GPU : fast/canvas/quadraticCurveTo.xml = IMAGE
  • trunk/Source/WebCore/ChangeLog

    r106398 r106400  
     12012-01-31  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r106376.
     4        http://trac.webkit.org/changeset/106376
     5        https://bugs.webkit.org/show_bug.cgi?id=77481
     6
     7        Broke WebGLLayerChromiumTest in webkit_unit_tests (Requested
     8        by kbr_google on #webkit).
     9
     10        * platform/graphics/gpu/DrawingBuffer.cpp:
     11        (WebCore):
     12        (WebCore::DrawingBuffer::reset):
     13
    1142012-01-31  Mihnea Ovidenie  <mihnea@adobe.com>
    215
  • trunk/Source/WebCore/platform/graphics/gpu/DrawingBuffer.cpp

    r106376 r106400  
    5050#endif
    5151static int s_currentResourceUsePixels = 0;
    52 static const float s_resourceAdjustedRatio = 0.5;
    5352
    5453PassRefPtr<DrawingBuffer> DrawingBuffer::create(GraphicsContext3D* context, const IntSize& size, bool separateBackingTexture)
     
    238237
    239238    int pixelDelta = newSize.width() * newSize.height();
    240     int oldSize = 0;
    241     if (!m_size.isEmpty()) {
    242         oldSize = m_size.width() * m_size.height();
    243         pixelDelta -= oldSize;
    244     }
    245 
    246     IntSize adjustedSize = newSize;
    247     if (s_maximumResourceUsePixels) {
    248         while ((s_currentResourceUsePixels + pixelDelta) > s_maximumResourceUsePixels) {
    249             adjustedSize.scale(s_resourceAdjustedRatio);
    250             if (adjustedSize.isEmpty()) {
    251                 clear();
    252                 return false;
    253             }
    254             pixelDelta = adjustedSize.width() * adjustedSize.height();
    255             pixelDelta -= oldSize;
    256         }
    257     }
     239    if (!m_size.isEmpty())
     240        pixelDelta -= m_size.width() * m_size.height();
     241
     242    if (s_maximumResourceUsePixels && (s_currentResourceUsePixels + pixelDelta) > s_maximumResourceUsePixels) {
     243        clear();
     244        return false;
     245    }
     246    s_currentResourceUsePixels += pixelDelta;
    258247
    259248    const GraphicsContext3D::Attributes& attributes = m_context->getContextAttributes();
    260249
    261     if (adjustedSize != m_size) {
     250    if (newSize != m_size) {
     251        m_size = newSize;
    262252
    263253        unsigned internalColorFormat, colorFormat, internalRenderbufferFormat;
     
    272262        }
    273263
    274         do {
    275             m_size = adjustedSize;
    276 
    277             // resize multisample FBO
    278             if (multisample()) {
    279                 int maxSampleCount = 0;
    280 
    281                 m_context->getIntegerv(Extensions3D::MAX_SAMPLES, &maxSampleCount);
    282                 int sampleCount = std::min(4, maxSampleCount);
    283 
    284                 m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_multisampleFBO);
    285 
    286                 m_context->bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, m_multisampleColorBuffer);
    287                 m_context->getExtensions()->renderbufferStorageMultisample(GraphicsContext3D::RENDERBUFFER, sampleCount, internalRenderbufferFormat, m_size.width(), m_size.height());
    288                 m_context->framebufferRenderbuffer(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::RENDERBUFFER, m_multisampleColorBuffer);
    289                 resizeDepthStencil(sampleCount);
    290                 if (m_context->checkFramebufferStatus(GraphicsContext3D::FRAMEBUFFER) != GraphicsContext3D::FRAMEBUFFER_COMPLETE) {
    291                     adjustedSize.scale(s_resourceAdjustedRatio);
    292                     continue;
    293                 }
     264
     265        // resize multisample FBO
     266        if (multisample()) {
     267            int maxSampleCount = 0;
     268           
     269            m_context->getIntegerv(Extensions3D::MAX_SAMPLES, &maxSampleCount);
     270            int sampleCount = std::min(4, maxSampleCount);
     271
     272            m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_multisampleFBO);
     273
     274            m_context->bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, m_multisampleColorBuffer);
     275            m_context->getExtensions()->renderbufferStorageMultisample(GraphicsContext3D::RENDERBUFFER, sampleCount, internalRenderbufferFormat, m_size.width(), m_size.height());
     276            m_context->framebufferRenderbuffer(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::RENDERBUFFER, m_multisampleColorBuffer);
     277            resizeDepthStencil(sampleCount);
     278            if (m_context->checkFramebufferStatus(GraphicsContext3D::FRAMEBUFFER) != GraphicsContext3D::FRAMEBUFFER_COMPLETE) {
     279                // Cleanup
     280                clear();
     281                return false;
    294282            }
    295 
    296             // resize regular FBO
    297             m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_fbo);
    298 
    299             m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_colorBuffer);
     283        }
     284
     285        // resize regular FBO
     286        m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_fbo);
     287
     288        m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_colorBuffer);
     289        m_context->texImage2D(GraphicsContext3D::TEXTURE_2D, 0, internalColorFormat, m_size.width(), m_size.height(), 0, colorFormat, GraphicsContext3D::UNSIGNED_BYTE, 0);
     290
     291        m_context->framebufferTexture2D(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::TEXTURE_2D, m_colorBuffer, 0);
     292
     293        // resize the backing color buffer
     294        if (m_separateBackingTexture) {
     295            m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_backingColorBuffer);
    300296            m_context->texImage2D(GraphicsContext3D::TEXTURE_2D, 0, internalColorFormat, m_size.width(), m_size.height(), 0, colorFormat, GraphicsContext3D::UNSIGNED_BYTE, 0);
    301 
    302             m_context->framebufferTexture2D(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::TEXTURE_2D, m_colorBuffer, 0);
    303 
    304             // resize the backing color buffer
    305             if (m_separateBackingTexture) {
    306                 m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_backingColorBuffer);
    307                 m_context->texImage2D(GraphicsContext3D::TEXTURE_2D, 0, internalColorFormat, m_size.width(), m_size.height(), 0, colorFormat, GraphicsContext3D::UNSIGNED_BYTE, 0);
    308             }
    309 
    310             m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, 0);
    311 
    312             if (!multisample())
    313                 resizeDepthStencil(0);
    314             if (m_context->checkFramebufferStatus(GraphicsContext3D::FRAMEBUFFER) == GraphicsContext3D::FRAMEBUFFER_COMPLETE)
    315                 break;
    316             adjustedSize.scale(s_resourceAdjustedRatio);
    317 
    318         } while (!adjustedSize.isEmpty());
    319 
    320         pixelDelta = m_size.width() * m_size.height();
    321         pixelDelta -= oldSize;
    322         s_currentResourceUsePixels += pixelDelta;
    323 
    324         if (adjustedSize.isEmpty()) {
     297        }
     298
     299        m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, 0);
     300
     301        if (!multisample())
     302            resizeDepthStencil(0);
     303        if (m_context->checkFramebufferStatus(GraphicsContext3D::FRAMEBUFFER) != GraphicsContext3D::FRAMEBUFFER_COMPLETE) {
     304            // Cleanup
    325305            clear();
    326306            return false;
Note: See TracChangeset for help on using the changeset viewer.