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

Side by Side Diff: cc/trees/layer_tree_host_unittest.cc

Issue 1907053004: cc: Make CallFunctionForEveryLayer use LayerListIterator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: FindLayers should skip layers instead of returning when switching from call-function to iteration l… Created 4 years, 8 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
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_host_unittest_serialization.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 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
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
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
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_host_unittest_serialization.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698