- a/Source/WebCore/ChangeLog +20 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2012-04-13  Alexandru Chiculita  <achicu@adobe.com>
2
3
        [CSS Filters] Do not use clipping rect when calculating the bounds of a layer
4
        https://bugs.webkit.org/show_bug.cgi?id=83960
5
6
        Reviewed by NOBODY (OOPS!).
7
        
8
        The local clip rect should not be used when calculating the bounds of a filter area. Otherwise
9
        drop-shadow might not know about the pixels outside the clipping rectangle, even though the actual shadow might
10
        be inside it.
11
12
        No new tests added in this patch, but this patch fixes two existing tests that fail.
13
        LayoutTests/css3/filters/filter-repaint-shadow-clipped.html
14
        LayoutTests/css3/filters/filter-repaint-shadow-rotated.html
15
16
        * rendering/RenderLayer.cpp:
17
        (WebCore::RenderLayer::paintLayerContents):
18
        (WebCore::RenderLayer::calculateLayerBounds):
19
        * rendering/RenderLayer.h:
20
1
2012-04-13  Jer Noble  <jer.noble@apple.com>
21
2012-04-13  Jer Noble  <jer.noble@apple.com>
2
22
3
        Video at apple.com gets standard controls in addition to custom controls after returning from full screen
23
        Video at apple.com gets standard controls in addition to custom controls after returning from full screen
- a/Source/WebCore/rendering/RenderLayer.cpp -10 / +12 lines
Lines 2976-2982 void RenderLayer::paintLayerContents(RenderLayer* rootLayer, GraphicsContext* co a/Source/WebCore/rendering/RenderLayer.cpp_sec1
2976
        LayoutPoint rootLayerOffset;
2976
        LayoutPoint rootLayerOffset;
2977
        convertToLayerCoords(rootLayer, rootLayerOffset);
2977
        convertToLayerCoords(rootLayer, rootLayerOffset);
2978
        m_filterRepaintRect.move(rootLayerOffset.x(), rootLayerOffset.y());
2978
        m_filterRepaintRect.move(rootLayerOffset.x(), rootLayerOffset.y());
2979
        LayoutRect filterPaintDirtyRect = filterPainter.prepareFilterEffect(this, calculateLayerBounds(this, rootLayer, false, false), parentPaintDirtyRect, m_filterRepaintRect);
2979
        LayoutRect filterPaintDirtyRect = filterPainter.prepareFilterEffect(this, calculateLayerBounds(this, rootLayer, 0), parentPaintDirtyRect, m_filterRepaintRect);
2980
        m_filterRepaintRect = IntRect();
2980
        m_filterRepaintRect = IntRect();
2981
        // Rewire the old context to a memory buffer, so that we can capture the contents of the layer.
2981
        // Rewire the old context to a memory buffer, so that we can capture the contents of the layer.
2982
        // NOTE: We saved the old context in the "transparencyLayerContext" local variable, to be able to start a transparency layer
2982
        // NOTE: We saved the old context in the "transparencyLayerContext" local variable, to be able to start a transparency layer
Lines 4093-4099 IntRect RenderLayer::absoluteBoundingBox() const a/Source/WebCore/rendering/RenderLayer.cpp_sec2
4093
    return pixelSnappedIntRect(boundingBox(root()));
4093
    return pixelSnappedIntRect(boundingBox(root()));
4094
}
4094
}
4095
4095
4096
IntRect RenderLayer::calculateLayerBounds(const RenderLayer* layer, const RenderLayer* ancestorLayer, bool includeSelfTransform, bool includeLayerFilterOutsets)
4096
IntRect RenderLayer::calculateLayerBounds(const RenderLayer* layer, const RenderLayer* ancestorLayer, CalculateLayerBoundsFlags flags)
4097
{
4097
{
4098
    if (!layer->isSelfPaintingLayer())
4098
    if (!layer->isSelfPaintingLayer())
4099
        return IntRect();
4099
        return IntRect();
Lines 4114-4125 IntRect RenderLayer::calculateLayerBounds(const RenderLayer* layer, const Render a/Source/WebCore/rendering/RenderLayer.cpp_sec3
4114
4114
4115
    LayoutRect unionBounds = boundingBoxRect;
4115
    LayoutRect unionBounds = boundingBoxRect;
4116
4116
4117
    LayoutRect localClipRect = layer->localClipRect();
4117
    if (flags & UseLocalClipRectIfPossible) {
4118
    if (localClipRect != PaintInfo::infiniteRect()) {
4118
        LayoutRect localClipRect = layer->localClipRect();
4119
        LayoutPoint ancestorRelOffset;
4119
        if (localClipRect != PaintInfo::infiniteRect()) {
4120
        layer->convertToLayerCoords(ancestorLayer, ancestorRelOffset);
4120
            LayoutPoint ancestorRelOffset;
4121
        localClipRect.moveBy(ancestorRelOffset);
4121
            layer->convertToLayerCoords(ancestorLayer, ancestorRelOffset);
4122
        return pixelSnappedIntRect(localClipRect);
4122
            localClipRect.moveBy(ancestorRelOffset);
4123
            return pixelSnappedIntRect(localClipRect);
4124
        }
4123
    }
4125
    }
4124
4126
4125
    if (RenderLayer* reflection = layer->reflectionLayer()) {
4127
    if (RenderLayer* reflection = layer->reflectionLayer()) {
Lines 4172-4178 IntRect RenderLayer::calculateLayerBounds(const RenderLayer* layer, const Render a/Source/WebCore/rendering/RenderLayer.cpp_sec4
4172
    // FIXME: We can optimize the size of the composited layers, by not enlarging
4174
    // FIXME: We can optimize the size of the composited layers, by not enlarging
4173
    // filtered areas with the outsets if we know that the filter is going to render in hardware.
4175
    // filtered areas with the outsets if we know that the filter is going to render in hardware.
4174
    // https://bugs.webkit.org/show_bug.cgi?id=81239
4176
    // https://bugs.webkit.org/show_bug.cgi?id=81239
4175
    if (includeLayerFilterOutsets && layer->renderer()->style()->hasFilterOutsets()) {
4177
    if ((flags & IncludeLayerFilterOutsets) && layer->renderer()->style()->hasFilterOutsets()) {
4176
        int topOutset;
4178
        int topOutset;
4177
        int rightOutset;
4179
        int rightOutset;
4178
        int bottomOutset;
4180
        int bottomOutset;
Lines 4185-4191 IntRect RenderLayer::calculateLayerBounds(const RenderLayer* layer, const Render a/Source/WebCore/rendering/RenderLayer.cpp_sec5
4185
    UNUSED_PARAM(includeLayerFilterOutsets);
4187
    UNUSED_PARAM(includeLayerFilterOutsets);
4186
#endif
4188
#endif
4187
4189
4188
    if (includeSelfTransform && layer->paintsWithTransform(PaintBehaviorNormal)) {
4190
    if ((flags & IncludeSelfTransform) && layer->paintsWithTransform(PaintBehaviorNormal)) {
4189
        TransformationMatrix* affineTrans = layer->transform();
4191
        TransformationMatrix* affineTrans = layer->transform();
4190
        boundingBoxRect = affineTrans->mapRect(boundingBoxRect);
4192
        boundingBoxRect = affineTrans->mapRect(boundingBoxRect);
4191
        unionBounds = affineTrans->mapRect(unionBounds);
4193
        unionBounds = affineTrans->mapRect(unionBounds);
- a/Source/WebCore/rendering/RenderLayer.h -1 / +8 lines
Lines 488-494 public: a/Source/WebCore/rendering/RenderLayer.h_sec1
488
    // Pixel snapped bounding box relative to the root.
488
    // Pixel snapped bounding box relative to the root.
489
    IntRect absoluteBoundingBox() const;
489
    IntRect absoluteBoundingBox() const;
490
490
491
    static IntRect calculateLayerBounds(const RenderLayer*, const RenderLayer* ancestorLayer, bool includeSelfTransform = true, bool includeLayerFilterOutsets = true);
491
    enum CalculateLayerBoundsFlag {
492
        IncludeSelfTransform = 1 << 0,
493
        UseLocalClipRectIfPossible = 1 << 1,
494
        IncludeLayerFilterOutsets = 1 << 2,
495
        DefaultCalculateLayerBoundsFlags =  IncludeSelfTransform | UseLocalClipRectIfPossible | IncludeLayerFilterOutsets
496
    };
497
    typedef unsigned CalculateLayerBoundsFlags;
498
    static IntRect calculateLayerBounds(const RenderLayer*, const RenderLayer* ancestorLayer, CalculateLayerBoundsFlags = DefaultCalculateLayerBoundsFlags);
492
    
499
    
493
    void updateHoverActiveState(const HitTestRequest&, HitTestResult&);
500
    void updateHoverActiveState(const HitTestRequest&, HitTestResult&);
494
501

Return to Bug 83960