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

Side by Side Diff: cc/occlusion_tracker_unittest.cc

Issue 11418197: Move temporary MathUtil wrappers to permanent home in gfx::Transform (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: patch for landing Created 8 years 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
« no previous file with comments | « cc/math_util_unittest.cc ('k') | ui/gfx/transform.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <public/WebFilterOperation.h> 7 #include <public/WebFilterOperation.h>
8 #include <public/WebFilterOperations.h> 8 #include <public/WebFilterOperations.h>
9 9
10 #include "cc/layer.h" 10 #include "cc/layer.h"
(...skipping 1916 matching lines...) Expand 10 before | Expand all | Expand 10 after
1927 1927
1928 template<class Types> 1928 template<class Types>
1929 class OcclusionTrackerTestPerspectiveTransform : public OcclusionTrackerTest<Typ es> { 1929 class OcclusionTrackerTestPerspectiveTransform : public OcclusionTrackerTest<Typ es> {
1930 protected: 1930 protected:
1931 OcclusionTrackerTestPerspectiveTransform(bool opaqueLayers) : OcclusionTrack erTest<Types>(opaqueLayers) {} 1931 OcclusionTrackerTestPerspectiveTransform(bool opaqueLayers) : OcclusionTrack erTest<Types>(opaqueLayers) {}
1932 void runMyTest() 1932 void runMyTest()
1933 { 1933 {
1934 gfx::Transform transform; 1934 gfx::Transform transform;
1935 transform.Translate(150, 150); 1935 transform.Translate(150, 150);
1936 transform.ApplyPerspectiveDepth(400); 1936 transform.ApplyPerspectiveDepth(400);
1937 MathUtil::rotateAxisAngle(&transform, 1, 0, 0, -30); 1937 transform.RotateAboutXAxis(-30);
1938 transform.Translate(-150, -150); 1938 transform.Translate(-150, -150);
1939 1939
1940 typename Types::ContentLayerType* parent = this->createRoot(this->identi tyMatrix, gfx::PointF(0, 0), gfx::Size(300, 300)); 1940 typename Types::ContentLayerType* parent = this->createRoot(this->identi tyMatrix, gfx::PointF(0, 0), gfx::Size(300, 300));
1941 typename Types::LayerType* container = this->createLayer(parent, this->i dentityMatrix, gfx::PointF(0, 0), gfx::Size(300, 300)); 1941 typename Types::LayerType* container = this->createLayer(parent, this->i dentityMatrix, gfx::PointF(0, 0), gfx::Size(300, 300));
1942 typename Types::ContentLayerType* layer = this->createDrawingLayer(conta iner, transform, gfx::PointF(100, 100), gfx::Size(200, 200), true); 1942 typename Types::ContentLayerType* layer = this->createDrawingLayer(conta iner, transform, gfx::PointF(100, 100), gfx::Size(200, 200), true);
1943 container->setPreserves3D(true); 1943 container->setPreserves3D(true);
1944 layer->setPreserves3D(true); 1944 layer->setPreserves3D(true);
1945 this->calcDrawEtc(parent); 1945 this->calcDrawEtc(parent);
1946 1946
1947 TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types:: RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000)); 1947 TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types:: RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
(...skipping 11 matching lines...) Expand all
1959 protected: 1959 protected:
1960 OcclusionTrackerTestPerspectiveTransformBehindCamera(bool opaqueLayers) : Oc clusionTrackerTest<Types>(opaqueLayers) {} 1960 OcclusionTrackerTestPerspectiveTransformBehindCamera(bool opaqueLayers) : Oc clusionTrackerTest<Types>(opaqueLayers) {}
1961 void runMyTest() 1961 void runMyTest()
1962 { 1962 {
1963 // This test is based on the platform/chromium/compositing/3d-corners.ht ml layout test. 1963 // This test is based on the platform/chromium/compositing/3d-corners.ht ml layout test.
1964 gfx::Transform transform; 1964 gfx::Transform transform;
1965 transform.Translate(250, 50); 1965 transform.Translate(250, 50);
1966 transform.ApplyPerspectiveDepth(10); 1966 transform.ApplyPerspectiveDepth(10);
1967 transform.Translate(-250, -50); 1967 transform.Translate(-250, -50);
1968 transform.Translate(250, 50); 1968 transform.Translate(250, 50);
1969 MathUtil::rotateAxisAngle(&transform, 1, 0, 0, -167); 1969 transform.RotateAboutXAxis(-167);
1970 transform.Translate(-250, -50); 1970 transform.Translate(-250, -50);
1971 1971
1972 typename Types::ContentLayerType* parent = this->createRoot(this->identi tyMatrix, gfx::PointF(0, 0), gfx::Size(500, 100)); 1972 typename Types::ContentLayerType* parent = this->createRoot(this->identi tyMatrix, gfx::PointF(0, 0), gfx::Size(500, 100));
1973 typename Types::LayerType* container = this->createLayer(parent, this->i dentityMatrix, gfx::PointF(0, 0), gfx::Size(500, 500)); 1973 typename Types::LayerType* container = this->createLayer(parent, this->i dentityMatrix, gfx::PointF(0, 0), gfx::Size(500, 500));
1974 typename Types::ContentLayerType* layer = this->createDrawingLayer(conta iner, transform, gfx::PointF(0, 0), gfx::Size(500, 500), true); 1974 typename Types::ContentLayerType* layer = this->createDrawingLayer(conta iner, transform, gfx::PointF(0, 0), gfx::Size(500, 500), true);
1975 container->setPreserves3D(true); 1975 container->setPreserves3D(true);
1976 layer->setPreserves3D(true); 1976 layer->setPreserves3D(true);
1977 this->calcDrawEtc(parent); 1977 this->calcDrawEtc(parent);
1978 1978
1979 TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types:: RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000)); 1979 TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types:: RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
(...skipping 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after
3073 3073
3074 EXPECT_EQ(gfx::Rect(gfx::Point(), trackingSize).ToString(), occlusion.oc clusionInScreenSpace().ToString()); 3074 EXPECT_EQ(gfx::Rect(gfx::Point(), trackingSize).ToString(), occlusion.oc clusionInScreenSpace().ToString());
3075 EXPECT_EQ(gfx::Rect(gfx::Point(), trackingSize).ToString(), occlusion.oc clusionInTargetSurface().ToString()); 3075 EXPECT_EQ(gfx::Rect(gfx::Point(), trackingSize).ToString(), occlusion.oc clusionInTargetSurface().ToString());
3076 } 3076 }
3077 }; 3077 };
3078 3078
3079 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestMinimumTrackingSize); 3079 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestMinimumTrackingSize);
3080 3080
3081 } // namespace 3081 } // namespace
3082 } // namespace cc 3082 } // namespace cc
OLDNEW
« no previous file with comments | « cc/math_util_unittest.cc ('k') | ui/gfx/transform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698