| 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/surfaces/surface_aggregator_test_helpers.h" | 5 #include "cc/surfaces/surface_aggregator_test_helpers.h" |
| 6 | 6 |
| 7 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "cc/layers/append_quads_data.h" | 9 #include "cc/layers/append_quads_data.h" |
| 10 #include "cc/output/compositor_frame.h" | 10 #include "cc/output/compositor_frame.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 float opacity = 1.0; | 33 float opacity = 1.0; |
| 34 SkXfermode::Mode blend_mode = SkXfermode::kSrcOver_Mode; | 34 SkXfermode::Mode blend_mode = SkXfermode::kSrcOver_Mode; |
| 35 | 35 |
| 36 SharedQuadState* shared_quad_state = pass->CreateAndAppendSharedQuadState(); | 36 SharedQuadState* shared_quad_state = pass->CreateAndAppendSharedQuadState(); |
| 37 shared_quad_state->SetAll(content_to_target_transform, | 37 shared_quad_state->SetAll(content_to_target_transform, |
| 38 content_bounds, | 38 content_bounds, |
| 39 visible_content_rect, | 39 visible_content_rect, |
| 40 clip_rect, | 40 clip_rect, |
| 41 is_clipped, | 41 is_clipped, |
| 42 opacity, | 42 opacity, |
| 43 blend_mode); | 43 blend_mode, |
| 44 0); |
| 44 | 45 |
| 45 scoped_ptr<SurfaceDrawQuad> surface_quad = SurfaceDrawQuad::Create(); | 46 scoped_ptr<SurfaceDrawQuad> surface_quad = SurfaceDrawQuad::Create(); |
| 46 gfx::Rect quad_rect = gfx::Rect(surface_size); | 47 gfx::Rect quad_rect = gfx::Rect(surface_size); |
| 47 surface_quad->SetNew(pass->shared_quad_state_list.back(), | 48 surface_quad->SetNew(pass->shared_quad_state_list.back(), |
| 48 gfx::Rect(surface_size), | 49 gfx::Rect(surface_size), |
| 49 gfx::Rect(surface_size), | 50 gfx::Rect(surface_size), |
| 50 surface_id); | 51 surface_id); |
| 51 pass->quad_list.push_back(surface_quad.PassAs<DrawQuad>()); | 52 pass->quad_list.push_back(surface_quad.PassAs<DrawQuad>()); |
| 52 } | 53 } |
| 53 void AddTestRenderPassQuad(TestRenderPass* pass, | 54 void AddTestRenderPassQuad(TestRenderPass* pass, |
| 54 RenderPass::Id render_pass_id) { | 55 RenderPass::Id render_pass_id) { |
| 55 gfx::Rect output_rect = gfx::Rect(0, 0, 5, 5); | 56 gfx::Rect output_rect = gfx::Rect(0, 0, 5, 5); |
| 56 SharedQuadState* shared_state = pass->CreateAndAppendSharedQuadState(); | 57 SharedQuadState* shared_state = pass->CreateAndAppendSharedQuadState(); |
| 57 shared_state->SetAll(gfx::Transform(), | 58 shared_state->SetAll(gfx::Transform(), |
| 58 output_rect.size(), | 59 output_rect.size(), |
| 59 output_rect, | 60 output_rect, |
| 60 output_rect, | 61 output_rect, |
| 61 false, | 62 false, |
| 62 1, | 63 1, |
| 63 SkXfermode::kSrcOver_Mode); | 64 SkXfermode::kSrcOver_Mode, |
| 65 0); |
| 64 scoped_ptr<RenderPassDrawQuad> quad = RenderPassDrawQuad::Create(); | 66 scoped_ptr<RenderPassDrawQuad> quad = RenderPassDrawQuad::Create(); |
| 65 quad->SetNew(shared_state, | 67 quad->SetNew(shared_state, |
| 66 output_rect, | 68 output_rect, |
| 67 output_rect, | 69 output_rect, |
| 68 render_pass_id, | 70 render_pass_id, |
| 69 false, | 71 false, |
| 70 0, | 72 0, |
| 71 output_rect, | 73 output_rect, |
| 72 gfx::RectF(), | 74 gfx::RectF(), |
| 73 FilterOperations(), | 75 FilterOperations(), |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 delegated_frame_data->render_pass_list.push_back(pass.Pass()); | 163 delegated_frame_data->render_pass_list.push_back(pass.Pass()); |
| 162 | 164 |
| 163 scoped_ptr<CompositorFrame> child_frame(new CompositorFrame); | 165 scoped_ptr<CompositorFrame> child_frame(new CompositorFrame); |
| 164 child_frame->delegated_frame_data = delegated_frame_data.Pass(); | 166 child_frame->delegated_frame_data = delegated_frame_data.Pass(); |
| 165 | 167 |
| 166 surface->QueueFrame(child_frame.Pass()); | 168 surface->QueueFrame(child_frame.Pass()); |
| 167 } | 169 } |
| 168 | 170 |
| 169 } // namespace test | 171 } // namespace test |
| 170 } // namespace cc | 172 } // namespace cc |
| OLD | NEW |