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

Side by Side Diff: cc/test/layer_tree_host_common_test.h

Issue 295193002: Get rid of graphics layer anchor points, and replace with transform origin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nit. Created 6 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 | Annotate | Revision Log
« no previous file with comments | « cc/test/fake_picture_layer.cc ('k') | cc/test/layer_tree_host_common_test.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef CC_TEST_LAYER_TREE_HOST_COMMON_TEST_H_ 5 #ifndef CC_TEST_LAYER_TREE_HOST_COMMON_TEST_H_
6 #define CC_TEST_LAYER_TREE_HOST_COMMON_TEST_H_ 6 #define CC_TEST_LAYER_TREE_HOST_COMMON_TEST_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "cc/layers/layer_lists.h" 11 #include "cc/layers/layer_lists.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 13
14 namespace gfx { 14 namespace gfx {
15 class PointF; 15 class PointF;
16 class Point3F;
16 class Size; 17 class Size;
17 class Transform; 18 class Transform;
18 } 19 }
19 20
20 namespace cc { 21 namespace cc {
21 22
22 class Layer; 23 class Layer;
23 class LayerImpl; 24 class LayerImpl;
24 class RenderSurfaceLayerList; 25 class RenderSurfaceLayerList;
25 26
26 class LayerTreeHostCommonTestBase { 27 class LayerTreeHostCommonTestBase {
27 protected: 28 protected:
28 LayerTreeHostCommonTestBase(); 29 LayerTreeHostCommonTestBase();
29 virtual ~LayerTreeHostCommonTestBase(); 30 virtual ~LayerTreeHostCommonTestBase();
30 31
31 template <typename LayerType> 32 template <typename LayerType>
32 void SetLayerPropertiesForTestingInternal(LayerType* layer, 33 void SetLayerPropertiesForTestingInternal(
33 const gfx::Transform& transform, 34 LayerType* layer,
34 const gfx::PointF& anchor, 35 const gfx::Transform& transform,
35 const gfx::PointF& position, 36 const gfx::Point3F& transform_origin,
36 const gfx::Size& bounds, 37 const gfx::PointF& position,
37 bool flatten_transform, 38 const gfx::Size& bounds,
38 bool is_3d_sorted) { 39 bool flatten_transform,
40 bool is_3d_sorted) {
39 layer->SetTransform(transform); 41 layer->SetTransform(transform);
40 layer->SetAnchorPoint(anchor); 42 layer->SetTransformOrigin(transform_origin);
41 layer->SetPosition(position); 43 layer->SetPosition(position);
42 layer->SetBounds(bounds); 44 layer->SetBounds(bounds);
43 layer->SetShouldFlattenTransform(flatten_transform); 45 layer->SetShouldFlattenTransform(flatten_transform);
44 layer->SetIs3dSorted(is_3d_sorted); 46 layer->SetIs3dSorted(is_3d_sorted);
45 } 47 }
46 48
47 void SetLayerPropertiesForTesting(Layer* layer, 49 void SetLayerPropertiesForTesting(Layer* layer,
48 const gfx::Transform& transform, 50 const gfx::Transform& transform,
49 const gfx::PointF& anchor, 51 const gfx::Point3F& transform_origin,
50 const gfx::PointF& position, 52 const gfx::PointF& position,
51 const gfx::Size& bounds, 53 const gfx::Size& bounds,
52 bool flatten_transform, 54 bool flatten_transform,
53 bool is_3d_sorted); 55 bool is_3d_sorted);
54 56
55 void SetLayerPropertiesForTesting(LayerImpl* layer, 57 void SetLayerPropertiesForTesting(LayerImpl* layer,
56 const gfx::Transform& transform, 58 const gfx::Transform& transform,
57 const gfx::PointF& anchor, 59 const gfx::Point3F& transform_origin,
58 const gfx::PointF& position, 60 const gfx::PointF& position,
59 const gfx::Size& bounds, 61 const gfx::Size& bounds,
60 bool flatten_transform, 62 bool flatten_transform,
61 bool is_3d_sorted); 63 bool is_3d_sorted);
62 64
63 void ExecuteCalculateDrawProperties(Layer* root_layer, 65 void ExecuteCalculateDrawProperties(Layer* root_layer,
64 float device_scale_factor, 66 float device_scale_factor,
65 float page_scale_factor, 67 float page_scale_factor,
66 Layer* page_scale_application_layer, 68 Layer* page_scale_application_layer,
67 bool can_use_lcd_text); 69 bool can_use_lcd_text);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 122
121 int render_surface_layer_list_count_; 123 int render_surface_layer_list_count_;
122 }; 124 };
123 125
124 class LayerTreeHostCommonTest : public LayerTreeHostCommonTestBase, 126 class LayerTreeHostCommonTest : public LayerTreeHostCommonTestBase,
125 public testing::Test {}; 127 public testing::Test {};
126 128
127 } // namespace cc 129 } // namespace cc
128 130
129 #endif // CC_TEST_LAYER_TREE_HOST_COMMON_TEST_H_ 131 #endif // CC_TEST_LAYER_TREE_HOST_COMMON_TEST_H_
OLDNEW
« no previous file with comments | « cc/test/fake_picture_layer.cc ('k') | cc/test/layer_tree_host_common_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698