summaryrefslogtreecommitdiffstats
path: root/cc/test
diff options
context:
space:
mode:
authordanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-05 20:46:13 +0000
committerdanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-05 20:46:13 +0000
commitc9c1ebe24790fb34fa9f0704b7963cea511c6f2a (patch)
treefdd43e025e44ae4d9515ebe03a3e4c54f7133d51 /cc/test
parent6e3d7e7d274a3e8347e49910ab6f873f37e15989 (diff)
downloadchromium_src-c9c1ebe24790fb34fa9f0704b7963cea511c6f2a.zip
chromium_src-c9c1ebe24790fb34fa9f0704b7963cea511c6f2a.tar.gz
chromium_src-c9c1ebe24790fb34fa9f0704b7963cea511c6f2a.tar.bz2
cc: Remove all remaining use of WebCore Rect/Point/Size types from the compositor.
This change removes all IntPoint/FloatRect/IntSize/etc from the compositor. There remains an indirect dependency on these types through the WebCore::Region class, which we wrap but need to replace. However, the wrapper there hides the WebCore types inside it, so there are now no references to the types from anywhere else in the compositor. I went back and forth on how to deal with scroll "positions". The name suggested that they should be Points, and that the deltas should be Vectors. However this lent itself to super awkward math at times. In the end, it was much cleaner to make all scroll "positions" into scroll "offsets" and represent everything as Vectors. Covered by existing tests; no change in behaviour. R=enne BUG=147395 Relanding: https://codereview.chromium.org/11367080/ Review URL: https://codereview.chromium.org/11366089 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166027 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test')
-rw-r--r--cc/test/fake_layer_tree_host_client.h2
-rw-r--r--cc/test/geometry_test_utils.h22
-rw-r--r--cc/test/layer_tree_test_common.cc2
-rw-r--r--cc/test/layer_tree_test_common.h2
4 files changed, 17 insertions, 11 deletions
diff --git a/cc/test/fake_layer_tree_host_client.h b/cc/test/fake_layer_tree_host_client.h
index 8140495..78e7a8f 100644
--- a/cc/test/fake_layer_tree_host_client.h
+++ b/cc/test/fake_layer_tree_host_client.h
@@ -20,7 +20,7 @@ public:
virtual void didBeginFrame() OVERRIDE { }
virtual void animate(double monotonicFrameBeginTime) OVERRIDE { }
virtual void layout() OVERRIDE { }
- virtual void applyScrollAndScale(const IntSize& scrollDelta, float pageScale) OVERRIDE { }
+ virtual void applyScrollAndScale(gfx::Vector2d scrollDelta, float pageScale) OVERRIDE { }
virtual scoped_ptr<WebKit::WebCompositorOutputSurface> createOutputSurface() OVERRIDE;
virtual void didRecreateOutputSurface(bool success) OVERRIDE { }
diff --git a/cc/test/geometry_test_utils.h b/cc/test/geometry_test_utils.h
index 7877a64..52cb814 100644
--- a/cc/test/geometry_test_utils.h
+++ b/cc/test/geometry_test_utils.h
@@ -13,32 +13,38 @@ namespace WebKitTests {
// These are macros instead of functions so that we get useful line numbers where a test failed.
#define EXPECT_FLOAT_RECT_EQ(expected, actual) \
-{ \
+do { \
EXPECT_FLOAT_EQ((expected).x(), (actual).x()); \
EXPECT_FLOAT_EQ((expected).y(), (actual).y()); \
EXPECT_FLOAT_EQ((expected).width(), (actual).width()); \
EXPECT_FLOAT_EQ((expected).height(), (actual).height()); \
-}
+} while (false)
#define EXPECT_RECT_EQ(expected, actual) \
-{ \
+do { \
EXPECT_EQ((expected).x(), (actual).x()); \
EXPECT_EQ((expected).y(), (actual).y()); \
EXPECT_EQ((expected).width(), (actual).width()); \
EXPECT_EQ((expected).height(), (actual).height()); \
-}
+} while (false)
#define EXPECT_SIZE_EQ(expected, actual) \
-{ \
+do { \
EXPECT_EQ((expected).width(), (actual).width()); \
EXPECT_EQ((expected).height(), (actual).height()); \
-}
+} while (false)
#define EXPECT_POINT_EQ(expected, actual) \
-{ \
+do { \
EXPECT_EQ((expected).x(), (actual).x()); \
EXPECT_EQ((expected).y(), (actual).y()); \
-}
+} while (false)
+
+#define EXPECT_VECTOR_EQ(expected, actual) \
+do { \
+ EXPECT_EQ((expected).x(), (actual).x()); \
+ EXPECT_EQ((expected).y(), (actual).y()); \
+} while (false)
// This is a function rather than a macro because when this is included as a macro
// in bulk, it causes a significant slow-down in compilation time. This problem
diff --git a/cc/test/layer_tree_test_common.cc b/cc/test/layer_tree_test_common.cc
index 65a2904..1842d17 100644
--- a/cc/test/layer_tree_test_common.cc
+++ b/cc/test/layer_tree_test_common.cc
@@ -219,7 +219,7 @@ public:
m_testHooks->layout();
}
- virtual void applyScrollAndScale(const IntSize& scrollDelta, float scale) OVERRIDE
+ virtual void applyScrollAndScale(gfx::Vector2d scrollDelta, float scale) OVERRIDE
{
m_testHooks->applyScrollAndScale(scrollDelta, scale);
}
diff --git a/cc/test/layer_tree_test_common.h b/cc/test/layer_tree_test_common.h
index ad044d5..0e02cfa 100644
--- a/cc/test/layer_tree_test_common.h
+++ b/cc/test/layer_tree_test_common.h
@@ -34,7 +34,7 @@ public:
virtual void drawLayersOnThread(cc::LayerTreeHostImpl*) { }
virtual void animateLayers(cc::LayerTreeHostImpl*, base::TimeTicks monotonicTime) { }
virtual void willAnimateLayers(cc::LayerTreeHostImpl*, base::TimeTicks monotonicTime) { }
- virtual void applyScrollAndScale(const cc::IntSize&, float) { }
+ virtual void applyScrollAndScale(gfx::Vector2d, float) { }
virtual void animate(base::TimeTicks monotonicTime) { }
virtual void layout() { }
virtual void didRecreateOutputSurface(bool succeeded) { }