Changeset 122354 in webkit


Ignore:
Timestamp:
Jul 11, 2012 12:29:30 PM (12 years ago)
Author:
dino@apple.com
Message:

TileCache layers have wrong border debug color
https://bugs.webkit.org/show_bug.cgi?id=90922

Reviewed by Simon Fraser.

Source/WebCore:

Commit r122152 updated the layer hierarchy when a tile
cache is being used by the view. As part of that, GraphicsLayerClient::shouldUseTileCache()
was changed to return false in some situations (the idea was that it
should only be called from the createGraphicsLayer method). However
there were two other call points: one that sets the debug colors on
borders, the other was a call that keeps the document background in sync.

Add a new method usingTileCache() that returns the current state. Also fix
a FIXME where the debug code always called into the client rather than
caching the value on the GraphicsLayer.

Test: compositing/document-background-color.html

  • platform/graphics/GraphicsLayer.cpp:

(WebCore::GraphicsLayer::GraphicsLayer):
(WebCore::GraphicsLayer::updateDebugIndicators): check the local variable when
setting the debug colors.

  • platform/graphics/GraphicsLayer.h:

(GraphicsLayer): new bool member variable m_usingTileCache.

  • platform/graphics/GraphicsLayerClient.h:

(WebCore::GraphicsLayerClient::usingTileCache): new virtual method to query if
this client is actually using the tile cache.

  • platform/graphics/ca/GraphicsLayerCA.cpp:

(WebCore::GraphicsLayerCA::GraphicsLayerCA): set the member variable m_usingTileCache
if the GraphicsLayerClient says we are.

  • rendering/RenderLayerBacking.h:

(WebCore::RenderLayerBacking::usingTileCache):

  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::documentBackgroundColorDidChange): call usingTileCache()
rather than shouldUseTileCache(), because the latter's value might not always reflect
the existence of a cache.

LayoutTests:

Make sure that the document background color is updated
when using a Tile Cache.

  • compositing/document-background-color-expected.html: Added.
  • compositing/document-background-color.html: Added.
Location:
trunk
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r122339 r122354  
     12012-07-11  Dean Jackson  <dino@apple.com>
     2
     3        TileCache layers have wrong border debug color
     4        https://bugs.webkit.org/show_bug.cgi?id=90922
     5
     6        Reviewed by Simon Fraser.
     7
     8        Make sure that the document background color is updated
     9        when using a Tile Cache.
     10
     11        * compositing/document-background-color-expected.html: Added.
     12        * compositing/document-background-color.html: Added.
     13
    1142012-07-11  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r122353 r122354  
     12012-07-11  Dean Jackson  <dino@apple.com>
     2
     3        TileCache layers have wrong border debug color
     4        https://bugs.webkit.org/show_bug.cgi?id=90922
     5
     6        Reviewed by Simon Fraser.
     7
     8        Commit r122152 updated the layer hierarchy when a tile
     9        cache is being used by the view. As part of that, GraphicsLayerClient::shouldUseTileCache()
     10        was changed to return false in some situations (the idea was that it
     11        should only be called from the createGraphicsLayer method). However
     12        there were two other call points: one that sets the debug colors on
     13        borders, the other was a call that keeps the document background in sync.
     14
     15        Add a new method usingTileCache() that returns the current state. Also fix
     16        a FIXME where the debug code always called into the client rather than
     17        caching the value on the GraphicsLayer.
     18
     19        Test: compositing/document-background-color.html
     20
     21        * platform/graphics/GraphicsLayer.cpp:
     22        (WebCore::GraphicsLayer::GraphicsLayer):
     23        (WebCore::GraphicsLayer::updateDebugIndicators): check the local variable when
     24        setting the debug colors.
     25        * platform/graphics/GraphicsLayer.h:
     26        (GraphicsLayer): new bool member variable m_usingTileCache.
     27        * platform/graphics/GraphicsLayerClient.h:
     28        (WebCore::GraphicsLayerClient::usingTileCache): new virtual method to query if
     29        this client is actually using the tile cache.
     30        * platform/graphics/ca/GraphicsLayerCA.cpp:
     31        (WebCore::GraphicsLayerCA::GraphicsLayerCA): set the member variable m_usingTileCache
     32        if the GraphicsLayerClient says we are.
     33        * rendering/RenderLayerBacking.h:
     34        (WebCore::RenderLayerBacking::usingTileCache):
     35        * rendering/RenderLayerCompositor.cpp:
     36        (WebCore::RenderLayerCompositor::documentBackgroundColorDidChange): call usingTileCache()
     37        rather than shouldUseTileCache(), because the latter's value might not always reflect
     38        the existence of a cache.
     39
    1402012-07-11  Ryosuke Niwa  <rniwa@webkit.org>
    241
  • trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp

    r121461 r122354  
    8080    , m_maintainsPixelAlignment(false)
    8181    , m_appliesPageScale(false)
     82    , m_usingTileCache(false)
    8283    , m_paintingPhase(GraphicsLayerPaintAll)
    8384    , m_contentsOrientation(CompositingCoordinatesTopDown)
     
    341342    if (GraphicsLayer::showDebugBorders()) {
    342343        if (drawsContent()) {
    343             // FIXME: It's weird to ask the client if this layer is a tile cache layer.
    344             // Maybe we should just cache that information inside GraphicsLayer?
    345             if (m_client->shouldUseTileCache(this)) // tile cache layer: dark blue
     344            if (m_usingTileCache) // tile cache layer: dark blue
    346345                setDebugBorder(Color(0, 0, 128, 128), 0.5);
    347346            else if (m_usingTiledLayer)
  • trunk/Source/WebCore/platform/graphics/GraphicsLayer.h

    r121513 r122354  
    467467    bool m_maintainsPixelAlignment : 1;
    468468    bool m_appliesPageScale : 1; // Set for the layer which has the page scale applied to it.
     469    bool m_usingTileCache : 1;
    469470
    470471    GraphicsLayerPaintingPhase m_paintingPhase;
  • trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h

    r112178 r122354  
    5757
    5858    virtual bool shouldUseTileCache(const GraphicsLayer*) const { return false; }
     59    virtual bool usingTileCache(const GraphicsLayer*) const { return false; }
    5960   
    6061    // Callback for when hardware-accelerated animation started.
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp

    r121524 r122354  
    269269{
    270270    PlatformCALayer::LayerType layerType = PlatformCALayer::LayerTypeWebLayer;
    271     if (client && client->shouldUseTileCache(this))
     271    if (client && client->shouldUseTileCache(this)) {
    272272        layerType = PlatformCALayer::LayerTypeTileCacheLayer;
     273        m_usingTileCache = true;
     274    }
    273275
    274276    m_layer = PlatformCALayer::create(layerType, this);
  • trunk/Source/WebCore/rendering/RenderLayerBacking.h

    r122152 r122354  
    131131    // GraphicsLayerClient interface
    132132    virtual bool shouldUseTileCache(const GraphicsLayer*) const;
     133    virtual bool usingTileCache(const GraphicsLayer*) const { return m_usingTiledCacheLayer; }
    133134    virtual void notifyAnimationStarted(const GraphicsLayer*, double startTime);
    134135    virtual void notifySyncRequired(const GraphicsLayer*);
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r121926 r122354  
    19111911
    19121912    GraphicsLayer* graphicsLayer = backing->graphicsLayer();
    1913     if (!graphicsLayer->client()->shouldUseTileCache(graphicsLayer))
     1913    if (!graphicsLayer->client()->usingTileCache(graphicsLayer))
    19141914        return;
    19151915
Note: See TracChangeset for help on using the changeset viewer.