Changeset 109424 in webkit


Ignore:
Timestamp:
Mar 1, 2012 2:24:52 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[chromium] Move pageScaleDirty logic from LayerChromium to GraphicsLayerChromium
https://bugs.webkit.org/show_bug.cgi?id=79714

Patch by James Robinson <jamesr@chromium.org> on 2012-03-01
Reviewed by Adrienne Walker.

When the page scale changes on a composited layer we need to invalidate all of the contents on the layer in
order to repaint them at the new scale. The sequence of calls we get make this a bit tricky, since we first
receive a page scale changed notification and then receive the new layer bounds. The solution is to defer the
invalidation until we have the new layer bounds, which landed in r99774.

This moves that logic from LayerChromium into GraphicsLayerChromium since IMO this is pretty particular to the
way WebCore is passing us invalidations and not something fundamental to the compositor.

  • platform/graphics/chromium/GraphicsLayerChromium.cpp:

(WebCore::GraphicsLayerChromium::GraphicsLayerChromium):
(WebCore::GraphicsLayerChromium::setSize):
(WebCore::GraphicsLayerChromium::deviceOrPageScaleFactorChanged):

  • platform/graphics/chromium/GraphicsLayerChromium.h:
  • platform/graphics/chromium/LayerChromium.cpp:

(WebCore::LayerChromium::LayerChromium):
(WebCore::LayerChromium::setBounds):

  • platform/graphics/chromium/LayerChromium.h:

(LayerChromium):

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r109417 r109424  
     12012-03-01  James Robinson  <jamesr@chromium.org>
     2
     3        [chromium] Move pageScaleDirty logic from LayerChromium to GraphicsLayerChromium
     4        https://bugs.webkit.org/show_bug.cgi?id=79714
     5
     6        Reviewed by Adrienne Walker.
     7
     8        When the page scale changes on a composited layer we need to invalidate all of the contents on the layer in
     9        order to repaint them at the new scale. The sequence of calls we get make this a bit tricky, since we first
     10        receive a page scale changed notification and then receive the new layer bounds. The solution is to defer the
     11        invalidation until we have the new layer bounds, which landed in r99774.
     12
     13        This moves that logic from LayerChromium into GraphicsLayerChromium since IMO this is pretty particular to the
     14        way WebCore is passing us invalidations and not something fundamental to the compositor.
     15
     16        * platform/graphics/chromium/GraphicsLayerChromium.cpp:
     17        (WebCore::GraphicsLayerChromium::GraphicsLayerChromium):
     18        (WebCore::GraphicsLayerChromium::setSize):
     19        (WebCore::GraphicsLayerChromium::deviceOrPageScaleFactorChanged):
     20        * platform/graphics/chromium/GraphicsLayerChromium.h:
     21        * platform/graphics/chromium/LayerChromium.cpp:
     22        (WebCore::LayerChromium::LayerChromium):
     23        (WebCore::LayerChromium::setBounds):
     24        * platform/graphics/chromium/LayerChromium.h:
     25        (LayerChromium):
     26
    1272012-03-01  Joe Thomas  <joethomas@motorola.com>
    228
  • trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp

    r108880 r109424  
    7979    , m_contentsLayerHasBackgroundColor(false)
    8080    , m_inSetChildren(false)
     81    , m_pageScaleChanged(false)
    8182{
    8283    m_layer = ContentLayerChromium::create(this);
     
    202203    GraphicsLayer::setSize(clampedSize);
    203204    updateLayerSize();
     205
     206    if (m_pageScaleChanged && m_layer)
     207        m_layer->setNeedsDisplay();
     208    m_pageScaleChanged = false;
    204209}
    205210
     
    723728{
    724729    updateContentsScale();
    725     if (m_layer)
    726         m_layer->pageScaleChanged();
     730    // Invalidations are clamped to the layer's bounds but we receive the scale changed notification before receiving
     731    // the new layer bounds. When the scale changes, we really want to invalidate the post-scale layer bounds, so we
     732    // remember that the scale has changed and then invalidate the full layer bounds when we receive the new size.
     733    m_pageScaleChanged = true;
    727734}
    728735
  • trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h

    r108880 r109424  
    166166    bool m_contentsLayerHasBackgroundColor : 1;
    167167    bool m_inSetChildren;
     168    bool m_pageScaleChanged;
    168169
    169170    AnimationIdMap m_animationIdMap;
  • trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp

    r108937 r109424  
    8585    , m_targetRenderSurface(0)
    8686    , m_contentsScale(1.0)
    87     , m_pageScaleDirty(false)
    8887    , m_layerAnimationDelegate(0)
    8988{
     
    279278    m_bounds = size;
    280279
    281     if (firstResize || m_pageScaleDirty)
     280    if (firstResize)
    282281        setNeedsDisplay();
    283282    else
    284283        setNeedsCommit();
    285 
    286     m_pageScaleDirty = false;
    287284}
    288285
  • trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h

    r108937 r109424  
    170170    virtual void unreserveContentsTexture() { }
    171171    virtual void bindContentsTexture() { }
    172     virtual void pageScaleChanged() { m_pageScaleDirty = true; }
    173172    virtual void protectVisibleTileTextures() { }
    174173    virtual bool needsContentsScale() const { return false; }
     
    327326    String m_name;
    328327
    329     bool m_pageScaleDirty;
    330 
    331328    CCLayerAnimationDelegate* m_layerAnimationDelegate;
    332329};
Note: See TracChangeset for help on using the changeset viewer.