Changeset 104932 in webkit


Ignore:
Timestamp:
Jan 13, 2012 6:41:19 AM (12 years ago)
Author:
jocelyn.turcotte@nokia.com
Message:

TextureMapper: Do the node transform computation when painting.
https://bugs.webkit.org/show_bug.cgi?id=74721

Reviewed by Noam Rosenthal.

The transform of the node tree was built during the syncCompositingState
step. This would cause an ASSERT with QWebView, trying to use a dirty transform
state since the rootTextureMapperNode in QWebFramePrivate::renderCompositedLayers
doesn't run the sync step after getting the world transform set.

This moves the transform computation from the sync to the paint step to
prevent making sure that the sync step has been run on all nodes before painting.

  • platform/graphics/texmap/TextureMapperNode.cpp:

(WebCore::TextureMapperNode::computeTransformsRecursive):
(WebCore::TextureMapperNode::computeTiles):
Remove an unused variable.
(WebCore::TextureMapperNode::paint):
(WebCore::TextureMapperNode::syncAnimationsRecursively):
(WebCore::TextureMapperNode::syncCompositingState):

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

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r104931 r104932  
     12012-01-12  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
     2
     3        TextureMapper: Do the node transform computation when painting.
     4        https://bugs.webkit.org/show_bug.cgi?id=74721
     5
     6        Reviewed by Noam Rosenthal.
     7
     8        The transform of the node tree was built during the syncCompositingState
     9        step. This would cause an ASSERT with QWebView, trying to use a dirty transform
     10        state since the rootTextureMapperNode in QWebFramePrivate::renderCompositedLayers
     11        doesn't run the sync step after getting the world transform set.
     12
     13        This moves the transform computation from the sync to the paint step to
     14        prevent making sure that the sync step has been run on all nodes before painting.
     15
     16        * platform/graphics/texmap/TextureMapperNode.cpp:
     17        (WebCore::TextureMapperNode::computeTransformsRecursive):
     18        (WebCore::TextureMapperNode::computeTiles):
     19        Remove an unused variable.
     20        (WebCore::TextureMapperNode::paint):
     21        (WebCore::TextureMapperNode::syncAnimationsRecursively):
     22        (WebCore::TextureMapperNode::syncCompositingState):
     23        * platform/graphics/texmap/TextureMapperNode.h:
     24
    1252012-01-12  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
    226
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp

    r104931 r104932  
    9696}
    9797
    98 void TextureMapperNode::computeAllTransforms()
     98void TextureMapperNode::computeTransformsRecursive()
    9999{
    100100    if (m_size.isEmpty() && m_state.masksToBounds)
    101101        return;
    102102
     103    // Compute transforms recursively on the way down to leafs.
    103104    computeTransformsSelf();
    104105
     
    109110
    110111    if (m_state.maskLayer)
    111         m_state.maskLayer->computeAllTransforms();
     112        m_state.maskLayer->computeTransformsRecursive();
    112113    if (m_state.replicaLayer)
    113         m_state.replicaLayer->computeAllTransforms();
     114        m_state.replicaLayer->computeTransformsRecursive();
     115    for (int i = 0; i < m_children.size(); ++i)
     116        m_children[i]->computeTransformsRecursive();
     117
     118    // Reorder children if needed on the way back up.
     119    if (m_state.preserves3D)
     120        sortByZOrder(m_children, 0, m_children.size());
    114121}
    115122
     
    134141            FloatRect tileRect(x, y, gTileDimension, gTileDimension);
    135142            tileRect.intersect(contentRect);
    136             FloatRect tileRectInRootCoordinates = tileRect;
    137             tileRectInRootCoordinates.scale(1.0);
    138             tileRectInRootCoordinates = m_transforms.target.mapRect(tileRectInRootCoordinates);
    139143            tilesToAdd.append(tileRect);
    140144        }
     
    316320    if (m_size.isEmpty())
    317321        return;
     322
     323    computeTransformsRecursive();
    318324
    319325    TextureMapperPaintOptions opt;
     
    971977    syncAnimations(0);
    972978
    973     computeAllTransforms();
    974 
    975979    for (int i = m_children.size() - 1; i >= 0; --i)
    976980        m_children[i]->syncAnimationsRecursively();
     
    9971001    syncAnimations(graphicsLayer);
    9981002
    999     computeAllTransforms();
    10001003    computeTiles();
    10011004    computeOverlapsIfNeeded();
     
    10191022            m_children[i]->syncCompositingState(0, textureMapper, options);
    10201023    }
    1021 
    1022     if (m_state.preserves3D)
    1023         sortByZOrder(m_children, 0, m_children.size());
    10241024}
    10251025
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperNode.h

    r104931 r104932  
    175175private:
    176176    TextureMapperNode* rootLayer();
    177     void computeAllTransforms();
     177    void computeTransformsRecursive();
    178178    void computeTransformsSelf();
    179179    void computeVisibleRect(const FloatRect& rootVisibleRect);
Note: See TracChangeset for help on using the changeset viewer.