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

Unified Diff: cc/surfaces/surface_aggregator_unittest.cc

Issue 551013002: Use Custome ListContainer to Allocate SharedQuadState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@DQAllo
Patch Set: use ElementAt for unittest 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/surfaces/surface_aggregator_unittest.cc
diff --git a/cc/surfaces/surface_aggregator_unittest.cc b/cc/surfaces/surface_aggregator_unittest.cc
index 28111525d7d75f46dd81319237ae6c9160a1f4b2..57949a478129722260fe6a1ac47432e08cbf859d 100644
--- a/cc/surfaces/surface_aggregator_unittest.cc
+++ b/cc/surfaces/surface_aggregator_unittest.cc
@@ -745,12 +745,12 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, AggregateMultiplePassWithTransform) {
RenderPass* child_nonroot_pass = child_pass_list.at(0u);
child_nonroot_pass->transform_to_root_target.Translate(8, 0);
SharedQuadState* child_nonroot_pass_sqs =
- child_nonroot_pass->shared_quad_state_list[0];
+ child_nonroot_pass->shared_quad_state_list.front();
child_nonroot_pass_sqs->content_to_target_transform.Translate(5, 0);
RenderPass* child_root_pass = child_pass_list.at(1u);
SharedQuadState* child_root_pass_sqs =
- child_root_pass->shared_quad_state_list[0];
+ child_root_pass->shared_quad_state_list.front();
child_root_pass_sqs->content_to_target_transform.Translate(8, 0);
child_root_pass_sqs->is_clipped = true;
child_root_pass_sqs->clip_rect = gfx::Rect(0, 0, 5, 5);
@@ -774,10 +774,10 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, AggregateMultiplePassWithTransform) {
arraysize(root_passes));
root_pass_list.at(0)
- ->shared_quad_state_list[0]
+ ->shared_quad_state_list.front()
->content_to_target_transform.Translate(0, 7);
root_pass_list.at(0)
- ->shared_quad_state_list[1]
+ ->shared_quad_state_list.ElementAt(1)
->content_to_target_transform.Translate(0, 10);
scoped_ptr<DelegatedFrameData> root_frame_data(new DelegatedFrameData);
@@ -848,14 +848,14 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, AggregateMultiplePassWithTransform) {
i++;
}
- EXPECT_EQ(true,
- aggregated_pass_list[1]->shared_quad_state_list[1]->is_clipped);
+ SharedQuadStateList::Iterator sqs_iter =
+ aggregated_pass_list[1]->shared_quad_state_list.begin();
+ ++sqs_iter;
danakj 2014/09/26 20:40:55 ElementAt
weiliangc 2014/10/01 23:02:00 Done.
+ EXPECT_EQ(true, sqs_iter->is_clipped);
// The second quad in the root pass is aggregated from the child, so its
// clip rect must be transformed by the child's translation.
- EXPECT_EQ(
- gfx::Rect(0, 10, 5, 5).ToString(),
- aggregated_pass_list[1]->shared_quad_state_list[1]->clip_rect.ToString());
+ EXPECT_EQ(gfx::Rect(0, 10, 5, 5).ToString(), sqs_iter->clip_rect.ToString());
danakj 2014/09/26 20:40:55 ElementAt
weiliangc 2014/10/01 23:02:00 Done.
factory_.Destroy(child_surface_id);
}
@@ -877,7 +877,7 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, AggregateDamageRect) {
RenderPass* child_root_pass = child_pass_list.at(0u);
SharedQuadState* child_root_pass_sqs =
- child_root_pass->shared_quad_state_list[0];
+ child_root_pass->shared_quad_state_list.front();
child_root_pass_sqs->content_to_target_transform.Translate(8, 0);
scoped_ptr<DelegatedFrameData> child_frame_data(new DelegatedFrameData);
@@ -898,7 +898,7 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, AggregateDamageRect) {
arraysize(root_passes));
root_pass_list.at(0)
- ->shared_quad_state_list[0]
+ ->shared_quad_state_list.front()
->content_to_target_transform.Translate(0, 10);
root_pass_list.at(0)->damage_rect = gfx::Rect(5, 5, 10, 10);
@@ -934,7 +934,7 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, AggregateDamageRect) {
RenderPass* child_root_pass = child_pass_list.at(0u);
SharedQuadState* child_root_pass_sqs =
- child_root_pass->shared_quad_state_list[0];
+ child_root_pass->shared_quad_state_list.front();
child_root_pass_sqs->content_to_target_transform.Translate(8, 0);
child_root_pass->damage_rect = gfx::Rect(10, 10, 10, 10);
@@ -973,7 +973,7 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, AggregateDamageRect) {
arraysize(root_passes));
root_pass_list.at(0)
- ->shared_quad_state_list[0]
+ ->shared_quad_state_list.front()
->content_to_target_transform.Translate(0, 10);
root_pass_list.at(0)->damage_rect = gfx::Rect(0, 0, 1, 1);
@@ -994,7 +994,7 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, AggregateDamageRect) {
arraysize(root_passes));
root_pass_list.at(0)
- ->shared_quad_state_list[0]
+ ->shared_quad_state_list.front()
->content_to_target_transform.Translate(0, 10);
root_pass_list.at(0)->damage_rect = gfx::Rect(1, 1, 1, 1);

Powered by Google App Engine
This is Rietveld 408576698