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

Side by Side Diff: cc/quads/list_container_unittest.cc

Issue 551013002: Use Custome ListContainer to Allocate SharedQuadState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@DQAllo
Patch Set: rebase 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
« no previous file with comments | « cc/quads/list_container.cc ('k') | cc/quads/render_pass.h » ('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 "cc/quads/list_container.h" 5 #include "cc/quads/list_container.h"
6 6
7 #include <vector> 7 #include <vector>
8 #include "cc/quads/draw_quad.h" 8 #include "cc/quads/draw_quad.h"
9 #include "cc/quads/largest_draw_quad.h" 9 #include "cc/quads/largest_draw_quad.h"
10 #include "cc/quads/render_pass_draw_quad.h" 10 #include "cc/quads/render_pass_draw_quad.h"
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 } 518 }
519 519
520 int i = 0; 520 int i = 0;
521 for (std::vector<SimpleDrawQuad*>::const_iterator dq_iter = dq_list.begin(); 521 for (std::vector<SimpleDrawQuad*>::const_iterator dq_iter = dq_list.begin();
522 dq_iter != dq_list.end(); 522 dq_iter != dq_list.end();
523 ++dq_iter, ++i) { 523 ++dq_iter, ++i) {
524 EXPECT_EQ(i, (*dq_iter)->get_value()); 524 EXPECT_EQ(i, (*dq_iter)->get_value());
525 } 525 }
526 } 526 }
527 527
528 TEST(ListContainerTest,
529 SimpleIterationAndReverseIterationWithIndexSharedQuadState) {
530 ListContainer<SharedQuadState> list;
531 std::vector<SharedQuadState*> sqs_list;
532 size_t size = 10;
533 for (size_t i = 0; i < size; ++i) {
534 sqs_list.push_back(list.AllocateAndConstruct<SharedQuadState>());
535 }
536 EXPECT_EQ(size, list.size());
537
538 size_t i = 0;
539 for (ListContainer<SharedQuadState>::Iterator iter = list.begin();
540 iter != list.end();
541 ++iter) {
542 EXPECT_EQ(i, iter.index());
543 ++i;
544 }
545
546 i = 0;
547 for (ListContainer<SharedQuadState>::ReverseIterator iter = list.rbegin();
548 iter != list.rend();
549 ++iter) {
550 EXPECT_EQ(i, iter.index());
551 ++i;
552 }
553 }
554
528 } // namespace 555 } // namespace
529 } // namespace cc 556 } // namespace cc
OLDNEW
« no previous file with comments | « cc/quads/list_container.cc ('k') | cc/quads/render_pass.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698