Title: [145131] trunk/Source
Revision
145131
Author
jam...@google.com
Date
2013-03-07 13:53:48 -0800 (Thu, 07 Mar 2013)

Log Message

[chromium] Stop using WebTransformationMatrix on WebLayer
https://bugs.webkit.org/show_bug.cgi?id=111635

Reviewed by Adrienne Walker.

Source/Platform:

WebLayer supports setting transforms by using either SkMatrix44 or WebTransformationMatrix,
both of which are wrappers around 16 doubles. There's no need to have both.

* chromium/public/WebLayer.h:
(WebKit):
(WebLayer):

Source/WebCore:

Switches over to the SkMatrix44 transform setters.

* platform/graphics/chromium/GraphicsLayerChromium.cpp:
(WebCore::transformToSkMatrix44):
  Utility for convering a WebCore::TransformationMatrix to an SkMatrix44.
  Will move to a more common location once it gets more callers.
(WebCore::GraphicsLayerChromium::updateTransform):
(WebCore::GraphicsLayerChromium::updateChildrenTransform):

Source/WebKit/chromium:

* src/LinkHighlight.cpp:
(WebKit::LinkHighlight::computeEnclosingCompositingLayer):
* tests/GraphicsLayerChromiumTest.cpp:
(GraphicsLayerChromiumTest):

Modified Paths

Diff

Modified: trunk/Source/Platform/ChangeLog (145130 => 145131)


--- trunk/Source/Platform/ChangeLog	2013-03-07 21:50:51 UTC (rev 145130)
+++ trunk/Source/Platform/ChangeLog	2013-03-07 21:53:48 UTC (rev 145131)
@@ -1,3 +1,17 @@
+2013-03-06  James Robinson  <jam...@chromium.org>
+
+        [chromium] Stop using WebTransformationMatrix on WebLayer
+        https://bugs.webkit.org/show_bug.cgi?id=111635
+
+        Reviewed by Adrienne Walker.
+
+        WebLayer supports setting transforms by using either SkMatrix44 or WebTransformationMatrix,
+        both of which are wrappers around 16 doubles. There's no need to have both.
+
+        * chromium/public/WebLayer.h:
+        (WebKit):
+        (WebLayer):
+
 2013-03-06  Kenneth Russell  <k...@google.com>
 
         [Chromium] Fix byte ordering bugs reading back WebGL canvases' content on Android

Modified: trunk/Source/WebCore/ChangeLog (145130 => 145131)


--- trunk/Source/WebCore/ChangeLog	2013-03-07 21:50:51 UTC (rev 145130)
+++ trunk/Source/WebCore/ChangeLog	2013-03-07 21:53:48 UTC (rev 145131)
@@ -1,3 +1,19 @@
+2013-03-06  James Robinson  <jam...@chromium.org>
+
+        [chromium] Stop using WebTransformationMatrix on WebLayer
+        https://bugs.webkit.org/show_bug.cgi?id=111635
+
+        Reviewed by Adrienne Walker.
+
+        Switches over to the SkMatrix44 transform setters.
+
+        * platform/graphics/chromium/GraphicsLayerChromium.cpp:
+        (WebCore::transformToSkMatrix44):
+          Utility for convering a WebCore::TransformationMatrix to an SkMatrix44.
+          Will move to a more common location once it gets more callers.
+        (WebCore::GraphicsLayerChromium::updateTransform):
+        (WebCore::GraphicsLayerChromium::updateChildrenTransform):
+
 2013-03-07  Eric Carlson  <eric.carl...@apple.com>
 
         [Mac] allow iOS to use CaptionUserPreferencesMac

Modified: trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp (145130 => 145131)


--- trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp	2013-03-07 21:50:51 UTC (rev 145130)
+++ trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp	2013-03-07 21:53:48 UTC (rev 145131)
@@ -68,7 +68,6 @@
 #include <public/WebFloatRect.h>
 #include <public/WebImageLayer.h>
 #include <public/WebSize.h>
-#include <public/WebTransformationMatrix.h>
 #include <wtf/CurrentTime.h>
 #include <wtf/HashSet.h>
 #include <wtf/MemoryInstrumentationHashMap.h>
@@ -702,14 +701,36 @@
     platformLayer()->setAnchorPointZ(m_anchorPoint.z());
 }
 
+static SkMatrix44 transformToSkMatrix44(const TransformationMatrix& matrix)
+{
+    SkMatrix44 ret(SkMatrix44::kUninitialized_Constructor);
+    ret.setDouble(0, 0, matrix.m11());
+    ret.setDouble(0, 1, matrix.m21());
+    ret.setDouble(0, 2, matrix.m31());
+    ret.setDouble(0, 3, matrix.m41());
+    ret.setDouble(1, 0, matrix.m12());
+    ret.setDouble(1, 1, matrix.m22());
+    ret.setDouble(1, 2, matrix.m32());
+    ret.setDouble(1, 3, matrix.m42());
+    ret.setDouble(2, 0, matrix.m13());
+    ret.setDouble(2, 1, matrix.m23());
+    ret.setDouble(2, 2, matrix.m33());
+    ret.setDouble(2, 3, matrix.m43());
+    ret.setDouble(3, 0, matrix.m14());
+    ret.setDouble(3, 1, matrix.m24());
+    ret.setDouble(3, 2, matrix.m34());
+    ret.setDouble(3, 3, matrix.m44());
+    return ret;
+}
+
 void GraphicsLayerChromium::updateTransform()
 {
-    platformLayer()->setTransform(WebTransformationMatrix(m_transform));
+    platformLayer()->setTransform(transformToSkMatrix44(m_transform));
 }
 
 void GraphicsLayerChromium::updateChildrenTransform()
 {
-    platformLayer()->setSublayerTransform(WebTransformationMatrix(m_childrenTransform));
+    platformLayer()->setSublayerTransform(transformToSkMatrix44(m_childrenTransform));
 }
 
 void GraphicsLayerChromium::updateMasksToBounds()

Modified: trunk/Source/WebKit/chromium/ChangeLog (145130 => 145131)


--- trunk/Source/WebKit/chromium/ChangeLog	2013-03-07 21:50:51 UTC (rev 145130)
+++ trunk/Source/WebKit/chromium/ChangeLog	2013-03-07 21:53:48 UTC (rev 145131)
@@ -1,3 +1,15 @@
+2013-03-06  James Robinson  <jam...@chromium.org>
+
+        [chromium] Stop using WebTransformationMatrix on WebLayer
+        https://bugs.webkit.org/show_bug.cgi?id=111635
+
+        Reviewed by Adrienne Walker.
+
+        * src/LinkHighlight.cpp:
+        (WebKit::LinkHighlight::computeEnclosingCompositingLayer):
+        * tests/GraphicsLayerChromiumTest.cpp:
+        (GraphicsLayerChromiumTest):
+
 2013-03-07  Mark Pilgrim  <pilg...@chromium.org>
 
         [Chromium] Update some #includes for WebMessagePortChannel.h

Modified: trunk/Source/WebKit/chromium/src/LinkHighlight.cpp (145130 => 145131)


--- trunk/Source/WebKit/chromium/src/LinkHighlight.cpp	2013-03-07 21:50:51 UTC (rev 145130)
+++ trunk/Source/WebKit/chromium/src/LinkHighlight.cpp	2013-03-07 21:53:48 UTC (rev 145131)
@@ -37,6 +37,7 @@
 #include "RenderLayerBacking.h"
 #include "RenderObject.h"
 #include "RenderView.h"
+#include "SkMatrix44.h"
 #include "WebFrameImpl.h"
 #include "WebKit.h"
 #include "WebViewImpl.h"
@@ -47,7 +48,6 @@
 #include <public/WebFloatPoint.h>
 #include <public/WebRect.h>
 #include <public/WebSize.h>
-#include <public/WebTransformationMatrix.h>
 #include <wtf/CurrentTime.h>
 
 using namespace WebCore;
@@ -128,9 +128,9 @@
         return 0;
 
     GraphicsLayerChromium* newGraphicsLayer = static_cast<GraphicsLayerChromium*>(renderLayer->backing()->graphicsLayer());
-    m_clipLayer->setSublayerTransform(WebTransformationMatrix());
+    m_clipLayer->setSublayerTransform(SkMatrix44());
     if (!newGraphicsLayer->drawsContent()) {
-        m_clipLayer->setSublayerTransform(WebTransformationMatrix(newGraphicsLayer->transform()));
+        m_clipLayer->setSublayerTransform(newGraphicsLayer->platformLayer()->transform());
         newGraphicsLayer = static_cast<GraphicsLayerChromium*>(m_owningWebViewImpl->nonCompositedContentHost()->topLevelRootLayer());
     }
 

Modified: trunk/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp (145130 => 145131)


--- trunk/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp	2013-03-07 21:50:51 UTC (rev 145130)
+++ trunk/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp	2013-03-07 21:53:48 UTC (rev 145131)
@@ -38,7 +38,6 @@
 #include <public/WebFloatAnimationCurve.h>
 #include <public/WebGraphicsContext3D.h>
 #include <public/WebLayerTreeView.h>
-#include <public/WebTransformationMatrix.h>
 #include <public/WebUnitTestSupport.h>
 #include <wtf/PassOwnPtr.h>
 
@@ -76,11 +75,6 @@
     }
 
 protected:
-    static void expectTranslateX(double translateX, const WebTransformationMatrix& matrix)
-    {
-        EXPECT_FLOAT_EQ(translateX, matrix.m41());
-    }
-
     WebLayer* m_platformLayer;
     OwnPtr<GraphicsLayerChromium> m_graphicsLayer;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to