OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "content/common/cc_messages.h" | 5 #include "content/common/cc_messages.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 EXPECT_EQ(a->background_filters, b->background_filters); | 162 EXPECT_EQ(a->background_filters, b->background_filters); |
163 } | 163 } |
164 | 164 |
165 void Compare(const SolidColorDrawQuad* a, const SolidColorDrawQuad* b) { | 165 void Compare(const SolidColorDrawQuad* a, const SolidColorDrawQuad* b) { |
166 EXPECT_EQ(a->color, b->color); | 166 EXPECT_EQ(a->color, b->color); |
167 EXPECT_EQ(a->force_anti_aliasing_off, b->force_anti_aliasing_off); | 167 EXPECT_EQ(a->force_anti_aliasing_off, b->force_anti_aliasing_off); |
168 } | 168 } |
169 | 169 |
170 void Compare(const StreamVideoDrawQuad* a, const StreamVideoDrawQuad* b) { | 170 void Compare(const StreamVideoDrawQuad* a, const StreamVideoDrawQuad* b) { |
171 EXPECT_EQ(a->resource_id(), b->resource_id()); | 171 EXPECT_EQ(a->resource_id(), b->resource_id()); |
| 172 EXPECT_EQ(a->resource_size_in_pixels(), b->resource_size_in_pixels()); |
| 173 EXPECT_EQ(a->allow_overlay(), b->allow_overlay()); |
172 EXPECT_EQ(a->matrix, b->matrix); | 174 EXPECT_EQ(a->matrix, b->matrix); |
173 } | 175 } |
174 | 176 |
175 void Compare(const SurfaceDrawQuad* a, const SurfaceDrawQuad* b) { | 177 void Compare(const SurfaceDrawQuad* a, const SurfaceDrawQuad* b) { |
176 EXPECT_EQ(a->surface_id, b->surface_id); | 178 EXPECT_EQ(a->surface_id, b->surface_id); |
177 } | 179 } |
178 | 180 |
179 void Compare(const TextureDrawQuad* a, const TextureDrawQuad* b) { | 181 void Compare(const TextureDrawQuad* a, const TextureDrawQuad* b) { |
180 EXPECT_EQ(a->resource_id(), b->resource_id()); | 182 EXPECT_EQ(a->resource_id(), b->resource_id()); |
| 183 EXPECT_EQ(a->resource_size_in_pixels(), b->resource_size_in_pixels()); |
| 184 EXPECT_EQ(a->allow_overlay(), b->allow_overlay()); |
181 EXPECT_EQ(a->premultiplied_alpha, b->premultiplied_alpha); | 185 EXPECT_EQ(a->premultiplied_alpha, b->premultiplied_alpha); |
182 EXPECT_EQ(a->uv_top_left, b->uv_top_left); | 186 EXPECT_EQ(a->uv_top_left, b->uv_top_left); |
183 EXPECT_EQ(a->uv_bottom_right, b->uv_bottom_right); | 187 EXPECT_EQ(a->uv_bottom_right, b->uv_bottom_right); |
184 EXPECT_EQ(a->background_color, b->background_color); | 188 EXPECT_EQ(a->background_color, b->background_color); |
185 EXPECT_EQ(a->vertex_opacity[0], b->vertex_opacity[0]); | 189 EXPECT_EQ(a->vertex_opacity[0], b->vertex_opacity[0]); |
186 EXPECT_EQ(a->vertex_opacity[1], b->vertex_opacity[1]); | 190 EXPECT_EQ(a->vertex_opacity[1], b->vertex_opacity[1]); |
187 EXPECT_EQ(a->vertex_opacity[2], b->vertex_opacity[2]); | 191 EXPECT_EQ(a->vertex_opacity[2], b->vertex_opacity[2]); |
188 EXPECT_EQ(a->vertex_opacity[3], b->vertex_opacity[3]); | 192 EXPECT_EQ(a->vertex_opacity[3], b->vertex_opacity[3]); |
189 EXPECT_EQ(a->y_flipped, b->y_flipped); | 193 EXPECT_EQ(a->y_flipped, b->y_flipped); |
190 EXPECT_EQ(a->nearest_neighbor, b->nearest_neighbor); | 194 EXPECT_EQ(a->nearest_neighbor, b->nearest_neighbor); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 gfx::Vector2dF arbitrary_vector2df1(16.2f, -85.1f); | 260 gfx::Vector2dF arbitrary_vector2df1(16.2f, -85.1f); |
257 gfx::Vector2dF arbitrary_vector2df2(-8.3f, 0.47f); | 261 gfx::Vector2dF arbitrary_vector2df2(-8.3f, 0.47f); |
258 float arbitrary_float1 = 0.7f; | 262 float arbitrary_float1 = 0.7f; |
259 float arbitrary_float2 = 0.3f; | 263 float arbitrary_float2 = 0.3f; |
260 float arbitrary_float3 = 0.9f; | 264 float arbitrary_float3 = 0.9f; |
261 float arbitrary_float_array[4] = {3.5f, 6.2f, 9.3f, 12.3f}; | 265 float arbitrary_float_array[4] = {3.5f, 6.2f, 9.3f, 12.3f}; |
262 bool arbitrary_bool1 = true; | 266 bool arbitrary_bool1 = true; |
263 bool arbitrary_bool2 = false; | 267 bool arbitrary_bool2 = false; |
264 bool arbitrary_bool3 = true; | 268 bool arbitrary_bool3 = true; |
265 bool arbitrary_bool4 = true; | 269 bool arbitrary_bool4 = true; |
| 270 bool arbitrary_bool5 = false; |
266 int arbitrary_context_id1 = 12; | 271 int arbitrary_context_id1 = 12; |
267 int arbitrary_context_id2 = 57; | 272 int arbitrary_context_id2 = 57; |
268 int arbitrary_context_id3 = -503; | 273 int arbitrary_context_id3 = -503; |
269 int arbitrary_int = 5; | 274 int arbitrary_int = 5; |
270 SkColor arbitrary_color = SkColorSetARGB(25, 36, 47, 58); | 275 SkColor arbitrary_color = SkColorSetARGB(25, 36, 47, 58); |
271 SkXfermode::Mode arbitrary_blend_mode1 = SkXfermode::kScreen_Mode; | 276 SkXfermode::Mode arbitrary_blend_mode1 = SkXfermode::kScreen_Mode; |
272 SkXfermode::Mode arbitrary_blend_mode2 = SkXfermode::kLighten_Mode; | 277 SkXfermode::Mode arbitrary_blend_mode2 = SkXfermode::kLighten_Mode; |
273 SkXfermode::Mode arbitrary_blend_mode3 = SkXfermode::kOverlay_Mode; | 278 SkXfermode::Mode arbitrary_blend_mode3 = SkXfermode::kOverlay_Mode; |
274 IOSurfaceDrawQuad::Orientation arbitrary_orientation = | 279 IOSurfaceDrawQuad::Orientation arbitrary_orientation = |
275 IOSurfaceDrawQuad::UNFLIPPED; | 280 IOSurfaceDrawQuad::UNFLIPPED; |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 arbitrary_rect1_inside_rect3, | 395 arbitrary_rect1_inside_rect3, |
391 arbitrary_rect2_inside_rect3, | 396 arbitrary_rect2_inside_rect3, |
392 arbitrary_bool1, | 397 arbitrary_bool1, |
393 arbitrary_color, | 398 arbitrary_color, |
394 arbitrary_bool2); | 399 arbitrary_bool2); |
395 pass_cmp->CopyFromAndAppendDrawQuad(solidcolor_in, | 400 pass_cmp->CopyFromAndAppendDrawQuad(solidcolor_in, |
396 solidcolor_in->shared_quad_state); | 401 solidcolor_in->shared_quad_state); |
397 | 402 |
398 StreamVideoDrawQuad* streamvideo_in = | 403 StreamVideoDrawQuad* streamvideo_in = |
399 pass_in->CreateAndAppendDrawQuad<StreamVideoDrawQuad>(); | 404 pass_in->CreateAndAppendDrawQuad<StreamVideoDrawQuad>(); |
400 streamvideo_in->SetAll(shared_state3_in, arbitrary_rect2, | 405 streamvideo_in->SetAll( |
401 arbitrary_rect2_inside_rect2, | 406 shared_state3_in, arbitrary_rect2, arbitrary_rect2_inside_rect2, |
402 arbitrary_rect1_inside_rect2, arbitrary_bool1, | 407 arbitrary_rect1_inside_rect2, arbitrary_bool1, arbitrary_resourceid2, |
403 arbitrary_resourceid2, arbitrary_matrix1); | 408 arbitrary_size1, arbitrary_bool2, arbitrary_matrix1); |
404 pass_cmp->CopyFromAndAppendDrawQuad(streamvideo_in, | 409 pass_cmp->CopyFromAndAppendDrawQuad(streamvideo_in, |
405 streamvideo_in->shared_quad_state); | 410 streamvideo_in->shared_quad_state); |
406 | 411 |
407 cc::SurfaceId arbitrary_surface_id(3); | 412 cc::SurfaceId arbitrary_surface_id(3); |
408 SurfaceDrawQuad* surface_in = | 413 SurfaceDrawQuad* surface_in = |
409 pass_in->CreateAndAppendDrawQuad<SurfaceDrawQuad>(); | 414 pass_in->CreateAndAppendDrawQuad<SurfaceDrawQuad>(); |
410 surface_in->SetAll(shared_state3_in, | 415 surface_in->SetAll(shared_state3_in, |
411 arbitrary_rect2, | 416 arbitrary_rect2, |
412 arbitrary_rect2_inside_rect2, | 417 arbitrary_rect2_inside_rect2, |
413 arbitrary_rect1_inside_rect2, | 418 arbitrary_rect1_inside_rect2, |
414 arbitrary_bool1, | 419 arbitrary_bool1, |
415 arbitrary_surface_id); | 420 arbitrary_surface_id); |
416 pass_cmp->CopyFromAndAppendDrawQuad(surface_in, | 421 pass_cmp->CopyFromAndAppendDrawQuad(surface_in, |
417 surface_in->shared_quad_state); | 422 surface_in->shared_quad_state); |
418 | 423 |
419 TextureDrawQuad* texture_in = | 424 TextureDrawQuad* texture_in = |
420 pass_in->CreateAndAppendDrawQuad<TextureDrawQuad>(); | 425 pass_in->CreateAndAppendDrawQuad<TextureDrawQuad>(); |
421 texture_in->SetAll(shared_state3_in, | 426 texture_in->SetAll(shared_state3_in, arbitrary_rect2, |
422 arbitrary_rect2, | 427 arbitrary_rect2_inside_rect2, arbitrary_rect1_inside_rect2, |
423 arbitrary_rect2_inside_rect2, | 428 arbitrary_bool1, arbitrary_resourceid1, arbitrary_size1, |
424 arbitrary_rect1_inside_rect2, | 429 arbitrary_bool2, arbitrary_bool3, arbitrary_pointf1, |
425 arbitrary_bool1, | 430 arbitrary_pointf2, arbitrary_color, arbitrary_float_array, |
426 arbitrary_resourceid1, | 431 arbitrary_bool4, arbitrary_bool5); |
427 arbitrary_bool2, | |
428 arbitrary_pointf1, | |
429 arbitrary_pointf2, | |
430 arbitrary_color, | |
431 arbitrary_float_array, | |
432 arbitrary_bool3, | |
433 arbitrary_bool4); | |
434 pass_cmp->CopyFromAndAppendDrawQuad(texture_in, | 432 pass_cmp->CopyFromAndAppendDrawQuad(texture_in, |
435 texture_in->shared_quad_state); | 433 texture_in->shared_quad_state); |
436 | 434 |
437 TileDrawQuad* tile_in = pass_in->CreateAndAppendDrawQuad<TileDrawQuad>(); | 435 TileDrawQuad* tile_in = pass_in->CreateAndAppendDrawQuad<TileDrawQuad>(); |
438 tile_in->SetAll(shared_state3_in, | 436 tile_in->SetAll(shared_state3_in, |
439 arbitrary_rect2, | 437 arbitrary_rect2, |
440 arbitrary_rect2_inside_rect2, | 438 arbitrary_rect2_inside_rect2, |
441 arbitrary_rect1_inside_rect2, | 439 arbitrary_rect1_inside_rect2, |
442 arbitrary_bool1, | 440 arbitrary_bool1, |
443 arbitrary_resourceid3, | 441 arbitrary_resourceid3, |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 SoftwareFrameData frame_out; | 752 SoftwareFrameData frame_out; |
755 base::PickleIterator iter(msg); | 753 base::PickleIterator iter(msg); |
756 EXPECT_EQ( | 754 EXPECT_EQ( |
757 expect_read, | 755 expect_read, |
758 IPC::ParamTraits<SoftwareFrameData>::Read(&msg, &iter, &frame_out)); | 756 IPC::ParamTraits<SoftwareFrameData>::Read(&msg, &iter, &frame_out)); |
759 } | 757 } |
760 } | 758 } |
761 | 759 |
762 } // namespace | 760 } // namespace |
763 } // namespace content | 761 } // namespace content |
OLD | NEW |