Changeset 135071 in webkit


Ignore:
Timestamp:
Nov 18, 2012, 10:06:58 AM (13 years ago)
Author:
Simon Fraser
Message:

<rdar://problem/12725980> Fix overlay scrollbar painting in compositing layers (102442)
Merge r135029

2012-11-16 Simon Fraser <Simon Fraser>

Fix overlay scrollbar painting in compositing layers
https://bugs.webkit.org/show_bug.cgi?id=102442

Reviewed by Beth Dakin.

There were two issues with overlay scrollbar painting in
compositing layers.

First, we'd only ever call setContainsDirtyOverlayScrollbars()
on the RenderView's layer, even when encountering an overlay scrollbar
in some descendant compositing layer. This meant that we'd never
run the paintOverlayScrollbars() code for those child compositing
layers, so sometimes scrollbars were missing there.

Even after fixing that, we would fail to render scrollbars that
were not in the composited RenderLayer itself. This happened because
we called into RenderLayer::paintOverlayScrollbars(), which called
paintLayer() with flags that only said to paint the overlay scrollbars
but not any descendants, so this paint path would not walk child
RenderLayers.

Also remove the containsScrollableAreaWithOverlayScrollbars() flag on
ScrollView which is no longer used.

  • platform/ScrollView.cpp: (WebCore::ScrollView::ScrollView): Remove containsScrollableAreaWithOverlayScrollbars(). (WebCore::ScrollView::paint): Remove setting of m_containsScrollableAreaWithOverlayScrollbars.
  • platform/ScrollView.h:
  • rendering/RenderLayer.cpp: (WebCore::RenderLayer::paintOverflowControls): Call setContainsDirtyOverlayScrollbars() on the compositing ancestor or the root. Remove call to setContainsScrollableAreaWithOverlayScrollbars(). (WebCore::RenderLayer::paintOverlayScrollbars): When painting overlay scrollbars, no need to say we have transparency, and no need to use temporary clip rects. (WebCore::RenderLayer::paintLayer): The PaintLayerPaintingOverlayScrollbars check here was only needed because the compositing entrypoint to painting overlay scrollbars went via paintLayer(), which isn't normally used as a composited painting entry point. Now that we no longer call that, we don't need this special check.
  • rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::paintIntoLayer): Jump into overlay scrollbar painting via paintLayerContents(), not paintOverlayScrollbars(), since the latter does not traverse sublayers.
Location:
branches/safari-536.28-branch/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-536.28-branch/Source/WebCore/ChangeLog

    r135070 r135071  
     12012-11-18  Simon Fraser  <simon.fraser@apple.com>
     2
     3        <rdar://problem/12725980> Fix overlay scrollbar painting in compositing layers (102442)
     4        Merge r135029
     5
     6    2012-11-16  Simon Fraser  <simon.fraser@apple.com>
     7   
     8            Fix overlay scrollbar painting in compositing layers
     9            https://bugs.webkit.org/show_bug.cgi?id=102442
     10   
     11            Reviewed by Beth Dakin.
     12   
     13            There were two issues with overlay scrollbar painting in
     14            compositing layers.
     15           
     16            First, we'd only ever call setContainsDirtyOverlayScrollbars()
     17            on the RenderView's layer, even when encountering an overlay scrollbar
     18            in some descendant compositing layer. This meant that we'd never
     19            run the paintOverlayScrollbars() code for those child compositing
     20            layers, so sometimes scrollbars were missing there.
     21           
     22            Even after fixing that, we would fail to render scrollbars that
     23            were not in the composited RenderLayer itself. This happened because
     24            we called into RenderLayer::paintOverlayScrollbars(), which called
     25            paintLayer() with flags that only said to paint the overlay scrollbars
     26            but not any descendants, so this paint path would not walk child
     27            RenderLayers.
     28           
     29            Also remove the containsScrollableAreaWithOverlayScrollbars() flag on
     30            ScrollView which is no longer used.
     31   
     32            * platform/ScrollView.cpp:
     33            (WebCore::ScrollView::ScrollView): Remove containsScrollableAreaWithOverlayScrollbars().
     34            (WebCore::ScrollView::paint): Remove setting of m_containsScrollableAreaWithOverlayScrollbars.
     35            * platform/ScrollView.h:
     36            * rendering/RenderLayer.cpp:
     37            (WebCore::RenderLayer::paintOverflowControls): Call setContainsDirtyOverlayScrollbars()
     38            on the compositing ancestor or the root.
     39            Remove call to setContainsScrollableAreaWithOverlayScrollbars().
     40            (WebCore::RenderLayer::paintOverlayScrollbars): When painting overlay
     41            scrollbars, no need to say we have transparency, and no need to use
     42            temporary clip rects.
     43            (WebCore::RenderLayer::paintLayer): The PaintLayerPaintingOverlayScrollbars
     44            check here was only needed because the compositing entrypoint to painting
     45            overlay scrollbars went via paintLayer(), which isn't normally used as
     46            a composited painting entry point. Now that we no longer call that, we
     47            don't need this special check.
     48            * rendering/RenderLayerBacking.cpp:
     49            (WebCore::RenderLayerBacking::paintIntoLayer): Jump into overlay scrollbar
     50            painting via paintLayerContents(), not paintOverlayScrollbars(), since
     51            the latter does not traverse sublayers.
     52
    1532012-11-18  Simon Fraser  <simon.fraser@apple.com>
    254
  • branches/safari-536.28-branch/Source/WebCore/platform/ScrollView.cpp

    r115401 r135071  
    5858    , m_clipsRepaints(true)
    5959    , m_delegatesScrolling(false)
    60     , m_containsScrollableAreaWithOverlayScrollbars(false)
    6160{
    6261    platformInit();
     
    10401039
    10411040    notifyPageThatContentAreaWillPaint();
    1042 
    1043     // If we encounter any overlay scrollbars as we paint, this will be set to true.
    1044     m_containsScrollableAreaWithOverlayScrollbars = false;
    10451041
    10461042    IntRect clipRect = frameRect();
  • branches/safari-536.28-branch/Source/WebCore/platform/ScrollView.h

    r111139 r135071  
    280280    virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar*, const IntPoint&) const;
    281281
    282     bool containsScrollableAreaWithOverlayScrollbars() const { return m_containsScrollableAreaWithOverlayScrollbars; }
    283     void setContainsScrollableAreaWithOverlayScrollbars(bool contains) { m_containsScrollableAreaWithOverlayScrollbars = contains; }
    284 
    285282    void calculateAndPaintOverhangAreas(GraphicsContext*, const IntRect& dirtyRect);
    286283
     
    352349    bool m_clipsRepaints;
    353350    bool m_delegatesScrolling;
    354 
    355     bool m_containsScrollableAreaWithOverlayScrollbars;
    356351
    357352    void init();
  • branches/safari-536.28-branch/Source/WebCore/rendering/RenderLayer.cpp

    r135070 r135071  
    25312531#endif
    25322532        RenderView* renderView = renderer()->view();
    2533         renderView->layer()->setContainsDirtyOverlayScrollbars(true);
    2534         renderView->frameView()->setContainsScrollableAreaWithOverlayScrollbars(true);
     2533
     2534        RenderLayer* paintingRoot = enclosingCompositingLayer();
     2535        if (!paintingRoot)
     2536            paintingRoot = renderView->layer();
     2537
     2538        paintingRoot->setContainsDirtyOverlayScrollbars(true);
    25352539        return;
    25362540    }
     
    27522756
    27532757    LayerPaintingInfo paintingInfo(this, enclosingIntRect(damageRect), paintBehavior, paintingRoot);
    2754     paintLayer(context, paintingInfo, PaintLayerHaveTransparency | PaintLayerTemporaryClipRects | PaintLayerPaintingOverlayScrollbars);
     2758    paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars);
    27552759
    27562760    m_containsDirtyOverlayScrollbars = false;
     
    28572861            paintFlags |= PaintLayerTemporaryClipRects;
    28582862        else if (!backing()->paintsIntoWindow()
    2859             && !shouldDoSoftwarePaint(this, paintFlags & PaintLayerPaintingReflection)
    2860             && !(paintingInfo.rootLayer->containsDirtyOverlayScrollbars()
    2861             && (paintFlags & PaintLayerPaintingOverlayScrollbars))) {
     2863            && !shouldDoSoftwarePaint(this, paintFlags & PaintLayerPaintingReflection)) {
    28622864            // If this RenderLayer should paint into its backing, that will be done via RenderLayerBacking::paintIntoLayer().
    28632865            return;
  • branches/safari-536.28-branch/Source/WebCore/rendering/RenderLayerBacking.cpp

    r135070 r135071  
    12141214
    12151215    if (m_owningLayer->containsDirtyOverlayScrollbars())
    1216         m_owningLayer->paintOverlayScrollbars(context, paintDirtyRect, paintBehavior);
     1216        m_owningLayer->paintLayerContents(context, paintingInfo, paintFlags | RenderLayer::PaintLayerPaintingOverlayScrollbars);
    12171217
    12181218    ASSERT(!m_owningLayer->m_usedTransparency);
Note: See TracChangeset for help on using the changeset viewer.