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

Unified Diff: cc/test/layer_test_common.cc

Issue 448303002: Use custom ListContainer to allocate DrawQuads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@perftest
Patch Set: change header files to try fix compile error Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/test/fake_delegated_renderer_layer_impl.cc ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/layer_test_common.cc
diff --git a/cc/test/layer_test_common.cc b/cc/test/layer_test_common.cc
index 1eedb963ebbb2b66512a2f248d97c09319525078..be3606fae90efc8875a2131af8fc949771bd7bd8 100644
--- a/cc/test/layer_test_common.cc
+++ b/cc/test/layer_test_common.cc
@@ -40,8 +40,10 @@ void LayerTestCommon::VerifyQuadsExactlyCoverRect(const QuadList& quads,
const gfx::Rect& rect) {
Region remaining = rect;
- for (size_t i = 0; i < quads.size(); ++i) {
- DrawQuad* quad = quads[i];
+ size_t i = 0;
+ for (QuadList::ConstIterator iter = quads.begin(); iter != quads.end();
+ ++iter) {
+ const DrawQuad* quad = &*iter;
gfx::RectF quad_rectf =
MathUtil::MapClippedRect(quad->quadTransform(), gfx::RectF(quad->rect));
@@ -58,6 +60,8 @@ void LayerTestCommon::VerifyQuadsExactlyCoverRect(const QuadList& quads,
<< quad_string << i << " remaining: " << remaining.ToString()
<< " quad: " << quad_rect.ToString();
remaining.Subtract(quad_rect);
+
+ ++i;
}
EXPECT_TRUE(remaining.IsEmpty());
@@ -68,15 +72,17 @@ void LayerTestCommon::VerifyQuadsAreOccluded(const QuadList& quads,
const gfx::Rect& occluded,
size_t* partially_occluded_count) {
// No quad should exist if it's fully occluded.
- for (size_t i = 0; i < quads.size(); ++i) {
+ for (QuadList::ConstIterator iter = quads.begin(); iter != quads.end();
+ ++iter) {
gfx::Rect target_visible_rect = MathUtil::MapEnclosingClippedRect(
- quads[i]->quadTransform(), quads[i]->visible_rect);
+ iter->quadTransform(), iter->visible_rect);
EXPECT_FALSE(occluded.Contains(target_visible_rect));
}
// Quads that are fully occluded on one axis only should be shrunken.
- for (size_t i = 0; i < quads.size(); ++i) {
- DrawQuad* quad = quads[i];
+ for (QuadList::ConstIterator iter = quads.begin(); iter != quads.end();
+ ++iter) {
+ const DrawQuad* quad = &*iter;
DCHECK(quad->quadTransform().IsIdentityOrIntegerTranslation());
gfx::Rect target_rect =
MathUtil::MapEnclosingClippedRect(quad->quadTransform(), quad->rect);
« no previous file with comments | « cc/test/fake_delegated_renderer_layer_impl.cc ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698