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

Side by Side Diff: cc/layer_tree_host_impl_unittest.cc

Issue 11774005: Migrate more functions from MathUtil to gfx::Transform (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/layer_tree_host_impl.h" 5 #include "cc/layer_tree_host_impl.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after
1185 } 1185 }
1186 1186
1187 TEST_P(LayerTreeHostImplTest, scrollMissesBackfacingChild) 1187 TEST_P(LayerTreeHostImplTest, scrollMissesBackfacingChild)
1188 { 1188 {
1189 gfx::Size surfaceSize(10, 10); 1189 gfx::Size surfaceSize(10, 10);
1190 scoped_ptr<LayerImpl> root = LayerImpl::create(m_hostImpl->activeTree(), 1); 1190 scoped_ptr<LayerImpl> root = LayerImpl::create(m_hostImpl->activeTree(), 1);
1191 scoped_ptr<LayerImpl> child = createScrollableLayer(2, surfaceSize); 1191 scoped_ptr<LayerImpl> child = createScrollableLayer(2, surfaceSize);
1192 m_hostImpl->setViewportSize(surfaceSize, surfaceSize); 1192 m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
1193 1193
1194 gfx::Transform matrix; 1194 gfx::Transform matrix;
1195 MathUtil::rotateEulerAngles(&matrix, 180, 0, 0); 1195 matrix.RotateAboutXAxis(180);
1196 child->setTransform(matrix); 1196 child->setTransform(matrix);
1197 child->setDoubleSided(false); 1197 child->setDoubleSided(false);
1198 1198
1199 root->addChild(child.Pass()); 1199 root->addChild(child.Pass());
1200 m_hostImpl->activeTree()->SetRootLayer(root.Pass()); 1200 m_hostImpl->activeTree()->SetRootLayer(root.Pass());
1201 initializeRendererAndDrawFrame(); 1201 initializeRendererAndDrawFrame();
1202 1202
1203 // Scroll event is ignored because the scrollable layer is not facing the vi ewer and there is 1203 // Scroll event is ignored because the scrollable layer is not facing the vi ewer and there is
1204 // nothing scrollable behind it. 1204 // nothing scrollable behind it.
1205 EXPECT_EQ(m_hostImpl->scrollBegin(gfx::Point(5, 5), InputHandlerClient::Whee l), InputHandlerClient::ScrollIgnored); 1205 EXPECT_EQ(m_hostImpl->scrollBegin(gfx::Point(5, 5), InputHandlerClient::Whee l), InputHandlerClient::ScrollIgnored);
(...skipping 3134 matching lines...) Expand 10 before | Expand all | Expand 10 after
4340 gfx::Rect noDamage = gfx::Rect(m_hostImpl->deviceViewportSize()); 4340 gfx::Rect noDamage = gfx::Rect(m_hostImpl->deviceViewportSize());
4341 drawFrameAndTestDamage(noDamage); 4341 drawFrameAndTestDamage(noDamage);
4342 } 4342 }
4343 4343
4344 INSTANTIATE_TEST_CASE_P(LayerTreeHostImplTests, 4344 INSTANTIATE_TEST_CASE_P(LayerTreeHostImplTests,
4345 LayerTreeHostImplTest, 4345 LayerTreeHostImplTest,
4346 ::testing::Values(false, true)); 4346 ::testing::Values(false, true));
4347 4347
4348 } // namespace 4348 } // namespace
4349 } // namespace cc 4349 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698