| OLD | NEW |
| 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 <algorithm> | 8 #include <algorithm> |
| 9 #include <memory> |
| 9 #include <vector> | 10 #include <vector> |
| 10 | 11 |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "cc/layers/layer_collections.h" | 12 #include "cc/layers/layer_collections.h" |
| 13 #include "cc/test/fake_layer_tree_host_client.h" | 13 #include "cc/test/fake_layer_tree_host_client.h" |
| 14 #include "cc/test/layer_test_common.h" | 14 #include "cc/test/layer_test_common.h" |
| 15 #include "cc/test/test_task_graph_runner.h" | 15 #include "cc/test/test_task_graph_runner.h" |
| 16 #include "cc/trees/layer_tree_settings.h" | 16 #include "cc/trees/layer_tree_settings.h" |
| 17 #include "cc/trees/property_tree.h" | 17 #include "cc/trees/property_tree.h" |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 19 | 19 |
| 20 namespace gfx { | 20 namespace gfx { |
| 21 class PointF; | 21 class PointF; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 } | 136 } |
| 137 | 137 |
| 138 const LayerList& update_layer_list() const { return update_layer_list_; } | 138 const LayerList& update_layer_list() const { return update_layer_list_; } |
| 139 bool UpdateLayerListContains(int id) const; | 139 bool UpdateLayerListContains(int id) const; |
| 140 | 140 |
| 141 int render_surface_layer_list_count() const { | 141 int render_surface_layer_list_count() const { |
| 142 return render_surface_layer_list_count_; | 142 return render_surface_layer_list_count_; |
| 143 } | 143 } |
| 144 | 144 |
| 145 private: | 145 private: |
| 146 scoped_ptr<std::vector<LayerImpl*>> render_surface_layer_list_impl_; | 146 std::unique_ptr<std::vector<LayerImpl*>> render_surface_layer_list_impl_; |
| 147 LayerList update_layer_list_; | 147 LayerList update_layer_list_; |
| 148 scoped_ptr<LayerImplList> update_layer_list_impl_; | 148 std::unique_ptr<LayerImplList> update_layer_list_impl_; |
| 149 | 149 |
| 150 int render_surface_layer_list_count_; | 150 int render_surface_layer_list_count_; |
| 151 }; | 151 }; |
| 152 | 152 |
| 153 class LayerTreeHostCommonTest : public LayerTreeHostCommonTestBase, | 153 class LayerTreeHostCommonTest : public LayerTreeHostCommonTestBase, |
| 154 public testing::Test { | 154 public testing::Test { |
| 155 public: | 155 public: |
| 156 LayerTreeHostCommonTest(); | 156 LayerTreeHostCommonTest(); |
| 157 explicit LayerTreeHostCommonTest(const LayerTreeSettings& settings); | 157 explicit LayerTreeHostCommonTest(const LayerTreeSettings& settings); |
| 158 | 158 |
| 159 protected: | 159 protected: |
| 160 static void SetScrollOffsetDelta(LayerImpl* layer_impl, | 160 static void SetScrollOffsetDelta(LayerImpl* layer_impl, |
| 161 const gfx::Vector2dF& delta) { | 161 const gfx::Vector2dF& delta) { |
| 162 if (layer_impl->layer_tree_impl() | 162 if (layer_impl->layer_tree_impl() |
| 163 ->property_trees() | 163 ->property_trees() |
| 164 ->scroll_tree.SetScrollOffsetDeltaForTesting(layer_impl->id(), | 164 ->scroll_tree.SetScrollOffsetDeltaForTesting(layer_impl->id(), |
| 165 delta)) | 165 delta)) |
| 166 layer_impl->layer_tree_impl()->DidUpdateScrollOffset( | 166 layer_impl->layer_tree_impl()->DidUpdateScrollOffset( |
| 167 layer_impl->id(), layer_impl->transform_tree_index()); | 167 layer_impl->id(), layer_impl->transform_tree_index()); |
| 168 } | 168 } |
| 169 }; | 169 }; |
| 170 | 170 |
| 171 } // namespace cc | 171 } // namespace cc |
| 172 | 172 |
| 173 #endif // CC_TEST_LAYER_TREE_HOST_COMMON_TEST_H_ | 173 #endif // CC_TEST_LAYER_TREE_HOST_COMMON_TEST_H_ |
| OLD | NEW |