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

Side by Side Diff: cc/occlusion_tracker_unittest.cc

Issue 11774005: Migrate more functions from MathUtil to gfx::Transform (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Converted constructors to row-major input 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/occlusion_tracker.h" 5 #include "cc/occlusion_tracker.h"
6 6
7 #include "cc/layer.h" 7 #include "cc/layer.h"
8 #include "cc/layer_animation_controller.h" 8 #include "cc/layer_animation_controller.h"
9 #include "cc/layer_impl.h" 9 #include "cc/layer_impl.h"
10 #include "cc/layer_tree_host_common.h" 10 #include "cc/layer_tree_host_common.h"
(...skipping 1869 matching lines...) Expand 10 before | Expand all | Expand 10 after
1880 1880
1881 MAIN_AND_IMPL_THREAD_TEST(OcclusionTrackerTestOpaqueContentsRegionNonEmpty); 1881 MAIN_AND_IMPL_THREAD_TEST(OcclusionTrackerTestOpaqueContentsRegionNonEmpty);
1882 1882
1883 template<class Types> 1883 template<class Types>
1884 class OcclusionTrackerTest3dTransform : public OcclusionTrackerTest<Types> { 1884 class OcclusionTrackerTest3dTransform : public OcclusionTrackerTest<Types> {
1885 protected: 1885 protected:
1886 OcclusionTrackerTest3dTransform(bool opaqueLayers) : OcclusionTrackerTest<Ty pes>(opaqueLayers) {} 1886 OcclusionTrackerTest3dTransform(bool opaqueLayers) : OcclusionTrackerTest<Ty pes>(opaqueLayers) {}
1887 void runMyTest() 1887 void runMyTest()
1888 { 1888 {
1889 gfx::Transform transform; 1889 gfx::Transform transform;
1890 MathUtil::rotateEulerAngles(&transform, 0, 30, 0); 1890 transform.RotateAboutYAxis(30);
1891 1891
1892 typename Types::ContentLayerType* parent = this->createRoot(this->identi tyMatrix, gfx::PointF(0, 0), gfx::Size(300, 300)); 1892 typename Types::ContentLayerType* parent = this->createRoot(this->identi tyMatrix, gfx::PointF(0, 0), gfx::Size(300, 300));
1893 typename Types::LayerType* container = this->createLayer(parent, this->i dentityMatrix, gfx::PointF(0, 0), gfx::Size(300, 300)); 1893 typename Types::LayerType* container = this->createLayer(parent, this->i dentityMatrix, gfx::PointF(0, 0), gfx::Size(300, 300));
1894 typename Types::ContentLayerType* layer = this->createDrawingLayer(conta iner, transform, gfx::PointF(100, 100), gfx::Size(200, 200), true); 1894 typename Types::ContentLayerType* layer = this->createDrawingLayer(conta iner, transform, gfx::PointF(100, 100), gfx::Size(200, 200), true);
1895 this->calcDrawEtc(parent); 1895 this->calcDrawEtc(parent);
1896 1896
1897 TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types:: RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000)); 1897 TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types:: RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
1898 this->enterLayer(layer, occlusion); 1898 this->enterLayer(layer, occlusion);
1899 1899
1900 // The layer is rotated in 3d but without preserving 3d, so it only gets resized. 1900 // The layer is rotated in 3d but without preserving 3d, so it only gets resized.
(...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after
3117 3117
3118 EXPECT_EQ(gfx::Rect().ToString(), occlusion.occlusionFromOutsideTarget() .ToString()); 3118 EXPECT_EQ(gfx::Rect().ToString(), occlusion.occlusionFromOutsideTarget() .ToString());
3119 EXPECT_EQ(gfx::Rect(gfx::Point(), trackingSize).ToString(), occlusion.oc clusionFromInsideTarget().ToString()); 3119 EXPECT_EQ(gfx::Rect(gfx::Point(), trackingSize).ToString(), occlusion.oc clusionFromInsideTarget().ToString());
3120 } 3120 }
3121 }; 3121 };
3122 3122
3123 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestMinimumTrackingSize); 3123 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestMinimumTrackingSize);
3124 3124
3125 } // namespace 3125 } // namespace
3126 } // namespace cc 3126 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698