| 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/output/compositor_frame.h" | 5 #include "cc/output/compositor_frame.h" |
| 6 #include "cc/quads/render_pass.h" | 6 #include "cc/quads/render_pass.h" |
| 7 #include "cc/quads/solid_color_draw_quad.h" | 7 #include "cc/quads/solid_color_draw_quad.h" |
| 8 #include "cc/quads/surface_draw_quad.h" | 8 #include "cc/quads/surface_draw_quad.h" |
| 9 #include "cc/surfaces/surface.h" | 9 #include "cc/surfaces/surface.h" |
| 10 #include "cc/surfaces/surface_aggregator.h" | 10 #include "cc/surfaces/surface_aggregator.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 SurfaceManager manager_; | 34 SurfaceManager manager_; |
| 35 SurfaceIdAllocator allocator_; | 35 SurfaceIdAllocator allocator_; |
| 36 EmptySurfaceFactoryClient client_; | 36 EmptySurfaceFactoryClient client_; |
| 37 SurfaceFactory factory_; | 37 SurfaceFactory factory_; |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 SharedQuadState* CreateAndAppendTestSharedQuadState( | 40 SharedQuadState* CreateAndAppendTestSharedQuadState( |
| 41 RenderPass* render_pass, | 41 RenderPass* render_pass, |
| 42 const gfx::Transform& transform, | 42 const gfx::Transform& transform, |
| 43 const gfx::Size& size) { | 43 const gfx::Size& size) { |
| 44 const gfx::Size content_bounds = size; | 44 const gfx::Size layer_bounds = size; |
| 45 const gfx::Rect visible_content_rect = gfx::Rect(size); | 45 const gfx::Rect visible_layer_rect = gfx::Rect(size); |
| 46 const gfx::Rect clip_rect = gfx::Rect(size); | 46 const gfx::Rect clip_rect = gfx::Rect(size); |
| 47 bool is_clipped = false; | 47 bool is_clipped = false; |
| 48 float opacity = 1.f; | 48 float opacity = 1.f; |
| 49 const SkXfermode::Mode blend_mode = SkXfermode::kSrcOver_Mode; | 49 const SkXfermode::Mode blend_mode = SkXfermode::kSrcOver_Mode; |
| 50 SharedQuadState* shared_state = render_pass->CreateAndAppendSharedQuadState(); | 50 SharedQuadState* shared_state = render_pass->CreateAndAppendSharedQuadState(); |
| 51 shared_state->SetAll(transform, | 51 shared_state->SetAll(transform, layer_bounds, visible_layer_rect, clip_rect, |
| 52 content_bounds, | 52 is_clipped, opacity, blend_mode, 0); |
| 53 visible_content_rect, | |
| 54 clip_rect, | |
| 55 is_clipped, | |
| 56 opacity, | |
| 57 blend_mode, | |
| 58 0); | |
| 59 return shared_state; | 53 return shared_state; |
| 60 } | 54 } |
| 61 | 55 |
| 62 // Draws a very simple frame with no surface references. | 56 // Draws a very simple frame with no surface references. |
| 63 TEST_F(SurfacesPixelTest, DrawSimpleFrame) { | 57 TEST_F(SurfacesPixelTest, DrawSimpleFrame) { |
| 64 gfx::Rect rect(device_viewport_size_); | 58 gfx::Rect rect(device_viewport_size_); |
| 65 RenderPassId id(1, 1); | 59 RenderPassId id(1, 1); |
| 66 scoped_ptr<RenderPass> pass = RenderPass::Create(); | 60 scoped_ptr<RenderPass> pass = RenderPass::Create(); |
| 67 pass->SetNew(id, rect, rect, gfx::Transform()); | 61 pass->SetNew(id, rect, rect, gfx::Transform()); |
| 68 | 62 |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 | 325 |
| 332 factory_.Destroy(root_surface_id); | 326 factory_.Destroy(root_surface_id); |
| 333 factory_.Destroy(left_child_id); | 327 factory_.Destroy(left_child_id); |
| 334 factory_.Destroy(right_child_id); | 328 factory_.Destroy(right_child_id); |
| 335 } | 329 } |
| 336 | 330 |
| 337 } // namespace | 331 } // namespace |
| 338 } // namespace cc | 332 } // namespace cc |
| 339 | 333 |
| 340 #endif // !defined(OS_ANDROID) | 334 #endif // !defined(OS_ANDROID) |
| OLD | NEW |