| 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 6479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6490 | 6490 |
| 6491 not_affected_by_page_scale_.push_back(root->id()); | 6491 not_affected_by_page_scale_.push_back(root->id()); |
| 6492 not_affected_by_page_scale_.push_back(pre_page_scale->id()); | 6492 not_affected_by_page_scale_.push_back(pre_page_scale->id()); |
| 6493 not_affected_by_page_scale_.push_back(post_page_scale->id()); | 6493 not_affected_by_page_scale_.push_back(post_page_scale->id()); |
| 6494 } | 6494 } |
| 6495 | 6495 |
| 6496 void BeginTest() override { PostSetNeedsCommitToMainThread(); } | 6496 void BeginTest() override { PostSetNeedsCommitToMainThread(); } |
| 6497 | 6497 |
| 6498 void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { | 6498 void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { |
| 6499 LayerTreeHostCommon::CallFunctionForEveryLayer( | 6499 LayerTreeHostCommon::CallFunctionForEveryLayer( |
| 6500 host_impl->sync_tree(), [this](LayerImpl* layer) { | 6500 host_impl->sync_tree(), |
| 6501 [this](LayerImpl* layer) { |
| 6501 const std::vector<int>& list = | 6502 const std::vector<int>& list = |
| 6502 layer->IsAffectedByPageScale() | 6503 layer->IsAffectedByPageScale() |
| 6503 ? this->affected_by_page_scale_ | 6504 ? this->affected_by_page_scale_ |
| 6504 : this->not_affected_by_page_scale_; | 6505 : this->not_affected_by_page_scale_; |
| 6505 EXPECT_TRUE(std::find(list.begin(), list.end(), layer->id()) != | 6506 EXPECT_TRUE(std::find(list.begin(), list.end(), layer->id()) != |
| 6506 list.end()); | 6507 list.end()); |
| 6507 }); | 6508 }, |
| 6509 CallFunctionLayerType::ALL_LAYERS); |
| 6508 | 6510 |
| 6509 EndTest(); | 6511 EndTest(); |
| 6510 } | 6512 } |
| 6511 | 6513 |
| 6512 void AfterTest() override {} | 6514 void AfterTest() override {} |
| 6513 | 6515 |
| 6514 std::vector<int> affected_by_page_scale_; | 6516 std::vector<int> affected_by_page_scale_; |
| 6515 std::vector<int> not_affected_by_page_scale_; | 6517 std::vector<int> not_affected_by_page_scale_; |
| 6516 }; | 6518 }; |
| 6517 | 6519 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6616 EndTest(); | 6618 EndTest(); |
| 6617 } | 6619 } |
| 6618 | 6620 |
| 6619 void AfterTest() override {} | 6621 void AfterTest() override {} |
| 6620 }; | 6622 }; |
| 6621 | 6623 |
| 6622 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor); | 6624 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor); |
| 6623 | 6625 |
| 6624 } // namespace | 6626 } // namespace |
| 6625 } // namespace cc | 6627 } // namespace cc |
| OLD | NEW |