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

Side by Side Diff: cc/layers/surface_layer_unittest.cc

Issue 2151433004: cc: Make LayerTreeHostImpl::SwapBuffers not virtual. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@removedidswap
Patch Set: novirtualswapbuffers: num_draws_ Created 4 years, 5 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 | « no previous file | cc/layers/texture_layer_unittest.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 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 #include <stdint.h> 5 #include <stdint.h>
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 layer_tree_host()->SetRootLayer(blank_layer_); 184 layer_tree_host()->SetRootLayer(blank_layer_);
185 break; 185 break;
186 case 2: 186 case 2:
187 break; 187 break;
188 default: 188 default:
189 NOTREACHED(); 189 NOTREACHED();
190 break; 190 break;
191 } 191 }
192 } 192 }
193 193
194 void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override { 194 void SwapBuffersCompleteOnThread() override {
195 EXPECT_TRUE(result);
196 std::vector<uint32_t>& satisfied = 195 std::vector<uint32_t>& satisfied =
197 output_surface()->last_sent_frame()->metadata.satisfies_sequences; 196 output_surface()->last_sent_frame()->metadata.satisfies_sequences;
198 EXPECT_LE(satisfied.size(), 1u); 197 EXPECT_LE(satisfied.size(), 1u);
199 if (satisfied.size() == 1) { 198 if (satisfied.size() == 1) {
200 // Eventually the one SurfaceSequence should be satisfied, but only 199 // Eventually the one SurfaceSequence should be satisfied, but only
201 // after the layer was removed from the tree, and only once. 200 // after the layer was removed from the tree, and only once.
202 EXPECT_EQ(1u, satisfied[0]); 201 EXPECT_EQ(1u, satisfied[0]);
203 EXPECT_LE(1, commit_count_); 202 EXPECT_LE(1, commit_count_);
204 EXPECT_FALSE(sequence_was_satisfied_); 203 EXPECT_FALSE(sequence_was_satisfied_);
205 sequence_was_satisfied_ = true; 204 sequence_was_satisfied_ = true;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 EXPECT_EQ(1u, required_set_.size()); 252 EXPECT_EQ(1u, required_set_.size());
254 // Sequence should have been satisfied with the callback. 253 // Sequence should have been satisfied with the callback.
255 EXPECT_TRUE(satisfied_sequence_ == SurfaceSequence(1u, 1u)); 254 EXPECT_TRUE(satisfied_sequence_ == SurfaceSequence(1u, 1u));
256 } 255 }
257 }; 256 };
258 257
259 MULTI_THREAD_TEST_F(SurfaceLayerSwapPromiseWithoutDraw); 258 MULTI_THREAD_TEST_F(SurfaceLayerSwapPromiseWithoutDraw);
260 259
261 } // namespace 260 } // namespace
262 } // namespace cc 261 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/layers/texture_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698