OLD | NEW |
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/damage_tracker.h" | 5 #include "cc/damage_tracker.h" |
6 | 6 |
7 #include "cc/layer_impl.h" | 7 #include "cc/layer_impl.h" |
8 #include "cc/layer_tree_host_common.h" | 8 #include "cc/layer_tree_host_common.h" |
9 #include "cc/math_util.h" | 9 #include "cc/math_util.h" |
10 #include "cc/single_thread_proxy.h" | 10 #include "cc/single_thread_proxy.h" |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 // Instead, the correctly transformed rect should actually be very huge (i.e
. in theory, -infinity on the left), | 334 // Instead, the correctly transformed rect should actually be very huge (i.e
. in theory, -infinity on the left), |
335 // and positioned so that the right-most bound rect will be approximately 50
1 units in root surface space. | 335 // and positioned so that the right-most bound rect will be approximately 50
1 units in root surface space. |
336 // | 336 // |
337 | 337 |
338 scoped_ptr<LayerImpl> root = createAndSetUpTestTreeWithOneSurface(); | 338 scoped_ptr<LayerImpl> root = createAndSetUpTestTreeWithOneSurface(); |
339 LayerImpl* child = root->children()[0]; | 339 LayerImpl* child = root->children()[0]; |
340 | 340 |
341 gfx::Transform transform; | 341 gfx::Transform transform; |
342 transform.Translate3d(500, 500, 0); | 342 transform.Translate3d(500, 500, 0); |
343 transform.ApplyPerspectiveDepth(1); | 343 transform.ApplyPerspectiveDepth(1); |
344 MathUtil::rotateEulerAngles(&transform, 0, 45, 0); | 344 transform.RotateAboutYAxis(45); |
345 transform.Translate3d(-50, -50, 0); | 345 transform.Translate3d(-50, -50, 0); |
346 | 346 |
347 // Set up the child | 347 // Set up the child |
348 child->setPosition(gfx::PointF(0, 0)); | 348 child->setPosition(gfx::PointF(0, 0)); |
349 child->setBounds(gfx::Size(100, 100)); | 349 child->setBounds(gfx::Size(100, 100)); |
350 child->setContentBounds(gfx::Size(100, 100)); | 350 child->setContentBounds(gfx::Size(100, 100)); |
351 child->setTransform(transform); | 351 child->setTransform(transform); |
352 emulateDrawingOneFrame(root.get()); | 352 emulateDrawingOneFrame(root.get()); |
353 | 353 |
354 // Sanity check that the child layer's bounds would actually get clipped by
w < 0, | 354 // Sanity check that the child layer's bounds would actually get clipped by
w < 0, |
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1162 EXPECT_TRUE(rootDamageRect.IsEmpty()); | 1162 EXPECT_TRUE(rootDamageRect.IsEmpty()); |
1163 | 1163 |
1164 // Damage should remain empty even after one frame, since there's yet no new
damage | 1164 // Damage should remain empty even after one frame, since there's yet no new
damage |
1165 emulateDrawingOneFrame(root.get()); | 1165 emulateDrawingOneFrame(root.get()); |
1166 rootDamageRect = root->renderSurface()->damageTracker()->currentDamageRect()
; | 1166 rootDamageRect = root->renderSurface()->damageTracker()->currentDamageRect()
; |
1167 EXPECT_TRUE(rootDamageRect.IsEmpty()); | 1167 EXPECT_TRUE(rootDamageRect.IsEmpty()); |
1168 } | 1168 } |
1169 | 1169 |
1170 } // namespace | 1170 } // namespace |
1171 } // namespace cc | 1171 } // namespace cc |
OLD | NEW |