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

Side by Side Diff: cc/surfaces/surface_aggregator_test_helpers.cc

Issue 551013002: Use Custome ListContainer to Allocate SharedQuadState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@DQAllo
Patch Set: use C++ range based loop Created 6 years, 2 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
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 "cc/surfaces/surface_aggregator_test_helpers.h" 5 #include "cc/surfaces/surface_aggregator_test_helpers.h"
6 6
7 #include "base/format_macros.h" 7 #include "base/format_macros.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "cc/layers/append_quads_data.h" 9 #include "cc/layers/append_quads_data.h"
10 #include "cc/output/compositor_frame.h" 10 #include "cc/output/compositor_frame.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 break; 127 break;
128 } 128 }
129 default: 129 default:
130 NOTREACHED(); 130 NOTREACHED();
131 break; 131 break;
132 } 132 }
133 } 133 }
134 134
135 void TestPassMatchesExpectations(Pass expected_pass, const RenderPass* pass) { 135 void TestPassMatchesExpectations(Pass expected_pass, const RenderPass* pass) {
136 ASSERT_EQ(expected_pass.quad_count, pass->quad_list.size()); 136 ASSERT_EQ(expected_pass.quad_count, pass->quad_list.size());
137 size_t i = 0;
138 for (QuadList::ConstIterator iter = pass->quad_list.begin(); 137 for (QuadList::ConstIterator iter = pass->quad_list.begin();
139 iter != pass->quad_list.end(); 138 iter != pass->quad_list.end();
140 ++iter) { 139 ++iter) {
141 SCOPED_TRACE(base::StringPrintf("Quad number %" PRIuS, i)); 140 SCOPED_TRACE(base::StringPrintf("Quad number %" PRIuS, iter.index()));
142 TestQuadMatchesExpectations(expected_pass.quads[i], &*iter); 141 TestQuadMatchesExpectations(expected_pass.quads[iter.index()], &*iter);
143 ++i;
144 } 142 }
145 } 143 }
146 144
147 void TestPassesMatchExpectations(Pass* expected_passes, 145 void TestPassesMatchExpectations(Pass* expected_passes,
148 size_t expected_pass_count, 146 size_t expected_pass_count,
149 const RenderPassList* passes) { 147 const RenderPassList* passes) {
150 ASSERT_EQ(expected_pass_count, passes->size()); 148 ASSERT_EQ(expected_pass_count, passes->size());
151 149
152 for (size_t i = 0; i < passes->size(); ++i) { 150 for (size_t i = 0; i < passes->size(); ++i) {
153 SCOPED_TRACE(base::StringPrintf("Pass number %" PRIuS, i)); 151 SCOPED_TRACE(base::StringPrintf("Pass number %" PRIuS, i));
154 RenderPass* pass = passes->at(i); 152 RenderPass* pass = passes->at(i);
155 TestPassMatchesExpectations(expected_passes[i], pass); 153 TestPassMatchesExpectations(expected_passes[i], pass);
156 } 154 }
157 } 155 }
158 156
159 } // namespace test 157 } // namespace test
160 } // namespace cc 158 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698