Revert "[WK2] calculate tiledBackingStoreVisibleRect including animation trajectory."
authorHurnjoo Lee <hurnjoo.lee@samsung.com>
Tue, 8 Oct 2013 09:45:07 +0000 (18:45 +0900)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Thu, 10 Oct 2013 10:56:28 +0000 (10:56 +0000)
This reverts commit df16f73a1980a8f36435dcf12df316e9d579032c.

[Title] Revert "[WK2] calculate tiledBackingStoreVisibleRect including animation trajectory."
[Issues] N/A
[Problem] -webkit-transition uses too much memory.
[Solution] Revert "[WK2] calculate tiledBackingStoreVisibleRect including animation trajectory."

Conflicts:
Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/WebGraphicsLayer.cpp

Change-Id: I1c87f0bd2f9174f0e18e8f0003bab570dc6afd3f

Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/WebGraphicsLayer.cpp
Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/WebGraphicsLayer.h

index 759ff86..0f730e6 100644 (file)
@@ -782,23 +782,14 @@ IntRect WebGraphicsLayer::tiledBackingStoreVisibleRect()
         return IntRect();
 #endif
 
-    FloatRect perspectiveRect = m_webGraphicsLayerClient->visibleContentsRect();
-
 #if ENABLE(TIZEN_CSS_OVERFLOW_CLIPPING_BACKING_STORE)
     if (GraphicsLayer::overflowClipping() && m_mainBackingStore) {
         WebGraphicsLayer* parentLayer = toWebGraphicsLayer(parent());
         if (parentLayer)
-            perspectiveRect = parentLayer->clippingBounds();
+            return enclosingIntRect(m_layerTransform.combined().inverse().clampedBoundsOfProjectedQuad(FloatQuad(parentLayer->clippingBounds())));
     }
 #endif
 
-    if (m_movingVisibleRect) {
-        IntRect startAnimationRect = enclosingIntRect(m_layerTransform.combined().inverse().clampedBoundsOfProjectedQuad(FloatQuad(perspectiveRect)));
-        IntRect endAnimationRect = enclosingIntRect(m_layerSettledTransform.combined().inverse().clampedBoundsOfProjectedQuad(FloatQuad(perspectiveRect)));
-        endAnimationRect.unite(startAnimationRect);
-        return endAnimationRect;
-    }
-
 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_SCROLLBAR)
     if (isScrollbar()) {
         WebGraphicsLayer* parentLayer = toWebGraphicsLayer(parent());
@@ -807,7 +798,7 @@ IntRect WebGraphicsLayer::tiledBackingStoreVisibleRect()
             adjustedTransform.setPosition(FloatPoint(position().x() - parentLayer->position().x(),
                     position().y() - parentLayer->position().y()));
             adjustedTransform.combineTransforms(parent() ? toWebGraphicsLayer(parent())->m_layerTransform.combinedForChildren() : TransformationMatrix());
-            return enclosingIntRect(adjustedTransform.combined().inverse().clampedBoundsOfProjectedQuad(FloatQuad(perspectiveRect)));
+            return enclosingIntRect(adjustedTransform.combined().inverse().clampedBoundsOfProjectedQuad(FloatQuad(FloatRect(m_webGraphicsLayerClient->visibleContentsRect()))));
         }
     }
 #endif
@@ -815,7 +806,7 @@ IntRect WebGraphicsLayer::tiledBackingStoreVisibleRect()
     // Return a projection of the visible rect (surface coordinates) onto the layer's plane (layer coordinates).
     // The resulting quad might be squewed and the visible rect is the bounding box of this quad,
     // so it might spread further than the real visible area (and then even more amplified by the cover rect multiplier).
-    return enclosingIntRect(m_layerTransform.combined().inverse().clampedBoundsOfProjectedQuad(FloatQuad(perspectiveRect)));
+    return enclosingIntRect(m_layerTransform.combined().inverse().clampedBoundsOfProjectedQuad(FloatQuad(FloatRect(m_webGraphicsLayerClient->visibleContentsRect()))));
 }
 
 Color WebGraphicsLayer::tiledBackingStoreBackgroundColor() const
@@ -993,23 +984,14 @@ bool WebGraphicsLayer::hasPendingVisibleChanges()
 void WebGraphicsLayer::computeTransformedVisibleRect()
 {
     // When we have a transform animation, we need to update visible rect every frame to adjust the visible rect of a backing store.
+    bool hasActiveTransformAnimation = selfOrAncestorHasActiveTransformAnimation();
     if (!m_shouldUpdateVisibleRect && !m_movingVisibleRect)
         return;
 
     m_shouldUpdateVisibleRect = false;
     TransformationMatrix currentTransform = transform();
-    if (m_movingVisibleRect) {
-        m_layerSettledTransform.setLocalTransform(currentTransform);
-        m_layerSettledTransform.setPosition(position());
-        m_layerSettledTransform.setAnchorPoint(anchorPoint());
-        m_layerSettledTransform.setSize(size());
-        m_layerSettledTransform.setFlattening(!preserves3D());
-        m_layerSettledTransform.setChildrenTransform(childrenTransform());
-        m_layerSettledTransform.combineTransforms(parent() ? toWebGraphicsLayer(parent())->m_layerTransform.combinedForChildren() : TransformationMatrix());
-
+    if (m_movingVisibleRect)
         client()->getCurrentTransform(this, currentTransform);
-    }
-
     m_layerTransform.setLocalTransform(currentTransform);
     m_layerTransform.setPosition(position());
     m_layerTransform.setAnchorPoint(anchorPoint());
index 4a42d31..ccc0a20 100755 (executable)
@@ -241,7 +241,6 @@ private:
     GraphicsLayer* m_maskTarget;
     FloatRect m_needsDisplayRect;
     GraphicsLayerTransform m_layerTransform;
-    GraphicsLayerTransform m_layerSettledTransform;
     bool m_inUpdateMode : 1;
     bool m_shouldUpdateVisibleRect: 1;
     bool m_shouldSyncLayerState: 1;