OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/quads/render_pass.h" | 5 #include "cc/quads/render_pass.h" |
6 | 6 |
7 #include "cc/base/math_util.h" | 7 #include "cc/base/math_util.h" |
8 #include "cc/base/scoped_ptr_vector.h" | 8 #include "cc/base/scoped_ptr_vector.h" |
9 #include "cc/output/copy_output_request.h" | 9 #include "cc/output/copy_output_request.h" |
10 #include "cc/quads/checkerboard_draw_quad.h" | 10 #include "cc/quads/checkerboard_draw_quad.h" |
11 #include "cc/quads/render_pass_draw_quad.h" | 11 #include "cc/quads/render_pass_draw_quad.h" |
12 #include "cc/test/geometry_test_utils.h" | 12 #include "cc/test/geometry_test_utils.h" |
13 #include "cc/test/render_pass_test_common.h" | 13 #include "cc/test/render_pass_test_common.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 #include "third_party/skia/include/effects/SkBlurImageFilter.h" | 15 #include "third_party/skia/include/effects/SkBlurImageFilter.h" |
16 #include "ui/gfx/transform.h" | 16 #include "ui/gfx/transform.h" |
17 | 17 |
18 using cc::TestRenderPass; | 18 using cc::TestRenderPass; |
19 | 19 |
20 namespace cc { | 20 namespace cc { |
21 namespace { | 21 namespace { |
22 | 22 |
23 struct RenderPassSize { | 23 struct RenderPassSize { |
24 // If you add a new field to this class, make sure to add it to the | 24 // If you add a new field to this class, make sure to add it to the |
25 // Copy() tests. | 25 // Copy() tests. |
piman
2014/03/14 03:42:34
ahem
alexst (slow to review)
2014/03/14 19:54:22
Right! :)
| |
26 RenderPass::Id id; | 26 RenderPass::Id id; |
27 QuadList quad_list; | 27 QuadList quad_list; |
28 SharedQuadStateList shared_quad_state_list; | 28 SharedQuadStateList shared_quad_state_list; |
29 gfx::Transform transform_to_root_target; | 29 gfx::Transform transform_to_root_target; |
30 gfx::Rect output_rect; | 30 gfx::Rect output_rect; |
31 gfx::RectF damage_rect; | 31 gfx::RectF damage_rect; |
32 bool has_transparent_background; | 32 bool has_transparent_background; |
33 ScopedPtrVector<CopyOutputRequest> copy_callbacks; | 33 ScopedPtrVector<CopyOutputRequest> copy_callbacks; |
34 RenderPass::HwOverlayState overlay_state; | |
34 }; | 35 }; |
35 | 36 |
36 static void CompareRenderPassLists(const RenderPassList& expected_list, | 37 static void CompareRenderPassLists(const RenderPassList& expected_list, |
37 const RenderPassList& actual_list) { | 38 const RenderPassList& actual_list) { |
38 EXPECT_EQ(expected_list.size(), actual_list.size()); | 39 EXPECT_EQ(expected_list.size(), actual_list.size()); |
39 for (size_t i = 0; i < actual_list.size(); ++i) { | 40 for (size_t i = 0; i < actual_list.size(); ++i) { |
40 RenderPass* expected = expected_list[i]; | 41 RenderPass* expected = expected_list[i]; |
41 RenderPass* actual = actual_list[i]; | 42 RenderPass* actual = actual_list[i]; |
42 | 43 |
43 EXPECT_EQ(expected->id, actual->id); | 44 EXPECT_EQ(expected->id, actual->id); |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
321 | 322 |
322 // Make a copy with CopyAll(). | 323 // Make a copy with CopyAll(). |
323 RenderPassList copy_list; | 324 RenderPassList copy_list; |
324 RenderPass::CopyAll(pass_list, ©_list); | 325 RenderPass::CopyAll(pass_list, ©_list); |
325 | 326 |
326 CompareRenderPassLists(pass_list, copy_list); | 327 CompareRenderPassLists(pass_list, copy_list); |
327 } | 328 } |
328 | 329 |
329 } // namespace | 330 } // namespace |
330 } // namespace cc | 331 } // namespace cc |
OLD | NEW |