| OLD | NEW |
| 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.h" | 5 #include "cc/trees/layer_tree_host.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 6159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6170 | 6170 |
| 6171 not_affected_by_page_scale_.push_back(root->id()); | 6171 not_affected_by_page_scale_.push_back(root->id()); |
| 6172 not_affected_by_page_scale_.push_back(pre_page_scale->id()); | 6172 not_affected_by_page_scale_.push_back(pre_page_scale->id()); |
| 6173 not_affected_by_page_scale_.push_back(post_page_scale->id()); | 6173 not_affected_by_page_scale_.push_back(post_page_scale->id()); |
| 6174 } | 6174 } |
| 6175 | 6175 |
| 6176 void BeginTest() override { PostSetNeedsCommitToMainThread(); } | 6176 void BeginTest() override { PostSetNeedsCommitToMainThread(); } |
| 6177 | 6177 |
| 6178 void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { | 6178 void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { |
| 6179 LayerTreeHostCommon::CallFunctionForEveryLayer( | 6179 LayerTreeHostCommon::CallFunctionForEveryLayer( |
| 6180 host_impl->sync_tree(), | 6180 host_impl->sync_tree(), [this](LayerImpl* layer) { |
| 6181 [this](LayerImpl* layer) { | |
| 6182 const std::vector<int>& list = | 6181 const std::vector<int>& list = |
| 6183 layer->IsAffectedByPageScale() | 6182 layer->IsAffectedByPageScale() |
| 6184 ? this->affected_by_page_scale_ | 6183 ? this->affected_by_page_scale_ |
| 6185 : this->not_affected_by_page_scale_; | 6184 : this->not_affected_by_page_scale_; |
| 6186 EXPECT_TRUE(std::find(list.begin(), list.end(), layer->id()) != | 6185 EXPECT_TRUE(std::find(list.begin(), list.end(), layer->id()) != |
| 6187 list.end()); | 6186 list.end()); |
| 6188 }, | 6187 }); |
| 6189 CallFunctionLayerType::ALL_LAYERS); | |
| 6190 | 6188 |
| 6191 EndTest(); | 6189 EndTest(); |
| 6192 } | 6190 } |
| 6193 | 6191 |
| 6194 void AfterTest() override {} | 6192 void AfterTest() override {} |
| 6195 | 6193 |
| 6196 std::vector<int> affected_by_page_scale_; | 6194 std::vector<int> affected_by_page_scale_; |
| 6197 std::vector<int> not_affected_by_page_scale_; | 6195 std::vector<int> not_affected_by_page_scale_; |
| 6198 }; | 6196 }; |
| 6199 | 6197 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6298 EndTest(); | 6296 EndTest(); |
| 6299 } | 6297 } |
| 6300 | 6298 |
| 6301 void AfterTest() override {} | 6299 void AfterTest() override {} |
| 6302 }; | 6300 }; |
| 6303 | 6301 |
| 6304 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor); | 6302 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor); |
| 6305 | 6303 |
| 6306 } // namespace | 6304 } // namespace |
| 6307 } // namespace cc | 6305 } // namespace cc |
| OLD | NEW |