Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(735)

Unified Diff: cc/render_surface_unittest.cc

Issue 11308153: Migrate most of cc/ from WebKit::WebTransformationMatrix to gfx::Transform (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased to tip of tree and addressed feedback Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/render_surface_unittest.cc
diff --git a/cc/render_surface_unittest.cc b/cc/render_surface_unittest.cc
index 837a3dbd91fe8bd9e3f7088ea789cc1081635ccc..e1ea2491cb6b7d27299d65f02098a0496946d6d1 100644
--- a/cc/render_surface_unittest.cc
+++ b/cc/render_surface_unittest.cc
@@ -14,9 +14,9 @@
#include "cc/test/mock_quad_culler.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include <public/WebTransformationMatrix.h>
+#include "ui/gfx/transform.h"
-using WebKit::WebTransformationMatrix;
+using gfx::Transform;
namespace cc {
namespace {
@@ -58,8 +58,8 @@ TEST(RenderSurfaceTest, verifySurfaceChangesAreTrackedProperly)
EXECUTE_AND_VERIFY_SURFACE_DID_NOT_CHANGE(renderSurface->setContentRect(testRect));
scoped_ptr<LayerImpl> dummyMask = LayerImpl::create(1);
- WebTransformationMatrix dummyMatrix;
- dummyMatrix.translate(1.0, 2.0);
+ Transform dummyMatrix;
+ dummyMatrix.PreconcatTranslate(1.0, 2.0);
// The rest of the surface properties are either internal and should not cause change,
// or they are already accounted for by the owninglayer->layerPropertyChanged().
@@ -83,9 +83,9 @@ TEST(RenderSurfaceTest, sanityCheckSurfaceCreatesCorrectSharedQuadState)
gfx::Rect contentRect = gfx::Rect(gfx::Point(), gfx::Size(50, 50));
gfx::Rect clipRect = gfx::Rect(gfx::Point(5, 5), gfx::Size(40, 40));
- WebTransformationMatrix origin;
+ Transform origin;
- origin.translate(30, 40);
+ origin.PreconcatTranslate(30, 40);
renderSurface->setDrawTransform(origin);
renderSurface->setContentRect(contentRect);
@@ -103,8 +103,8 @@ TEST(RenderSurfaceTest, sanityCheckSurfaceCreatesCorrectSharedQuadState)
ASSERT_EQ(1u, sharedStateList.size());
SharedQuadState* sharedQuadState = sharedStateList[0];
- EXPECT_EQ(30, sharedQuadState->content_to_target_transform.m41());
- EXPECT_EQ(40, sharedQuadState->content_to_target_transform.m42());
+ EXPECT_EQ(30, sharedQuadState->content_to_target_transform.matrix().getDouble(0, 3));
+ EXPECT_EQ(40, sharedQuadState->content_to_target_transform.matrix().getDouble(1, 3));
EXPECT_RECT_EQ(contentRect, gfx::Rect(sharedQuadState->visible_content_rect));
EXPECT_EQ(1, sharedQuadState->opacity);
}
@@ -132,8 +132,8 @@ TEST(RenderSurfaceTest, sanityCheckSurfaceCreatesCorrectRenderPass)
rootLayer->addChild(owningLayer.Pass());
gfx::Rect contentRect = gfx::Rect(gfx::Point(), gfx::Size(50, 50));
- WebTransformationMatrix origin;
- origin.translate(30, 40);
+ Transform origin;
+ origin.PreconcatTranslate(30, 40);
renderSurface->setScreenSpaceTransform(origin);
renderSurface->setContentRect(contentRect);

Powered by Google App Engine
This is Rietveld 408576698