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

Unified Diff: cc/trees/layer_tree_impl_unittest.cc

Issue 2334003003: cc : Compute visible rects dynamically (1) (Closed)
Patch Set: comment Created 4 years, 3 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/trees/layer_tree_impl.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_impl_unittest.cc
diff --git a/cc/trees/layer_tree_impl_unittest.cc b/cc/trees/layer_tree_impl_unittest.cc
index d5cdd3cff11459f737fa0ca34a52dd4f0d78cfd9..eb790b4ffb351e06e2cce9ae080d1538264bf77f 100644
--- a/cc/trees/layer_tree_impl_unittest.cc
+++ b/cc/trees/layer_tree_impl_unittest.cc
@@ -40,7 +40,9 @@ class LayerTreeImplTest : public testing::Test {
return host_impl().active_tree()->RenderSurfaceLayerList();
}
- void ExecuteCalculateDrawProperties(LayerImpl* root_layer) {
+ void ExecuteCalculateDrawProperties(
+ LayerImpl* root_layer,
+ bool skip_verify_visible_rect_calculations = false) {
// We are probably not testing what is intended if the root_layer bounds are
// empty.
DCHECK(!root_layer->bounds().IsEmpty());
@@ -49,6 +51,8 @@ class LayerTreeImplTest : public testing::Test {
LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs(
root_layer, root_layer->bounds(), &render_surface_layer_list_impl_);
inputs.can_adjust_raster_scales = true;
+ if (skip_verify_visible_rect_calculations)
+ inputs.verify_visible_rect_calculations = false;
LayerTreeHostCommon::CalculateDrawPropertiesForTesting(&inputs);
}
@@ -620,6 +624,10 @@ TEST_F(LayerTreeImplTest, HitTestingForMultiClippedRotatedLayer) {
root->SetBounds(gfx::Size(100, 100));
root->SetMasksToBounds(true);
+ // Visible rects computed by combinig clips in target space and root space
+ // don't match because of rotation transforms. So, we skip
+ // verify_visible_rect_calculations.
+ bool skip_verify_visible_rect_calculations = true;
{
std::unique_ptr<LayerImpl> child =
LayerImpl::Create(host_impl().active_tree(), 456);
@@ -659,11 +667,12 @@ TEST_F(LayerTreeImplTest, HitTestingForMultiClippedRotatedLayer) {
child->test_properties()->AddChild(std::move(grand_child));
root->test_properties()->AddChild(std::move(child));
- ExecuteCalculateDrawProperties(root);
+ ExecuteCalculateDrawProperties(root, skip_verify_visible_rect_calculations);
}
host_impl().SetViewportSize(root->bounds());
- host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree();
+ host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(
+ skip_verify_visible_rect_calculations);
// (11, 89) is close to the the bottom left corner within the clip, but it is
// not inside the layer.
gfx::PointF test_point(11.f, 89.f);
« no previous file with comments | « cc/trees/layer_tree_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698