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

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: fix rebase 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
Index: cc/test/layer_test_common.cc
diff --git a/cc/test/layer_test_common.cc b/cc/test/layer_test_common.cc
index b7c415b7c6e5ee77f1efc8365a6bd813f4f192cf..ef314b62f2ae8eecd162959a4059d17b32dee02e 100644
--- a/cc/test/layer_test_common.cc
+++ b/cc/test/layer_test_common.cc
@@ -9,6 +9,7 @@
#include "cc/layers/append_quads_data.h"
#include "cc/quads/draw_quad.h"
#include "cc/quads/render_pass.h"
+#include "cc/quads/render_pass_draw_quad.h"
#include "cc/test/fake_output_surface.h"
#include "cc/test/mock_occlusion_tracker.h"
#include "cc/trees/layer_tree_host_common.h"
@@ -40,8 +41,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 +61,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());
@@ -70,13 +75,15 @@ void LayerTestCommon::VerifyQuadsCoverRectWithOcclusion(
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) {
- EXPECT_FALSE(occluded.Contains(quads[i]->visible_rect));
+ for (QuadList::ConstIterator iter = quads.begin(); iter != quads.end();
+ ++iter) {
+ EXPECT_FALSE(occluded.Contains(iter->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);

Powered by Google App Engine
This is Rietveld 408576698