Changeset 96120 in webkit


Ignore:
Timestamp:
Sep 27, 2011 9:38:19 AM (13 years ago)
Author:
noam.rosenthal@nokia.com
Message:

[Texmap] Code cleanup: remove unused boundingRect/visibleRect calculations
https://bugs.webkit.org/show_bug.cgi?id=68897

Reviewed by Andreas Kling.

No new functionality so no new tests.

  • platform/graphics/texmap/TextureMapperNode.cpp:

(WebCore::TextureMapperNode::computeAllTransforms):
(WebCore::TextureMapperNode::computeTiles):
(WebCore::TextureMapperNode::syncCompositingState):

  • platform/graphics/texmap/TextureMapperNode.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r96118 r96120  
     12011-09-27  No'am Rosenthal  <noam.rosenthal@nokia.com>
     2
     3        [Texmap] Code cleanup: remove unused boundingRect/visibleRect calculations
     4        https://bugs.webkit.org/show_bug.cgi?id=68897
     5
     6        Reviewed by Andreas Kling.
     7
     8        No new functionality so no new tests.
     9
     10        * platform/graphics/texmap/TextureMapperNode.cpp:
     11        (WebCore::TextureMapperNode::computeAllTransforms):
     12        (WebCore::TextureMapperNode::computeTiles):
     13        (WebCore::TextureMapperNode::syncCompositingState):
     14        * platform/graphics/texmap/TextureMapperNode.h:
     15
    1162011-09-27  No'am Rosenthal  <noam.rosenthal@nokia.com>
    217
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp

    r95901 r96120  
    137137}
    138138
    139 bool TextureMapperNode::needsToComputeBoundingRect() const
    140 {
    141     if (m_size.width() > gTileDimension || m_size.height() > gTileDimension)
    142         return true;
    143     if (!m_state.masksToBounds)
    144         return false;
    145 
    146     for (size_t i = 0; i < m_children.size(); ++i)
    147         if (m_children[i]->needsToComputeBoundingRect())
    148             return true;
    149 
    150     return false;
    151 }
    152 
    153139void TextureMapperNode::computeAllTransforms()
    154140{
     
    161147
    162148    m_transforms.target = TransformationMatrix(m_parent ? m_parent->m_transforms.forDescendants : TransformationMatrix()).multiply(m_transforms.local);
    163     m_transforms.targetBoundingRect = FloatRect(m_transforms.target.mapRect(targetRect()));
    164149
    165150    m_state.visible = m_state.backfaceVisibility || m_transforms.target.inverse().m33() >= 0;
     
    185170
    186171    m_transforms.forDescendants.multiply(m_transforms.perspective);
    187 }
    188 
    189 void TextureMapperNode::computeBoundingRectFromRootIfNeeded()
    190 {
    191     if (!needsToComputeBoundingRect())
    192         return;
    193     if (!m_parent) {
    194         m_transforms.boundingRectFromRoot = m_transforms.boundingRectFromRootForDescendants = IntRect(0, 0, -1, -1);
    195         return;
    196     }
    197 
    198     const FloatRect targetRectInRootCoordinates = m_transforms.target.mapRect(targetRect());
    199 
    200     const FloatRect parentBoundingRect = m_parent->m_transforms.boundingRectFromRootForDescendants;
    201     if (parentBoundingRect.width() < 0)
    202         m_transforms.boundingRectFromRoot = targetRectInRootCoordinates;
    203     else {
    204         m_transforms.boundingRectFromRootForDescendants = m_transforms.boundingRectFromRoot = parentBoundingRect;
    205         m_transforms.boundingRectFromRoot.intersect(targetRectInRootCoordinates);
    206     }
    207     if (m_state.masksToBounds)
    208         m_transforms.boundingRectFromRootForDescendants.intersect(m_transforms.boundingRectFromRoot);
    209172}
    210173
     
    228191            tileRectInRootCoordinates.scale(1.0 / m_state.contentScale);
    229192            tileRectInRootCoordinates = m_transforms.target.mapRect(tileRectInRootCoordinates);
    230             static bool sDiscardHiddenTiles = false;
    231             // FIXME: discard hidden tiles.
    232             if (!sDiscardHiddenTiles || !needsToComputeBoundingRect() || tileRectInRootCoordinates.intersects(m_state.visibleRect))
    233                 tilesToAdd.append(tileRect);
     193            tilesToAdd.append(tileRect);
    234194        }
    235195    }
     
    270230    for (size_t i = 0; i < tilesToRemove.size() && m_tiles.size() > TileEraseThreshold; ++i)
    271231        m_tiles.remove(tilesToRemove[i]);
    272 }
    273 
    274 void TextureMapperNode::computeVisibleRectIfNeeded()
    275 {
    276     if (!needsToComputeBoundingRect())
    277         return;
    278     FloatRect rootVisibleRect;
    279     if (!m_parent)
    280         rootVisibleRect = m_state.rootVisibleRect;
    281     else if (m_parent)
    282         rootVisibleRect = m_parent->m_state.rootVisibleRect;
    283 
    284     m_state.rootVisibleRect = rootVisibleRect;
    285     m_state.visibleRect = m_state.rootVisibleRect;
    286     m_state.visibleRect.intersect(m_transforms.boundingRectFromRoot);
    287232}
    288233
     
    566511    if (m_parent)
    567512        m_parent->m_children.remove(m_parent->m_children.find(this));
    568 }
    569 
    570 void TextureMapperNode::setVisibleRect(const IntRect& rect)
    571 {
    572     m_state.rootVisibleRect = m_state.visibleRect = rect;
    573513}
    574514
     
    896836
    897837    computeAllTransforms();
    898     computeBoundingRectFromRootIfNeeded();
    899838    computePerspectiveTransformIfNeeded();
    900839    computeTiles();
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperNode.h

    r95901 r96120  
    136136    void setTransform(const TransformationMatrix&);
    137137    void setOpacity(float value) { m_opacity = value; }
    138     void setVisibleRect(const IntRect&);
    139138    void setTextureMapper(TextureMapper* texmap) { m_textureMapper = texmap; }
    140139    bool descendantsOrSelfHaveRunningAnimations() const;
     
    149148    TextureMapperNode* rootLayer();
    150149    void computeAllTransforms();
    151     void computeVisibleRectIfNeeded();
    152150    void computePerspectiveTransformIfNeeded();
    153151    void computeReplicaTransformIfNeeded();
Note: See TracChangeset for help on using the changeset viewer.