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

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

Issue 687873004: Introduce Property Trees (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@wip-awoloszyn2
Patch Set: ComputeTransform now inits result to identity. Created 6 years 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
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/layer_tree_host_common.h" 5 #include "cc/trees/layer_tree_host_common.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <tuple>
9 10
10 #include "cc/animation/layer_animation_controller.h" 11 #include "cc/animation/layer_animation_controller.h"
11 #include "cc/animation/transform_operations.h" 12 #include "cc/animation/transform_operations.h"
12 #include "cc/base/math_util.h" 13 #include "cc/base/math_util.h"
13 #include "cc/layers/content_layer.h" 14 #include "cc/layers/content_layer.h"
14 #include "cc/layers/content_layer_client.h" 15 #include "cc/layers/content_layer_client.h"
15 #include "cc/layers/layer.h" 16 #include "cc/layers/layer.h"
16 #include "cc/layers/layer_client.h" 17 #include "cc/layers/layer_client.h"
17 #include "cc/layers/layer_impl.h" 18 #include "cc/layers/layer_impl.h"
18 #include "cc/layers/layer_iterator.h" 19 #include "cc/layers/layer_iterator.h"
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 replica_layer_transform.Scale3d(3.0, 3.0, 1.0); 664 replica_layer_transform.Scale3d(3.0, 3.0, 1.0);
664 gfx::Vector2dF parent_composite_scale = 665 gfx::Vector2dF parent_composite_scale =
665 MathUtil::ComputeTransform2dScaleComponents(parent_composite_transform, 666 MathUtil::ComputeTransform2dScaleComponents(parent_composite_transform,
666 1.f); 667 1.f);
667 gfx::Transform surface_sublayer_transform; 668 gfx::Transform surface_sublayer_transform;
668 surface_sublayer_transform.Scale(parent_composite_scale.x(), 669 surface_sublayer_transform.Scale(parent_composite_scale.x(),
669 parent_composite_scale.y()); 670 parent_composite_scale.y());
670 gfx::Transform replica_composite_transform = 671 gfx::Transform replica_composite_transform =
671 parent_composite_transform * replica_layer_transform * 672 parent_composite_transform * replica_layer_transform *
672 Inverse(surface_sublayer_transform); 673 Inverse(surface_sublayer_transform);
673 674 child_replica->SetIsDrawable(true);
674 // Child's render surface should not exist yet. 675 // Child's render surface should not exist yet.
675 ASSERT_FALSE(child->render_surface()); 676 ASSERT_FALSE(child->render_surface());
676 677
677 SetLayerPropertiesForTesting(parent.get(), 678 SetLayerPropertiesForTesting(parent.get(),
678 parent_layer_transform, 679 parent_layer_transform,
679 gfx::Point3F(2.5f, 3.0f, 0.f), 680 gfx::Point3F(2.5f, 3.0f, 0.f),
680 gfx::PointF(), 681 gfx::PointF(),
681 gfx::Size(10, 12), 682 gfx::Size(10, 12),
682 true, 683 true,
683 false); 684 false);
(...skipping 8035 matching lines...) Expand 10 before | Expand all | Expand 10 after
8719 8720
8720 LayerTreeHostCommon::CalculateDrawProperties(&inputs); 8721 LayerTreeHostCommon::CalculateDrawProperties(&inputs);
8721 8722
8722 gfx::Rect affected_by_delta(0, 0, root_size.width(), 8723 gfx::Rect affected_by_delta(0, 0, root_size.width(),
8723 root_size.height() + 50); 8724 root_size.height() + 50);
8724 EXPECT_EQ(affected_by_delta, sublayer->visible_content_rect()); 8725 EXPECT_EQ(affected_by_delta, sublayer->visible_content_rect());
8725 } 8726 }
8726 8727
8727 } // namespace 8728 } // namespace
8728 } // namespace cc 8729 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698