Changeset 109466 in webkit


Ignore:
Timestamp:
Mar 1, 2012 4:47:56 PM (12 years ago)
Author:
jamesr@google.com
Message:

[chromium] Rename LayerChromium::name to debugName to be more consistent with other debug properties, make threadsafe
https://bugs.webkit.org/show_bug.cgi?id=79723

Reviewed by Adrienne Walker.

Source/WebCore:

  • platform/graphics/chromium/GraphicsLayerChromium.cpp:

(WebCore::GraphicsLayerChromium::updateNames):

  • platform/graphics/chromium/LayerChromium.cpp:

(WebCore::LayerChromium::pushPropertiesTo):
(WebCore::LayerChromium::setDebugName):
(WebCore):

  • platform/graphics/chromium/LayerChromium.h:

(LayerChromium):

  • platform/graphics/chromium/cc/CCLayerImpl.cpp:

(WebCore::CCLayerImpl::dumpLayer):

  • platform/graphics/chromium/cc/CCLayerImpl.h:

(CCLayerImpl):
(WebCore::CCLayerImpl::setDebugName):
(WebCore::CCLayerImpl::debugName):

  • platform/graphics/chromium/cc/CCRenderSurface.cpp:

(WebCore::CCRenderSurface::name):

Source/WebKit/chromium:

  • tests/LayerChromiumTest.cpp:
Location:
trunk/Source
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r109463 r109466  
     12012-03-01  James Robinson  <jamesr@chromium.org>
     2
     3        [chromium] Rename LayerChromium::name to debugName to be more consistent with other debug properties, make threadsafe
     4        https://bugs.webkit.org/show_bug.cgi?id=79723
     5
     6        Reviewed by Adrienne Walker.
     7
     8        * platform/graphics/chromium/GraphicsLayerChromium.cpp:
     9        (WebCore::GraphicsLayerChromium::updateNames):
     10        * platform/graphics/chromium/LayerChromium.cpp:
     11        (WebCore::LayerChromium::pushPropertiesTo):
     12        (WebCore::LayerChromium::setDebugName):
     13        (WebCore):
     14        * platform/graphics/chromium/LayerChromium.h:
     15        (LayerChromium):
     16        * platform/graphics/chromium/cc/CCLayerImpl.cpp:
     17        (WebCore::CCLayerImpl::dumpLayer):
     18        * platform/graphics/chromium/cc/CCLayerImpl.h:
     19        (CCLayerImpl):
     20        (WebCore::CCLayerImpl::setDebugName):
     21        (WebCore::CCLayerImpl::debugName):
     22        * platform/graphics/chromium/cc/CCRenderSurface.cpp:
     23        (WebCore::CCRenderSurface::name):
     24
    1252012-03-01  Adam Barth  <abarth@webkit.org>
    226
  • trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp

    r109424 r109466  
    118118{
    119119    if (m_layer)
    120         m_layer->setName("Layer for " + m_nameBase);
     120        m_layer->setDebugName("Layer for " + m_nameBase);
    121121    if (m_transformLayer)
    122         m_transformLayer->setName("TransformLayer for " + m_nameBase);
     122        m_transformLayer->setDebugName("TransformLayer for " + m_nameBase);
    123123    if (m_contentsLayer)
    124         m_contentsLayer->setName("ContentsLayer for " + m_nameBase);
     124        m_contentsLayer->setDebugName("ContentsLayer for " + m_nameBase);
    125125}
    126126
  • trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp

    r109424 r109466  
    486486}
    487487
    488 void LayerChromium::setName(const String& name)
    489 {
    490     m_name = name;
    491 }
    492 
    493488void LayerChromium::setNeedsDisplayRect(const FloatRect& dirtyRect)
    494489{
     
    512507    layer->setDebugBorderColor(m_debugBorderColor);
    513508    layer->setDebugBorderWidth(m_debugBorderWidth);
     509    layer->setDebugName(m_debugName.isolatedCopy()); // We have to use isolatedCopy() here to safely pass ownership to another thread.
    514510    layer->setDoubleSided(m_doubleSided);
    515511    layer->setDrawsContent(drawsContent());
     
    526522        m_nonFastScrollableRegionChanged = false;
    527523    }
    528     layer->setName(m_name);
    529524    layer->setOpaque(m_opaque);
    530525    layer->setOpacity(m_opacity);
     
    567562}
    568563
     564void LayerChromium::setDebugName(const String& debugName)
     565{
     566    m_debugName = debugName;
     567    setNeedsCommit();
     568}
     569
     570
    569571void LayerChromium::setContentsScale(float contentsScale)
    570572{
  • trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h

    r109424 r109466  
    100100    bool masksToBounds() const { return m_masksToBounds; }
    101101
    102     void setName(const String&);
    103     const String& name() const { return m_name; }
    104 
    105102    void setMaskLayer(LayerChromium*);
    106103    LayerChromium* maskLayer() const { return m_maskLayer.get(); }
     
    175172    void setDebugBorderColor(const Color&);
    176173    void setDebugBorderWidth(float);
     174    void setDebugName(const String&);
    177175
    178176    virtual void pushPropertiesTo(CCLayerImpl*);
     
    296294    Color m_debugBorderColor;
    297295    float m_debugBorderWidth;
     296    String m_debugName;
    298297    float m_opacity;
    299298    FilterOperations m_filters;
     
    324323    float m_contentsScale;
    325324
    326     String m_name;
     325    bool m_pageScaleDirty;
    327326
    328327    CCLayerAnimationDelegate* m_layerAnimationDelegate;
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp

    r108937 r109466  
    267267{
    268268    writeIndent(ts, indent);
    269     ts << layerTypeAsString() << "(" << m_name << ")\n";
     269    ts << layerTypeAsString() << "(" << m_debugName << ")\n";
    270270    dumpLayerProperties(ts, indent+2);
    271271    if (m_replicaLayer) {
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h

    r108937 r109466  
    136136    const TransformationMatrix& sublayerTransform() const { return m_sublayerTransform; }
    137137
    138     void setName(const String& name) { m_name = name; }
    139     const String& name() const { return m_name; }
    140 
    141138    // Debug layer border - visual effect only, do not change geometry/clipping/etc.
    142139    void setDebugBorderColor(Color);
     
    145142    float debugBorderWidth() const { return m_debugBorderWidth; }
    146143    bool hasDebugBorders() const;
     144
     145    // Debug layer name.
     146    void setDebugName(const String& debugName) { m_debugName = debugName; }
     147    String debugName() const { return m_debugName; }
    147148
    148149    CCRenderSurface* renderSurface() const { return m_renderSurface.get(); }
     
    295296#endif
    296297
    297     String m_name;
    298 
    299298    // Render surface this layer draws into. This is a surface that can belong
    300299    // either to this layer (if m_targetRenderSurface == m_renderSurface) or
     
    312311    float m_debugBorderWidth;
    313312
     313    // Debug layer name.
     314    String m_debugName;
     315
    314316    FilterOperations m_filters;
    315317
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.cpp

    r108013 r109466  
    240240String CCRenderSurface::name() const
    241241{
    242     return String::format("RenderSurface(id=%i,owner=%s)", m_owningLayer->id(), m_owningLayer->name().utf8().data());
     242    return String::format("RenderSurface(id=%i,owner=%s)", m_owningLayer->id(), m_owningLayer->debugName().utf8().data());
    243243}
    244244
  • trunk/Source/WebKit/chromium/ChangeLog

    r109459 r109466  
     12012-03-01  James Robinson  <jamesr@chromium.org>
     2
     3        [chromium] Rename LayerChromium::name to debugName to be more consistent with other debug properties, make threadsafe
     4        https://bugs.webkit.org/show_bug.cgi?id=79723
     5
     6        Reviewed by Adrienne Walker.
     7
     8        * tests/LayerChromiumTest.cpp:
     9
    1102012-03-01  Dale Curtis  <dalecurtis@chromium.org>
    211
  • trunk/Source/WebKit/chromium/tests/LayerChromiumTest.cpp

    r108937 r109466  
    490490
    491491    // Test properties that should not call needsDisplay and needsCommit when changed.
    492     EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setName("Test Layer"));
    493492    EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setVisibleLayerRect(IntRect(0, 0, 40, 50)));
    494493    EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setUsesLayerClipping(true));
     
    522521    EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setTransform(TransformationMatrix(0, 0, 0, 0, 0, 0)));
    523522    EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setDoubleSided(false));
     523    EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setDebugName("Test Layer"));
    524524
    525525    // The above tests should not have caused a change to the needsDisplay flag.
Note: See TracChangeset for help on using the changeset viewer.