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

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

Issue 139233002: [#4] Pass gfx structs by const ref (gfx::PointF) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Corrected as per review comments! Created 6 years, 11 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 | « cc/trees/layer_tree_host_common.cc ('k') | cc/trees/layer_tree_host_impl.h » ('j') | 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/layer_tree_host_common.h" 5 #include "cc/trees/layer_tree_host_common.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "cc/animation/layer_animation_controller.h" 9 #include "cc/animation/layer_animation_controller.h"
10 #include "cc/base/math_util.h" 10 #include "cc/base/math_util.h"
(...skipping 24 matching lines...) Expand all
35 namespace cc { 35 namespace cc {
36 namespace { 36 namespace {
37 37
38 class LayerTreeHostCommonTestBase { 38 class LayerTreeHostCommonTestBase {
39 protected: 39 protected:
40 template <typename LayerType> 40 template <typename LayerType>
41 void SetLayerPropertiesForTestingInternal( 41 void SetLayerPropertiesForTestingInternal(
42 LayerType* layer, 42 LayerType* layer,
43 const gfx::Transform& transform, 43 const gfx::Transform& transform,
44 const gfx::Transform& sublayer_transform, 44 const gfx::Transform& sublayer_transform,
45 gfx::PointF anchor, 45 const gfx::PointF& anchor,
46 gfx::PointF position, 46 const gfx::PointF& position,
47 gfx::Size bounds, 47 gfx::Size bounds,
48 bool preserves3d) { 48 bool preserves3d) {
49 layer->SetTransform(transform); 49 layer->SetTransform(transform);
50 layer->SetSublayerTransform(sublayer_transform); 50 layer->SetSublayerTransform(sublayer_transform);
51 layer->SetAnchorPoint(anchor); 51 layer->SetAnchorPoint(anchor);
52 layer->SetPosition(position); 52 layer->SetPosition(position);
53 layer->SetBounds(bounds); 53 layer->SetBounds(bounds);
54 layer->SetPreserves3d(preserves3d); 54 layer->SetPreserves3d(preserves3d);
55 } 55 }
56 56
57 void SetLayerPropertiesForTesting(Layer* layer, 57 void SetLayerPropertiesForTesting(Layer* layer,
58 const gfx::Transform& transform, 58 const gfx::Transform& transform,
59 const gfx::Transform& sublayer_transform, 59 const gfx::Transform& sublayer_transform,
60 gfx::PointF anchor, 60 const gfx::PointF& anchor,
61 gfx::PointF position, 61 const gfx::PointF& position,
62 gfx::Size bounds, 62 gfx::Size bounds,
63 bool preserves3d) { 63 bool preserves3d) {
64 SetLayerPropertiesForTestingInternal<Layer>(layer, 64 SetLayerPropertiesForTestingInternal<Layer>(layer,
65 transform, 65 transform,
66 sublayer_transform, 66 sublayer_transform,
67 anchor, 67 anchor,
68 position, 68 position,
69 bounds, 69 bounds,
70 preserves3d); 70 preserves3d);
71 } 71 }
72 72
73 void SetLayerPropertiesForTesting(LayerImpl* layer, 73 void SetLayerPropertiesForTesting(LayerImpl* layer,
74 const gfx::Transform& transform, 74 const gfx::Transform& transform,
75 const gfx::Transform& sublayer_transform, 75 const gfx::Transform& sublayer_transform,
76 gfx::PointF anchor, 76 const gfx::PointF& anchor,
77 gfx::PointF position, 77 const gfx::PointF& position,
78 gfx::Size bounds, 78 gfx::Size bounds,
79 bool preserves3d) { 79 bool preserves3d) {
80 SetLayerPropertiesForTestingInternal<LayerImpl>(layer, 80 SetLayerPropertiesForTestingInternal<LayerImpl>(layer,
81 transform, 81 transform,
82 sublayer_transform, 82 sublayer_transform,
83 anchor, 83 anchor,
84 position, 84 position,
85 bounds, 85 bounds,
86 preserves3d); 86 preserves3d);
87 layer->SetContentBounds(bounds); 87 layer->SetContentBounds(bounds);
(...skipping 9652 matching lines...) Expand 10 before | Expand all | Expand 10 after
9740 fixed_layer->draw_properties().screen_space_transform.To2dTranslation(), 9740 fixed_layer->draw_properties().screen_space_transform.To2dTranslation(),
9741 container_offset); 9741 container_offset);
9742 EXPECT_VECTOR_EQ(scroll_layer->draw_properties() 9742 EXPECT_VECTOR_EQ(scroll_layer->draw_properties()
9743 .screen_space_transform.To2dTranslation(), 9743 .screen_space_transform.To2dTranslation(),
9744 container_offset - rounded_scroll_delta); 9744 container_offset - rounded_scroll_delta);
9745 } 9745 }
9746 } 9746 }
9747 9747
9748 } // namespace 9748 } // namespace
9749 } // namespace cc 9749 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_common.cc ('k') | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698