| Index: cc/quads/render_pass_unittest.cc
|
| diff --git a/cc/quads/render_pass_unittest.cc b/cc/quads/render_pass_unittest.cc
|
| index ea2db7d8095c224d7082919f756f18338a816e54..3c4d8d41aed7d1e6ad56a7da8119c1d0f1f41e44 100644
|
| --- a/cc/quads/render_pass_unittest.cc
|
| +++ b/cc/quads/render_pass_unittest.cc
|
| @@ -28,6 +28,8 @@ struct RenderPassSize {
|
| gfx::Transform transform_to_root_target;
|
| gfx::Rect output_rect;
|
| gfx::Rect damage_rect;
|
| + FilterOperations filters;
|
| + FilterOperations background_filters;
|
| bool has_transparent_background;
|
| std::vector<std::unique_ptr<CopyOutputRequest>> copy_callbacks;
|
| };
|
| @@ -44,6 +46,8 @@ static void CompareRenderPassLists(const RenderPassList& expected_list,
|
| EXPECT_EQ(expected->transform_to_root_target,
|
| actual->transform_to_root_target);
|
| EXPECT_EQ(expected->damage_rect, actual->damage_rect);
|
| + EXPECT_EQ(expected->filters, actual->filters);
|
| + EXPECT_EQ(expected->background_filters, expected->background_filters);
|
| EXPECT_EQ(expected->has_transparent_background,
|
| actual->has_transparent_background);
|
|
|
| @@ -68,14 +72,15 @@ TEST(RenderPassTest, CopyShouldBeIdenticalExceptIdAndQuads) {
|
| gfx::Transform transform_to_root =
|
| gfx::Transform(1.0, 0.5, 0.5, -0.5, -1.0, 0.0);
|
| gfx::Rect damage_rect(56, 123, 19, 43);
|
| + FilterOperations filters;
|
| + filters.Append(FilterOperation::CreateOpacityFilter(0.5));
|
| + FilterOperations background_filters;
|
| + background_filters.Append(FilterOperation::CreateInvertFilter(1.0));
|
| bool has_transparent_background = true;
|
|
|
| std::unique_ptr<RenderPass> pass = RenderPass::Create();
|
| - pass->SetAll(id,
|
| - output_rect,
|
| - damage_rect,
|
| - transform_to_root,
|
| - has_transparent_background);
|
| + pass->SetAll(id, output_rect, damage_rect, transform_to_root, filters,
|
| + background_filters, has_transparent_background);
|
| pass->copy_requests.push_back(CopyOutputRequest::CreateEmptyRequest());
|
|
|
| // Stick a quad in the pass, this should not get copied.
|
| @@ -95,6 +100,8 @@ TEST(RenderPassTest, CopyShouldBeIdenticalExceptIdAndQuads) {
|
| EXPECT_EQ(pass->output_rect, copy->output_rect);
|
| EXPECT_EQ(pass->transform_to_root_target, copy->transform_to_root_target);
|
| EXPECT_EQ(pass->damage_rect, copy->damage_rect);
|
| + EXPECT_EQ(pass->filters, copy->filters);
|
| + EXPECT_EQ(pass->background_filters, copy->background_filters);
|
| EXPECT_EQ(pass->has_transparent_background, copy->has_transparent_background);
|
| EXPECT_EQ(0u, copy->quad_list.size());
|
|
|
| @@ -113,14 +120,15 @@ TEST(RenderPassTest, CopyAllShouldBeIdentical) {
|
| gfx::Transform transform_to_root =
|
| gfx::Transform(1.0, 0.5, 0.5, -0.5, -1.0, 0.0);
|
| gfx::Rect damage_rect(56, 123, 19, 43);
|
| + FilterOperations filters;
|
| + filters.Append(FilterOperation::CreateOpacityFilter(0.5));
|
| + FilterOperations background_filters;
|
| + background_filters.Append(FilterOperation::CreateInvertFilter(1.0));
|
| bool has_transparent_background = true;
|
|
|
| std::unique_ptr<RenderPass> pass = RenderPass::Create();
|
| - pass->SetAll(id,
|
| - output_rect,
|
| - damage_rect,
|
| - transform_to_root,
|
| - has_transparent_background);
|
| + pass->SetAll(id, output_rect, damage_rect, transform_to_root, filters,
|
| + background_filters, has_transparent_background);
|
|
|
| // Two quads using one shared state.
|
| SharedQuadState* shared_state1 = pass->CreateAndAppendSharedQuadState();
|
| @@ -162,13 +170,16 @@ TEST(RenderPassTest, CopyAllShouldBeIdentical) {
|
| gfx::Transform contrib_transform_to_root =
|
| gfx::Transform(1.0, 0.5, 0.5, -0.5, -1.0, 0.0);
|
| gfx::Rect contrib_damage_rect(11, 16, 10, 15);
|
| + FilterOperations contrib_filters;
|
| + contrib_filters.Append(FilterOperation::CreateSepiaFilter(0.5));
|
| + FilterOperations contrib_background_filters;
|
| + contrib_background_filters.Append(FilterOperation::CreateSaturateFilter(1));
|
| bool contrib_has_transparent_background = true;
|
|
|
| std::unique_ptr<RenderPass> contrib = RenderPass::Create();
|
| - contrib->SetAll(contrib_id,
|
| - contrib_output_rect,
|
| - contrib_damage_rect,
|
| - contrib_transform_to_root,
|
| + contrib->SetAll(contrib_id, contrib_output_rect, contrib_damage_rect,
|
| + contrib_transform_to_root, contrib_filters,
|
| + contrib_background_filters,
|
| contrib_has_transparent_background);
|
|
|
| SharedQuadState* contrib_shared_state =
|
| @@ -187,8 +198,7 @@ TEST(RenderPassTest, CopyAllShouldBeIdentical) {
|
| base::WrapUnique(new RenderPassDrawQuad);
|
| pass_quad->SetNew(pass->shared_quad_state_list.back(), contrib_output_rect,
|
| contrib_output_rect, contrib_id, 0, gfx::Vector2dF(),
|
| - gfx::Size(), FilterOperations(), gfx::Vector2dF(),
|
| - gfx::PointF(), FilterOperations());
|
| + gfx::Size(), gfx::Vector2dF(), gfx::PointF());
|
|
|
| pass_list.push_back(std::move(pass));
|
| pass_list.push_back(std::move(contrib));
|
| @@ -208,14 +218,15 @@ TEST(RenderPassTest, CopyAllWithCulledQuads) {
|
| gfx::Transform transform_to_root =
|
| gfx::Transform(1.0, 0.5, 0.5, -0.5, -1.0, 0.0);
|
| gfx::Rect damage_rect(56, 123, 19, 43);
|
| + FilterOperations filters;
|
| + filters.Append(FilterOperation::CreateOpacityFilter(0.5));
|
| + FilterOperations background_filters;
|
| + background_filters.Append(FilterOperation::CreateInvertFilter(1.0));
|
| bool has_transparent_background = true;
|
|
|
| std::unique_ptr<RenderPass> pass = RenderPass::Create();
|
| - pass->SetAll(id,
|
| - output_rect,
|
| - damage_rect,
|
| - transform_to_root,
|
| - has_transparent_background);
|
| + pass->SetAll(id, output_rect, damage_rect, transform_to_root, filters,
|
| + background_filters, has_transparent_background);
|
|
|
| // A shared state with a quad.
|
| SharedQuadState* shared_state1 = pass->CreateAndAppendSharedQuadState();
|
|
|