Title: [127502] trunk/Source
Revision
127502
Author
[email protected]
Date
2012-09-04 14:10:32 -0700 (Tue, 04 Sep 2012)

Log Message

[BlackBerry] Use child/ScrollableContent layer's position instead of parent/ScrollLayer's boundsOrigin
https://bugs.webkit.org/show_bug.cgi?id=95778
PR #202252

Reviewed by Rob Buis.
Patch by Antonio Gomes <[email protected]>
Internally reviewed by Arvid Nilsson.

Upstream has switch away from using the parent scroll layer's bounds origin
in order to translate contents of all its child layers. Instead now, it directly
sets the scroll position of the child scrollable contents layer.

Source/WebCore:

No new tests, since it is a catch-up with upstreaming code.

Source/WebCore:
* platform/graphics/blackberry/GraphicsLayerBlackBerry.cpp:
(WebCore):
* platform/graphics/blackberry/GraphicsLayerBlackBerry.h:
(GraphicsLayerBlackBerry):
* platform/graphics/blackberry/LayerCompositingThread.cpp:
(WebCore::LayerCompositingThread::updateAnimations):
* platform/graphics/blackberry/LayerCompositingThread.h:
(WebCore::LayerOverride::LayerOverride):
(LayerOverride):
* platform/graphics/blackberry/LayerData.h:
(LayerData):
* platform/graphics/blackberry/LayerRenderer.cpp:
(WebCore::LayerRenderer::updateLayersRecursive):
* platform/graphics/blackberry/LayerWebKitThread.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):

Source/WebKit/blackberry:

Source/WebKit/blackberry:
* Api/InRegionScroller.cpp:
(BlackBerry::WebKit::InRegionScrollerPrivate::setScrollPositionCompositingThread):
* WebKitSupport/InRegionScrollableArea.cpp:
(BlackBerry::WebKit::InRegionScrollableArea::InRegionScrollableArea):

No new tests, since it is a catch-up with upstreaming code.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (127501 => 127502)


--- trunk/Source/WebCore/ChangeLog	2012-09-04 21:02:07 UTC (rev 127501)
+++ trunk/Source/WebCore/ChangeLog	2012-09-04 21:10:32 UTC (rev 127502)
@@ -1,3 +1,36 @@
+2012-09-04  Antonio Gomes  <[email protected]>
+
+        [BlackBerry] Use child/ScrollableContent layer's position instead of parent/ScrollLayer's boundsOrigin
+        https://bugs.webkit.org/show_bug.cgi?id=95778
+        PR #202252
+
+        Reviewed by Rob Buis.
+        Internally reviewed by Arvid Nilsson.
+
+        Upstream has switch away from using the parent scroll layer's bounds origin
+        in order to translate contents of all its child layers. Instead now, it directly
+        sets the scroll position of the child scrollable contents layer.
+
+        No new tests, since it is a catch-up with upstreaming code.
+
+        Source/WebCore:
+        * platform/graphics/blackberry/GraphicsLayerBlackBerry.cpp:
+        (WebCore):
+        * platform/graphics/blackberry/GraphicsLayerBlackBerry.h:
+        (GraphicsLayerBlackBerry):
+        * platform/graphics/blackberry/LayerCompositingThread.cpp:
+        (WebCore::LayerCompositingThread::updateAnimations):
+        * platform/graphics/blackberry/LayerCompositingThread.h:
+        (WebCore::LayerOverride::LayerOverride):
+        (LayerOverride):
+        * platform/graphics/blackberry/LayerData.h:
+        (LayerData):
+        * platform/graphics/blackberry/LayerRenderer.cpp:
+        (WebCore::LayerRenderer::updateLayersRecursive):
+        * platform/graphics/blackberry/LayerWebKitThread.h:
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
+
 2012-09-04  Tommy Widenflycht  <[email protected]>
 
         MediaStream API: Add the async createOffer functionality to RTCPeerConnection

Modified: trunk/Source/WebCore/platform/graphics/blackberry/GraphicsLayerBlackBerry.cpp (127501 => 127502)


--- trunk/Source/WebCore/platform/graphics/blackberry/GraphicsLayerBlackBerry.cpp	2012-09-04 21:02:07 UTC (rev 127501)
+++ trunk/Source/WebCore/platform/graphics/blackberry/GraphicsLayerBlackBerry.cpp	2012-09-04 21:10:32 UTC (rev 127502)
@@ -319,16 +319,6 @@
 }
 #endif
 
-void GraphicsLayerBlackBerry::setBoundsOrigin(const FloatPoint& origin)
-{
-    if (origin == m_boundsOrigin)
-        return;
-
-    GraphicsLayer::setBoundsOrigin(origin);
-    updateBoundsOrigin();
-
-}
-
 void GraphicsLayerBlackBerry::setBackgroundColor(const Color& color)
 {
     if (m_backgroundColorSet && m_backgroundColor == color)
@@ -714,11 +704,6 @@
     updateLayerPosition();
 }
 
-void GraphicsLayerBlackBerry::updateBoundsOrigin()
-{
-    primaryLayer()->setBoundsOrigin(m_boundsOrigin);
-}
-
 void GraphicsLayerBlackBerry::updateTransform()
 {
     primaryLayer()->setTransform(m_transform);

Modified: trunk/Source/WebCore/platform/graphics/blackberry/GraphicsLayerBlackBerry.h (127501 => 127502)


--- trunk/Source/WebCore/platform/graphics/blackberry/GraphicsLayerBlackBerry.h	2012-09-04 21:02:07 UTC (rev 127501)
+++ trunk/Source/WebCore/platform/graphics/blackberry/GraphicsLayerBlackBerry.h	2012-09-04 21:10:32 UTC (rev 127502)
@@ -85,8 +85,6 @@
     const FilterOperations& filters() const { return m_filters; }
 #endif
 
-    virtual void setBoundsOrigin(const FloatPoint&);
-
     virtual void setBackgroundColor(const Color&);
     virtual void clearBackgroundColor();
 
@@ -145,7 +143,6 @@
     void updateLayerPosition();
     void updateLayerSize();
     void updateAnchorPoint();
-    void updateBoundsOrigin();
     void updateTransform();
     void updateChildrenTransform();
     void updateMasksToBounds();

Modified: trunk/Source/WebCore/platform/graphics/blackberry/LayerCompositingThread.cpp (127501 => 127502)


--- trunk/Source/WebCore/platform/graphics/blackberry/LayerCompositingThread.cpp	2012-09-04 21:02:07 UTC (rev 127501)
+++ trunk/Source/WebCore/platform/graphics/blackberry/LayerCompositingThread.cpp	2012-09-04 21:10:32 UTC (rev 127502)
@@ -475,8 +475,6 @@
             m_transform = m_override->transform();
         if (m_override->isOpacitySet())
             m_opacity = m_override->opacity();
-        if (m_override->isBoundsOriginSet())
-            m_boundsOrigin = m_override->boundsOrigin();
 
         for (size_t i = 0; i < m_override->animations().size(); ++i) {
             LayerAnimation* animation = m_override->animations()[i].get();

Modified: trunk/Source/WebCore/platform/graphics/blackberry/LayerCompositingThread.h (127501 => 127502)


--- trunk/Source/WebCore/platform/graphics/blackberry/LayerCompositingThread.h	2012-09-04 21:02:07 UTC (rev 127501)
+++ trunk/Source/WebCore/platform/graphics/blackberry/LayerCompositingThread.h	2012-09-04 21:10:32 UTC (rev 127502)
@@ -83,10 +83,6 @@
     float opacity() const { return m_opacity; }
     void setOpacity(float opacity) { m_opacity = opacity; m_opacitySet = true; }
 
-    bool isBoundsOriginSet() const { return m_boundsOriginSet; }
-    FloatPoint boundsOrigin() const { return m_boundsOrigin; }
-    void setBoundsOrigin(const FloatPoint& origin) { m_boundsOrigin = origin; m_boundsOriginSet = true; }
-
     const Vector<RefPtr<LayerAnimation> >& animations() const { return m_animations; }
     void addAnimation(PassRefPtr<LayerAnimation> animation) { m_animations.append(animation); }
     void removeAnimation(const String& name);
@@ -99,7 +95,6 @@
         , m_boundsSet(false)
         , m_transformSet(false)
         , m_opacitySet(false)
-        , m_boundsOriginSet(false)
     {
     }
 
@@ -108,7 +103,6 @@
     IntSize m_bounds;
     TransformationMatrix m_transform;
     float m_opacity;
-    FloatPoint m_boundsOrigin;
 
     Vector<RefPtr<LayerAnimation> > m_animations;
 
@@ -117,7 +111,6 @@
     unsigned m_boundsSet : 1;
     unsigned m_transformSet : 1;
     unsigned m_opacitySet : 1;
-    unsigned m_boundsOriginSet : 1;
 };
 
 class LayerFilterRendererAction;
@@ -141,7 +134,6 @@
     // These functions can also be used to update animated properties in LayerAnimation.
     void setPosition(const FloatPoint& position) { m_position = position; }
     void setAnchorPoint(const FloatPoint& anchorPoint) { m_anchorPoint = anchorPoint; }
-    void setBoundsOrigin(const FloatPoint& boundsOrigin) { m_boundsOrigin = boundsOrigin; }
     void setBounds(const IntSize& bounds) { m_bounds = bounds; }
     void setSizeIsScaleInvariant(bool invariant) { m_sizeIsScaleInvariant = invariant; }
     void setTransform(const TransformationMatrix& matrix) { m_transform = matrix; }

Modified: trunk/Source/WebCore/platform/graphics/blackberry/LayerData.h (127501 => 127502)


--- trunk/Source/WebCore/platform/graphics/blackberry/LayerData.h	2012-09-04 21:02:07 UTC (rev 127501)
+++ trunk/Source/WebCore/platform/graphics/blackberry/LayerData.h	2012-09-04 21:10:32 UTC (rev 127502)
@@ -141,8 +141,6 @@
 
     FloatPoint position() const { return m_position; }
 
-    FloatPoint boundsOrigin() const { return m_boundsOrigin; }
-
     // This is currently only used for perspective transform, see GraphicsLayer::setChildrenTransform()
     const TransformationMatrix& sublayerTransform() const { return m_sublayerTransform; }
 
@@ -190,7 +188,6 @@
     IntSize m_bounds;
     FloatPoint m_position;
     FloatPoint m_anchorPoint;
-    FloatPoint m_boundsOrigin;
     Color m_backgroundColor;
     Color m_borderColor;
 

Modified: trunk/Source/WebCore/platform/graphics/blackberry/LayerRenderer.cpp (127501 => 127502)


--- trunk/Source/WebCore/platform/graphics/blackberry/LayerRenderer.cpp	2012-09-04 21:02:07 UTC (rev 127501)
+++ trunk/Source/WebCore/platform/graphics/blackberry/LayerRenderer.cpp	2012-09-04 21:10:32 UTC (rev 127502)
@@ -808,7 +808,6 @@
     // The matrix passed down to the sublayers is therefore:
     // M[s] = M * Tr[-center]
     localMatrix.translate3d(-bounds.width() * 0.5, -bounds.height() * 0.5, 0);
-    localMatrix.translate(-layer->boundsOrigin().x(), -layer->boundsOrigin().y());
 
     const Vector<RefPtr<LayerCompositingThread> >& sublayers = layer->getSublayers();
     for (size_t i = 0; i < sublayers.size(); i++)

Modified: trunk/Source/WebCore/platform/graphics/blackberry/LayerWebKitThread.h (127501 => 127502)


--- trunk/Source/WebCore/platform/graphics/blackberry/LayerWebKitThread.h	2012-09-04 21:02:07 UTC (rev 127501)
+++ trunk/Source/WebCore/platform/graphics/blackberry/LayerWebKitThread.h	2012-09-04 21:10:32 UTC (rev 127502)
@@ -107,8 +107,6 @@
 
     void setPosition(const FloatPoint& position) { m_position = position; setNeedsCommit(); }
 
-    void setBoundsOrigin(const FloatPoint& boundsOrigin) { m_boundsOrigin = boundsOrigin; setNeedsCommit(); }
-
     const LayerWebKitThread* rootLayer() const;
 
     void removeAllSublayers();

Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (127501 => 127502)


--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2012-09-04 21:02:07 UTC (rev 127501)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2012-09-04 21:10:32 UTC (rev 127502)
@@ -660,11 +660,13 @@
         IntSize scrollOffset = m_owningLayer->scrolledContentOffset();
 
         m_scrollingLayer->setPosition(FloatPoint() + (paddingBox.location() - localCompositingBounds.location()));
+
         m_scrollingLayer->setSize(paddingBox.size());
         m_scrollingContentsLayer->setPosition(FloatPoint(-scrollOffset.width(), -scrollOffset.height()));
 
         IntSize oldScrollingLayerOffset = m_scrollingLayer->offsetFromRenderer();
         m_scrollingLayer->setOffsetFromRenderer(IntPoint() - paddingBox.location());
+
         bool paddingBoxOffsetChanged = oldScrollingLayerOffset != m_scrollingLayer->offsetFromRenderer();
 
         IntSize scrollSize(m_owningLayer->scrollWidth(), m_owningLayer->scrollHeight());

Modified: trunk/Source/WebKit/blackberry/Api/InRegionScroller.cpp (127501 => 127502)


--- trunk/Source/WebKit/blackberry/Api/InRegionScroller.cpp	2012-09-04 21:02:07 UTC (rev 127501)
+++ trunk/Source/WebKit/blackberry/Api/InRegionScroller.cpp	2012-09-04 21:10:32 UTC (rev 127502)
@@ -111,8 +111,24 @@
     LayerCompositingThread* scrollLayer = reinterpret_cast<LayerWebKitThread*>(camouflagedLayer)->layerCompositingThread();
 
     // FIXME: Clamp maximum and minimum scroll positions as a last attempt to fix round errors.
-    scrollLayer->override()->setBoundsOrigin(scrollPosition);
+    FloatPoint anchor;
+    if (scrollLayer->override()->isAnchorPointSet())
+        anchor = scrollLayer->override()->anchorPoint();
+    else
+        anchor = scrollLayer->anchorPoint();
 
+    FloatSize bounds;
+    if (scrollLayer->override()->isBoundsSet())
+        bounds = scrollLayer->override()->bounds();
+    else
+        bounds = scrollLayer->bounds();
+
+    // Position is offset on the layer by the layer anchor point.
+    FloatPoint layerPosition(-scrollPosition.x() + anchor.x() * bounds.width(),
+                             -scrollPosition.y() + anchor.y() * bounds.height());
+
+    scrollLayer->override()->setPosition(FloatPoint(layerPosition.x(), layerPosition.y()));
+
     // The client is going to blitVisibleContens, which allow us benefit from "defer blits" technique.
     return true;
 }

Modified: trunk/Source/WebKit/blackberry/ChangeLog (127501 => 127502)


--- trunk/Source/WebKit/blackberry/ChangeLog	2012-09-04 21:02:07 UTC (rev 127501)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2012-09-04 21:10:32 UTC (rev 127502)
@@ -1,3 +1,24 @@
+2012-09-04  Antonio Gomes  <[email protected]>
+
+        [BlackBerry] Use child/ScrollableContent layer's position instead of parent/ScrollLayer's boundsOrigin
+        https://bugs.webkit.org/show_bug.cgi?id=95778
+        PR #202252
+
+        Reviewed by Rob Buis.
+        Internally reviewed by Arvid Nilsson.
+
+        Upstream has switch away from using the parent scroll layer's bounds origin
+        in order to translate contents of all its child layers. Instead now, it directly
+        sets the scroll position of the child scrollable contents layer.
+
+        Source/WebKit/blackberry:
+        * Api/InRegionScroller.cpp:
+        (BlackBerry::WebKit::InRegionScrollerPrivate::setScrollPositionCompositingThread):
+        * WebKitSupport/InRegionScrollableArea.cpp:
+        (BlackBerry::WebKit::InRegionScrollableArea::InRegionScrollableArea):
+
+        No new tests, since it is a catch-up with upstreaming code.
+
 2012-09-04  George Staikos  <[email protected]>
 
         [BlackBerry] Fix memory leak in InputHandler

Modified: trunk/Source/WebKit/blackberry/WebKitSupport/InRegionScrollableArea.cpp (127501 => 127502)


--- trunk/Source/WebKit/blackberry/WebKitSupport/InRegionScrollableArea.cpp	2012-09-04 21:02:07 UTC (rev 127501)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/InRegionScrollableArea.cpp	2012-09-04 21:10:32 UTC (rev 127502)
@@ -97,8 +97,8 @@
         if (m_layer->usesCompositedScrolling()) {
             m_supportsCompositedScrolling = true;
             ASSERT(m_layer->backing()->hasScrollingLayer());
-            m_camouflagedCompositedScrollableLayer = reinterpret_cast<unsigned>(m_layer->backing()->scrollingLayer()->platformLayer());
-            m_cachedCompositedScrollableLayer = m_layer->backing()->scrollingLayer()->platformLayer();
+            m_camouflagedCompositedScrollableLayer = reinterpret_cast<unsigned>(m_layer->backing()->scrollingContentsLayer()->platformLayer());
+            m_cachedCompositedScrollableLayer = m_layer->backing()->scrollingContentsLayer()->platformLayer();
             ASSERT(!m_cachedNonCompositedScrollableNode);
         } else {
             m_camouflagedCompositedScrollableLayer = reinterpret_cast<unsigned>(m_layer->enclosingElement());
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to