| 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/draw_quad.h" | 5 #include "cc/quads/draw_quad.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "cc/base/math_util.h" | 8 #include "cc/base/math_util.h" |
| 9 #include "cc/quads/checkerboard_draw_quad.h" | 9 #include "cc/quads/checkerboard_draw_quad.h" |
| 10 #include "cc/quads/debug_border_draw_quad.h" | 10 #include "cc/quads/debug_border_draw_quad.h" |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 | 185 |
| 186 #define CREATE_QUAD_5_ALL(Type, a, b, c, d, e) \ | 186 #define CREATE_QUAD_5_ALL(Type, a, b, c, d, e) \ |
| 187 scoped_ptr<Type> quad_all(Type::Create()); \ | 187 scoped_ptr<Type> quad_all(Type::Create()); \ |
| 188 { \ | 188 { \ |
| 189 QUAD_DATA \ | 189 QUAD_DATA \ |
| 190 quad_all->SetAll(shared_state.get(), quad_rect, quad_opaque_rect, \ | 190 quad_all->SetAll(shared_state.get(), quad_rect, quad_opaque_rect, \ |
| 191 quad_visible_rect, needs_blending, a, b, c, d, e); \ | 191 quad_visible_rect, needs_blending, a, b, c, d, e); \ |
| 192 } \ | 192 } \ |
| 193 SETUP_AND_COPY_QUAD_ALL(Type, quad_all); | 193 SETUP_AND_COPY_QUAD_ALL(Type, quad_all); |
| 194 | 194 |
| 195 #define CREATE_QUAD_5_NEW_1(Type, a, b, c, d, e, copyA) \ | 195 #define CREATE_QUAD_5_NEW_1(Type, a, b, c, d, e, copy_a) \ |
| 196 scoped_ptr<Type> quad_new(Type::Create()); \ | 196 scoped_ptr<Type> quad_new(Type::Create()); \ |
| 197 { \ | 197 { \ |
| 198 QUAD_DATA \ | 198 QUAD_DATA \ |
| 199 quad_new->SetNew(shared_state.get(), quad_rect, a, b, c, d, e); \ | 199 quad_new->SetNew(shared_state.get(), quad_rect, a, b, c, d, e); \ |
| 200 } \ | 200 } \ |
| 201 SETUP_AND_COPY_QUAD_NEW_1(Type, quad_new, copyA); | 201 SETUP_AND_COPY_QUAD_NEW_1(Type, quad_new, copy_a); |
| 202 | 202 |
| 203 #define CREATE_QUAD_5_ALL_1(Type, a, b, c, d, e, copyA) \ | 203 #define CREATE_QUAD_5_ALL_1(Type, a, b, c, d, e, copy_a) \ |
| 204 scoped_ptr<Type> quad_all(Type::Create()); \ | 204 scoped_ptr<Type> quad_all(Type::Create()); \ |
| 205 { \ | 205 { \ |
| 206 QUAD_DATA \ | 206 QUAD_DATA \ |
| 207 quad_all->SetAll(shared_state.get(), quad_rect, quad_opaque_rect, \ | 207 quad_all->SetAll(shared_state.get(), quad_rect, quad_opaque_rect, \ |
| 208 quad_visible_rect, needs_blending, a, b, c, d, e); \ | 208 quad_visible_rect, needs_blending, a, b, c, d, e); \ |
| 209 } \ | 209 } \ |
| 210 SETUP_AND_COPY_QUAD_ALL_1(Type, quad_all, copyA); | 210 SETUP_AND_COPY_QUAD_ALL_1(Type, quad_all, copy_a); |
| 211 | 211 |
| 212 #define CREATE_QUAD_6_NEW(Type, a, b, c, d, e, f) \ | 212 #define CREATE_QUAD_6_NEW(Type, a, b, c, d, e, f) \ |
| 213 scoped_ptr<Type> quad_new(Type::Create()); \ | 213 scoped_ptr<Type> quad_new(Type::Create()); \ |
| 214 { \ | 214 { \ |
| 215 QUAD_DATA \ | 215 QUAD_DATA \ |
| 216 quad_new->SetNew(shared_state.get(), quad_rect, a, b, c, d, e, f); \ | 216 quad_new->SetNew(shared_state.get(), quad_rect, a, b, c, d, e, f); \ |
| 217 } \ | 217 } \ |
| 218 SETUP_AND_COPY_QUAD_NEW(Type, quad_new); | 218 SETUP_AND_COPY_QUAD_NEW(Type, quad_new); |
| 219 | 219 |
| 220 #define CREATE_QUAD_6_ALL(Type, a, b, c, d, e, f) \ | 220 #define CREATE_QUAD_6_ALL(Type, a, b, c, d, e, f) \ |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 819 EXPECT_EQ(u_plane.resource_id, quad_new->u_plane.resource_id); | 819 EXPECT_EQ(u_plane.resource_id, quad_new->u_plane.resource_id); |
| 820 EXPECT_EQ(v_plane.resource_id, quad_new->v_plane.resource_id); | 820 EXPECT_EQ(v_plane.resource_id, quad_new->v_plane.resource_id); |
| 821 EXPECT_EQ(3, IterateAndCount(quad_new.get())); | 821 EXPECT_EQ(3, IterateAndCount(quad_new.get())); |
| 822 EXPECT_EQ(y_plane.resource_id + 1, quad_new->y_plane.resource_id); | 822 EXPECT_EQ(y_plane.resource_id + 1, quad_new->y_plane.resource_id); |
| 823 EXPECT_EQ(u_plane.resource_id + 1, quad_new->u_plane.resource_id); | 823 EXPECT_EQ(u_plane.resource_id + 1, quad_new->u_plane.resource_id); |
| 824 EXPECT_EQ(v_plane.resource_id + 1, quad_new->v_plane.resource_id); | 824 EXPECT_EQ(v_plane.resource_id + 1, quad_new->v_plane.resource_id); |
| 825 } | 825 } |
| 826 | 826 |
| 827 } // namespace | 827 } // namespace |
| 828 } // namespace cc | 828 } // namespace cc |
| OLD | NEW |