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

Side by Side Diff: cc/trees/damage_tracker_unittest.cc

Issue 2075933002: Improve DamageTrackerTest.VerifyDamageForPerspectiveClippedLayer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698