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

Unified Diff: cc/trees/layer_tree_host_common_unittest.cc

Issue 2721743003: Remove unused utility methods. (Closed)
Patch Set: names Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/base/math_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_common_unittest.cc
diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc
index ed9c242b68386d43fd351d9226f4b8c73677186b..23d6fa4b04bbc41d25cd81d7d379a3bbbaea626e 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -2966,6 +2966,21 @@ TEST_F(LayerTreeHostCommonDrawRectsTest,
drawing_layer->drawable_content_rect());
}
+static bool ProjectionClips(const gfx::Transform& map_transform,
+ const gfx::RectF& mapped_rect) {
+ gfx::Transform inverse(Inverse(map_transform));
+ bool clipped = false;
+ if (!clipped)
+ MathUtil::ProjectPoint(inverse, mapped_rect.top_right(), &clipped);
+ if (!clipped)
+ MathUtil::ProjectPoint(inverse, mapped_rect.origin(), &clipped);
+ if (!clipped)
+ MathUtil::ProjectPoint(inverse, mapped_rect.bottom_right(), &clipped);
+ if (!clipped)
+ MathUtil::ProjectPoint(inverse, mapped_rect.bottom_left(), &clipped);
+ return clipped;
+}
+
TEST_F(LayerTreeHostCommonDrawRectsTest, DrawRectsForPerspectiveUnprojection) {
// To determine visible rect in layer space, there needs to be an
// un-projection from surface space to layer space. When the original
@@ -2988,12 +3003,9 @@ TEST_F(LayerTreeHostCommonDrawRectsTest, DrawRectsForPerspectiveUnprojection) {
// Sanity check that un-projection does indeed cause w < 0, otherwise this
// code is not testing the intended scenario.
- bool clipped;
gfx::RectF clipped_rect = MathUtil::MapClippedRect(
layer_to_surface_transform, gfx::RectF(layer_content_rect));
- MathUtil::ProjectQuad(
- Inverse(layer_to_surface_transform), gfx::QuadF(clipped_rect), &clipped);
- ASSERT_TRUE(clipped);
+ ASSERT_TRUE(ProjectionClips(layer_to_surface_transform, clipped_rect));
// Only the corner of the layer is not visible on the surface because of being
// clipped. But, the net result of rounding visible region to an axis-aligned
« no previous file with comments | « cc/base/math_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698