| 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/trees/damage_tracker.h" | 5 #include "cc/trees/damage_tracker.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "cc/base/math_util.h" | 9 #include "cc/base/math_util.h" |
| 10 #include "cc/layers/layer_impl.h" | 10 #include "cc/layers/layer_impl.h" |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 // 498.544617) and size 0.056610 x 2.910767. Instead, the correctly | 489 // 498.544617) and size 0.056610 x 2.910767. Instead, the correctly |
| 490 // transformed rect should actually be very huge (i.e. in theory, -infinity | 490 // transformed rect should actually be very huge (i.e. in theory, -infinity |
| 491 // on the left), and positioned so that the right-most bound rect will be | 491 // on the left), and positioned so that the right-most bound rect will be |
| 492 // approximately 501 units in root surface space. | 492 // approximately 501 units in root surface space. |
| 493 // | 493 // |
| 494 | 494 |
| 495 LayerImpl* root = CreateAndSetUpTestTreeWithOneSurface(); | 495 LayerImpl* root = CreateAndSetUpTestTreeWithOneSurface(); |
| 496 LayerImpl* child = root->test_properties()->children[0]; | 496 LayerImpl* child = root->test_properties()->children[0]; |
| 497 | 497 |
| 498 gfx::Transform transform; | 498 gfx::Transform transform; |
| 499 transform.Translate3d(500.0, 500.0, 0.0); | 499 transform.Translate3d(550.0, 500.0, 0.0); |
| 500 transform.ApplyPerspectiveDepth(1.0); | 500 transform.ApplyPerspectiveDepth(1.0); |
| 501 transform.RotateAboutYAxis(45.0); | 501 transform.RotateAboutYAxis(45.0); |
| 502 transform.Translate3d(-50.0, -50.0, 0.0); | 502 transform.Translate3d(-50.0, -50.0, 0.0); |
| 503 | 503 |
| 504 // Set up the child | 504 // Set up the child |
| 505 child->SetPosition(gfx::PointF(0.f, 0.f)); | 505 child->SetPosition(gfx::PointF(0.f, 0.f)); |
| 506 child->SetBounds(gfx::Size(100, 100)); | 506 child->SetBounds(gfx::Size(100, 100)); |
| 507 child->SetTransform(transform); | 507 child->SetTransform(transform); |
| 508 root->layer_tree_impl()->property_trees()->needs_rebuild = true; | 508 root->layer_tree_impl()->property_trees()->needs_rebuild = true; |
| 509 EmulateDrawingOneFrame(root); | 509 EmulateDrawingOneFrame(root); |
| (...skipping 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1628 gfx::Rect root_damage_rect = | 1628 gfx::Rect root_damage_rect = |
| 1629 root->render_surface()->damage_tracker()->current_damage_rect(); | 1629 root->render_surface()->damage_tracker()->current_damage_rect(); |
| 1630 gfx::Rect damage_we_care_about = gfx::Rect(i, i); | 1630 gfx::Rect damage_we_care_about = gfx::Rect(i, i); |
| 1631 EXPECT_LE(damage_we_care_about.right(), root_damage_rect.right()); | 1631 EXPECT_LE(damage_we_care_about.right(), root_damage_rect.right()); |
| 1632 EXPECT_LE(damage_we_care_about.bottom(), root_damage_rect.bottom()); | 1632 EXPECT_LE(damage_we_care_about.bottom(), root_damage_rect.bottom()); |
| 1633 } | 1633 } |
| 1634 } | 1634 } |
| 1635 | 1635 |
| 1636 } // namespace | 1636 } // namespace |
| 1637 } // namespace cc | 1637 } // namespace cc |
| OLD | NEW |