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

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

Issue 465853004: Moving RenderSurface creation outside of CalcDrawProps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 unified diff | Download patch
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"
(...skipping 11 matching lines...) Expand all
22 22
23 class Layer; 23 class Layer;
24 class LayerImpl; 24 class LayerImpl;
25 class RenderSurfaceLayerList; 25 class RenderSurfaceLayerList;
26 26
27 class LayerTreeHostCommonTestBase { 27 class LayerTreeHostCommonTestBase {
28 protected: 28 protected:
29 LayerTreeHostCommonTestBase(); 29 LayerTreeHostCommonTestBase();
30 virtual ~LayerTreeHostCommonTestBase(); 30 virtual ~LayerTreeHostCommonTestBase();
31 31
32 template <typename LayerType>
33 void SetLayerPropertiesForTestingInternal( 32 void SetLayerPropertiesForTestingInternal(
34 LayerType* layer, 33 Layer* layer,
35 const gfx::Transform& transform, 34 const gfx::Transform& transform,
36 const gfx::Point3F& transform_origin, 35 const gfx::Point3F& transform_origin,
37 const gfx::PointF& position, 36 const gfx::PointF& position,
38 const gfx::Size& bounds, 37 const gfx::Size& bounds,
39 bool flatten_transform, 38 bool flatten_transform,
40 bool is_3d_sorted) { 39 bool is_3d_sorted);
41 layer->SetTransform(transform); 40 void SetLayerPropertiesForTestingInternal(
42 layer->SetTransformOrigin(transform_origin); 41 LayerImpl* layer,
43 layer->SetPosition(position); 42 const gfx::Transform& transform,
44 layer->SetBounds(bounds); 43 const gfx::Point3F& transform_origin,
45 layer->SetShouldFlattenTransform(flatten_transform); 44 const gfx::PointF& position,
46 layer->Set3dSortingContextId(is_3d_sorted ? 1 : 0); 45 const gfx::Size& bounds,
47 } 46 bool flatten_transform,
47 bool is_3d_sorted,
48 bool create_render_surface);
48 49
49 void SetLayerPropertiesForTesting(Layer* layer, 50 void SetLayerPropertiesForTesting(Layer* layer,
50 const gfx::Transform& transform, 51 const gfx::Transform& transform,
51 const gfx::Point3F& transform_origin, 52 const gfx::Point3F& transform_origin,
52 const gfx::PointF& position, 53 const gfx::PointF& position,
53 const gfx::Size& bounds, 54 const gfx::Size& bounds,
54 bool flatten_transform, 55 bool flatten_transform,
55 bool is_3d_sorted); 56 bool is_3d_sorted);
56 57
57 void SetLayerPropertiesForTesting(LayerImpl* layer, 58 void SetLayerPropertiesForTesting(LayerImpl* layer,
58 const gfx::Transform& transform, 59 const gfx::Transform& transform,
59 const gfx::Point3F& transform_origin, 60 const gfx::Point3F& transform_origin,
60 const gfx::PointF& position, 61 const gfx::PointF& position,
61 const gfx::Size& bounds, 62 const gfx::Size& bounds,
62 bool flatten_transform, 63 bool flatten_transform,
63 bool is_3d_sorted); 64 bool is_3d_sorted,
65 bool create_render_surface);
64 66
65 void ExecuteCalculateDrawProperties(Layer* root_layer, 67 void ExecuteCalculateDrawProperties(Layer* root_layer,
66 float device_scale_factor, 68 float device_scale_factor,
67 float page_scale_factor, 69 float page_scale_factor,
68 Layer* page_scale_application_layer, 70 Layer* page_scale_application_layer,
69 bool can_use_lcd_text); 71 bool can_use_lcd_text);
70 72
71 void ExecuteCalculateDrawProperties(LayerImpl* root_layer, 73 void ExecuteCalculateDrawProperties(LayerImpl* root_layer,
72 float device_scale_factor, 74 float device_scale_factor,
73 float page_scale_factor, 75 float page_scale_factor,
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 124
123 int render_surface_layer_list_count_; 125 int render_surface_layer_list_count_;
124 }; 126 };
125 127
126 class LayerTreeHostCommonTest : public LayerTreeHostCommonTestBase, 128 class LayerTreeHostCommonTest : public LayerTreeHostCommonTestBase,
127 public testing::Test {}; 129 public testing::Test {};
128 130
129 } // namespace cc 131 } // namespace cc
130 132
131 #endif // CC_TEST_LAYER_TREE_HOST_COMMON_TEST_H_ 133 #endif // CC_TEST_LAYER_TREE_HOST_COMMON_TEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698