Changeset 155131 in webkit


Ignore:
Timestamp:
Sep 5, 2013 10:56:58 AM (11 years ago)
Author:
Simon Fraser
Message:

Source/WebCore: Fix repaint issue on "paints into ancestor" filtered layers
https://bugs.webkit.org/show_bug.cgi?id=120780

Reviewed by Tim Horton.

When a repaint happened on a layer with a filter, and which paints into
its compositing ancestor, we'd repaint the wrong layer (and assert).

Fix by ensuring that RenderLayer::enclosingFilterLayer() takes paintsIntoCompositedAncestor()
into account, by adding a function that we share between three callers who
check isComposited() && !paintsIntoCompositedAncestor(). I didn't use a function
on RenderLayer, because I wanted it to be inline but to not #include RenderLayerBacking
in RenderLayer.h.

Test: compositing/filters/opacity-change-on-filtered-paints-into-ancestor.html

  • dom/Node.cpp: Drive-by removal of #include "RenderLayer.h"
  • rendering/RenderLayer.cpp:

(WebCore::compositedWithOwnBackingStore):
(WebCore::RenderLayer::enclosingCompositingLayerForRepaint):
(WebCore::RenderLayer::enclosingFilterRepaintLayer):
(WebCore::RenderLayer::clippingRootForPainting):

LayoutTests: Fix repaint issue on "paints into ancestor" filtered layers
https://bugs.webkit.org/show_bug.cgi?id=120780
<rdar://problem/14884148>

Reviewed by Tim Horton.

Ref test for opacity change on a filtered layer which paints into its compositing ancestor.

  • compositing/filters/opacity-change-on-filtered-paints-into-ancestor-expected.html: Added.
  • compositing/filters/opacity-change-on-filtered-paints-into-ancestor.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r155128 r155131  
     12013-09-05  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Fix repaint issue on "paints into ancestor" filtered layers
     4        https://bugs.webkit.org/show_bug.cgi?id=120780
     5        <rdar://problem/14884148>
     6
     7        Reviewed by Tim Horton.
     8       
     9        Ref test for opacity change on a filtered layer which paints into its compositing ancestor.
     10
     11        * compositing/filters/opacity-change-on-filtered-paints-into-ancestor-expected.html: Added.
     12        * compositing/filters/opacity-change-on-filtered-paints-into-ancestor.html: Added.
     13
    1142013-09-05  Danilo Cesar Lemes de Paula  <danilo.cesar@collabora.co.uk>
    215
  • trunk/Source/WebCore/ChangeLog

    r155130 r155131  
     12013-09-05  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Fix repaint issue on "paints into ancestor" filtered layers
     4        https://bugs.webkit.org/show_bug.cgi?id=120780
     5
     6        Reviewed by Tim Horton.
     7       
     8        When a repaint happened on a layer with a filter, and which paints into
     9        its compositing ancestor, we'd repaint the wrong layer (and assert).
     10       
     11        Fix by ensuring that RenderLayer::enclosingFilterLayer() takes paintsIntoCompositedAncestor()
     12        into account, by adding a function that we share between three callers who
     13        check isComposited() && !paintsIntoCompositedAncestor(). I didn't use a function
     14        on RenderLayer, because I wanted it to be inline but to not #include RenderLayerBacking
     15        in RenderLayer.h.
     16
     17        Test: compositing/filters/opacity-change-on-filtered-paints-into-ancestor.html
     18
     19        * dom/Node.cpp: Drive-by removal of #include "RenderLayer.h"
     20        * rendering/RenderLayer.cpp:
     21        (WebCore::compositedWithOwnBackingStore):
     22        (WebCore::RenderLayer::enclosingCompositingLayerForRepaint):
     23        (WebCore::RenderLayer::enclosingFilterRepaintLayer):
     24        (WebCore::RenderLayer::clippingRootForPainting):
     25
    1262013-09-05  Brent Fulgham  <bfulgham@apple.com>
    227
  • trunk/Source/WebCore/dom/Node.cpp

    r155015 r155131  
    118118#include <wtf/text/StringBuilder.h>
    119119
    120 #ifndef NDEBUG
    121 #include "RenderLayer.h"
    122 #endif
    123 
    124120#if ENABLE(GESTURE_EVENTS)
    125121#include "GestureEvent.h"
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r155047 r155131  
    14181418#if USE(ACCELERATED_COMPOSITING)
    14191419
     1420static bool compositedWithOwnBackingStore(const RenderLayer* layer)
     1421{
     1422    return layer->isComposited() && !layer->backing()->paintsIntoCompositedAncestor();
     1423}
     1424
    14201425RenderLayer* RenderLayer::enclosingCompositingLayer(IncludeSelfOrNot includeSelf) const
    14211426{
     
    14371442
    14381443    for (const RenderLayer* curr = compositingContainer(this); curr; curr = compositingContainer(curr)) {
    1439         if (curr->isComposited() && !curr->backing()->paintsIntoCompositedAncestor())
     1444        if (compositedWithOwnBackingStore(curr))
    14401445            return const_cast<RenderLayer*>(curr);
    14411446    }
     
    14621467{
    14631468    for (const RenderLayer* curr = this; curr; curr = curr->parent()) {
    1464         if ((curr != this && curr->requiresFullLayerImageForFilters()) || curr->isComposited() || curr->isRootLayer())
     1469        if ((curr != this && curr->requiresFullLayerImageForFilters()) || compositedWithOwnBackingStore(curr) || curr->isRootLayer())
    14651470            return const_cast<RenderLayer*>(curr);
    14661471    }
     
    15291534
    15301535#endif
    1531    
     1536
    15321537RenderLayer* RenderLayer::clippingRootForPainting() const
    15331538{
     
    15461551        if (current->transform()
    15471552#if USE(ACCELERATED_COMPOSITING)
    1548             || (current->isComposited() && !current->backing()->paintsIntoCompositedAncestor())
     1553            || compositedWithOwnBackingStore(current)
    15491554#endif
    15501555        )
Note: See TracChangeset for help on using the changeset viewer.