Changeset 85959 in webkit


Ignore:
Timestamp:
May 6, 2011 10:41:46 AM (13 years ago)
Author:
enne@google.com
Message:

2011-05-04 Adrienne Walker <enne@google.com>

Reviewed by James Robinson.

[chromium] Fix incorrect scissor rect for layers that render into a rendersurface
https://bugs.webkit.org/show_bug.cgi?id=59020

  • compositing/flat-with-transformed-child-expected.txt: Added.
  • compositing/flat-with-transformed-child.html: Added.
  • platform/chromium-gpu-linux/compositing/flat-with-transformed-child-expected.checksum: Added.
  • platform/chromium-gpu-linux/compositing/flat-with-transformed-child-expected.png: Added.
  • platform/chromium/test_expectations.txt:

2011-05-04 Adrienne Walker <enne@google.com>

Reviewed by James Robinson.

[chromium] Fix incorrect scissor rect for layers that render into a rendersurface
https://bugs.webkit.org/show_bug.cgi?id=59020

Allow for empty scissor rects, which implies scissoring to the render
surface. The previous code and previous patch on this bug both didn't
take into account that the scissor rect should be the render surface
and not the projection of the layer itself, because child layers
aren't necessarily contained within the bounds of their superlayer.

Test: compositing/flat-with-transformed-child.html

  • platform/graphics/chromium/LayerRendererChromium.cpp: (WebCore::LayerRendererChromium::paintLayerContents): (WebCore::LayerRendererChromium::updatePropertiesAndRenderSurfaces): (WebCore::LayerRendererChromium::drawLayer): (WebCore::LayerRendererChromium::setScissorToRect):
Location:
trunk
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r85957 r85959  
     12011-05-04  Adrienne Walker  <enne@google.com>
     2
     3        Reviewed by James Robinson.
     4
     5        [chromium] Fix incorrect scissor rect for layers that render into a rendersurface
     6        https://bugs.webkit.org/show_bug.cgi?id=59020
     7
     8        * compositing/flat-with-transformed-child-expected.txt: Added.
     9        * compositing/flat-with-transformed-child.html: Added.
     10        * platform/chromium-gpu-linux/compositing/flat-with-transformed-child-expected.checksum: Added.
     11        * platform/chromium-gpu-linux/compositing/flat-with-transformed-child-expected.png: Added.
     12        * platform/chromium/test_expectations.txt:
     13
    1142011-05-05  Ojan Vafai  <ojan@chromium.org>
    215
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r85950 r85959  
    40884088BUGWK60356 : svg/filters/subRegion-one-effect.svg = IMAGE
    40894089BUGWK60356 : svg/filters/subRegion-two-effects.svg = IMAGE
     4090
     4091// Needs baselines everywhere
     4092BUGENNE GPU : compositing/flat-with-transformed-child.html = PASS FAIL MISSING
  • trunk/Source/WebCore/ChangeLog

    r85955 r85959  
     12011-05-04  Adrienne Walker  <enne@google.com>
     2
     3        Reviewed by James Robinson.
     4
     5        [chromium] Fix incorrect scissor rect for layers that render into a rendersurface
     6        https://bugs.webkit.org/show_bug.cgi?id=59020
     7
     8        Allow for empty scissor rects, which implies scissoring to the render
     9        surface. The previous code and previous patch on this bug both didn't
     10        take into account that the scissor rect should be the render surface
     11        and not the projection of the layer itself, because child layers
     12        aren't necessarily contained within the bounds of their superlayer.
     13
     14        Test: compositing/flat-with-transformed-child.html
     15
     16        * platform/graphics/chromium/LayerRendererChromium.cpp:
     17        (WebCore::LayerRendererChromium::paintLayerContents):
     18        (WebCore::LayerRendererChromium::updatePropertiesAndRenderSurfaces):
     19        (WebCore::LayerRendererChromium::drawLayer):
     20        (WebCore::LayerRendererChromium::setScissorToRect):
     21
    1222011-05-06  Simon Fraser  <simon.fraser@apple.com>
    223
  • trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp

    r85814 r85959  
    366366                continue;
    367367
    368             const IntRect targetSurfaceRect = layer->ccLayerImpl()->scissorRect();
     368            IntRect targetSurfaceRect = ccLayerImpl->targetRenderSurface() ? ccLayerImpl->targetRenderSurface()->contentRect() : m_defaultRenderSurface->contentRect();
     369            IntRect scissorRect = layer->ccLayerImpl()->scissorRect();
     370            if (!scissorRect.isEmpty())
     371                targetSurfaceRect.intersect(scissorRect);
    369372
    370373            if (layer->drawsContent())
     
    640643        layerOriginTransform.translate3d(-0.5 * bounds.width(), -0.5 * bounds.height(), 0);
    641644        renderSurface->m_originTransform = layerOriginTransform;
    642         if (layerOriginTransform.isInvertible() && drawLayer->superlayer()) {
    643             TransformationMatrix parentToLayer = layerOriginTransform.inverse();
    644 
    645             drawLayer->setScissorRect(parentToLayer.mapRect(drawLayer->superlayer()->scissorRect()));
    646         } else
    647             drawLayer->setScissorRect(IntRect());
     645        drawLayer->setScissorRect(IntRect());
    648646
    649647        // The render surface scissor rect is the scissor rect that needs to
     
    685683
    686684        if (drawLayer->masksToBounds()) {
    687             IntRect scissor = drawLayer->scissorRect();
    688             scissor.intersect(transformedLayerRect);
     685            IntRect scissor = transformedLayerRect;
     686            if (!drawLayer->scissorRect().isEmpty())
     687                scissor.intersect(drawLayer->scissorRect());
    689688            drawLayer->setScissorRect(scissor);
    690689        }
     
    766765        // clipped.
    767766        if (!drawLayer->replicaLayer()) {
    768             renderSurface->m_contentRect.intersect(drawLayer->scissorRect());
     767            if (!drawLayer->scissorRect().isEmpty())
     768                renderSurface->m_contentRect.intersect(drawLayer->scissorRect());
    769769            FloatPoint clippedSurfaceCenter = renderSurface->contentRectCenter();
    770770            centerOffsetDueToClipping = clippedSurfaceCenter - surfaceCenter;
     
    908908    setScissorToRect(layer->scissorRect());
    909909
     910    IntRect targetSurfaceRect = m_currentRenderSurface ? m_currentRenderSurface->contentRect() : m_defaultRenderSurface->contentRect();
     911    IntRect scissorRect = layer->scissorRect();
     912    if (!scissorRect.isEmpty())
     913        targetSurfaceRect.intersect(scissorRect);
     914
    910915    // Check if the layer falls within the visible bounds of the page.
    911916    IntRect layerRect = layer->getDrawRect();
    912     bool isLayerVisible = layer->scissorRect().intersects(layerRect);
     917    bool isLayerVisible = targetSurfaceRect.intersects(layerRect);
    913918    if (!isLayerVisible) {
    914919        layer->unreserveContentsTexture();
     
    934939    }
    935940
    936     layer->draw(layer->scissorRect());
     941    layer->draw(targetSurfaceRect);
    937942
    938943    // Draw the debug border if there is one.
     
    942947// Sets the scissor region to the given rectangle. The coordinate system for the
    943948// scissorRect has its origin at the top left corner of the current visible rect.
    944 void LayerRendererChromium::setScissorToRect(const IntRect& scissorRect)
     949void LayerRendererChromium::setScissorToRect(const IntRect& requestedScissor)
    945950{
    946951    IntRect contentRect = (m_currentRenderSurface ? m_currentRenderSurface->m_contentRect : m_defaultRenderSurface->m_contentRect);
     952
     953    const IntRect scissorRect = requestedScissor.isEmpty() ? contentRect : requestedScissor;
    947954
    948955    // The scissor coordinates must be supplied in viewport space so we need to offset
Note: See TracChangeset for help on using the changeset viewer.