OLD | NEW |
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/test/surface_aggregator_test_helpers.h" | 5 #include "cc/test/surface_aggregator_test_helpers.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 } | 47 } |
48 void AddRenderPassQuad(RenderPass* pass, RenderPassId render_pass_id) { | 48 void AddRenderPassQuad(RenderPass* pass, RenderPassId render_pass_id) { |
49 gfx::Rect output_rect = gfx::Rect(0, 0, 5, 5); | 49 gfx::Rect output_rect = gfx::Rect(0, 0, 5, 5); |
50 SharedQuadState* shared_state = pass->CreateAndAppendSharedQuadState(); | 50 SharedQuadState* shared_state = pass->CreateAndAppendSharedQuadState(); |
51 shared_state->SetAll(gfx::Transform(), output_rect.size(), output_rect, | 51 shared_state->SetAll(gfx::Transform(), output_rect.size(), output_rect, |
52 output_rect, false, 1, SkXfermode::kSrcOver_Mode, 0); | 52 output_rect, false, 1, SkXfermode::kSrcOver_Mode, 0); |
53 RenderPassDrawQuad* quad = | 53 RenderPassDrawQuad* quad = |
54 pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>(); | 54 pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>(); |
55 quad->SetNew(shared_state, output_rect, output_rect, render_pass_id, 0, | 55 quad->SetNew(shared_state, output_rect, output_rect, render_pass_id, 0, |
56 gfx::Vector2dF(), gfx::Size(), FilterOperations(), | 56 gfx::Vector2dF(), gfx::Size(), FilterOperations(), |
57 gfx::Vector2dF(), FilterOperations()); | 57 gfx::Vector2dF(), gfx::PointF(), FilterOperations()); |
58 } | 58 } |
59 | 59 |
60 void AddQuadInPass(RenderPass* pass, Quad desc) { | 60 void AddQuadInPass(RenderPass* pass, Quad desc) { |
61 switch (desc.material) { | 61 switch (desc.material) { |
62 case DrawQuad::SOLID_COLOR: | 62 case DrawQuad::SOLID_COLOR: |
63 AddQuad(pass, gfx::Rect(0, 0, 5, 5), desc.color); | 63 AddQuad(pass, gfx::Rect(0, 0, 5, 5), desc.color); |
64 break; | 64 break; |
65 case DrawQuad::SURFACE_CONTENT: | 65 case DrawQuad::SURFACE_CONTENT: |
66 AddSurfaceQuad(pass, gfx::Size(5, 5), desc.opacity, desc.surface_id); | 66 AddSurfaceQuad(pass, gfx::Size(5, 5), desc.opacity, desc.surface_id); |
67 break; | 67 break; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 | 130 |
131 for (size_t i = 0; i < passes->size(); ++i) { | 131 for (size_t i = 0; i < passes->size(); ++i) { |
132 SCOPED_TRACE(base::StringPrintf("Pass number %" PRIuS, i)); | 132 SCOPED_TRACE(base::StringPrintf("Pass number %" PRIuS, i)); |
133 RenderPass* pass = (*passes)[i].get(); | 133 RenderPass* pass = (*passes)[i].get(); |
134 TestPassMatchesExpectations(expected_passes[i], pass); | 134 TestPassMatchesExpectations(expected_passes[i], pass); |
135 } | 135 } |
136 } | 136 } |
137 | 137 |
138 } // namespace test | 138 } // namespace test |
139 } // namespace cc | 139 } // namespace cc |
OLD | NEW |