Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: content/common/cc_messages_unittest.cc

Issue 1131253003: cc: Add support for non-2D texture targets to YUVVideoQuad. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: invert scale Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 191
192 void Compare(const TileDrawQuad* a, const TileDrawQuad* b) { 192 void Compare(const TileDrawQuad* a, const TileDrawQuad* b) {
193 EXPECT_EQ(a->resource_id, b->resource_id); 193 EXPECT_EQ(a->resource_id, b->resource_id);
194 EXPECT_EQ(a->tex_coord_rect, b->tex_coord_rect); 194 EXPECT_EQ(a->tex_coord_rect, b->tex_coord_rect);
195 EXPECT_EQ(a->texture_size, b->texture_size); 195 EXPECT_EQ(a->texture_size, b->texture_size);
196 EXPECT_EQ(a->swizzle_contents, b->swizzle_contents); 196 EXPECT_EQ(a->swizzle_contents, b->swizzle_contents);
197 EXPECT_EQ(a->nearest_neighbor, b->nearest_neighbor); 197 EXPECT_EQ(a->nearest_neighbor, b->nearest_neighbor);
198 } 198 }
199 199
200 void Compare(const YUVVideoDrawQuad* a, const YUVVideoDrawQuad* b) { 200 void Compare(const YUVVideoDrawQuad* a, const YUVVideoDrawQuad* b) {
201 EXPECT_EQ(a->tex_coord_rect, b->tex_coord_rect); 201 EXPECT_EQ(a->ya_tex_coord_rect, b->ya_tex_coord_rect);
202 EXPECT_EQ(a->uv_tex_coord_rect, b->uv_tex_coord_rect);
202 EXPECT_EQ(a->ya_tex_size, b->ya_tex_size); 203 EXPECT_EQ(a->ya_tex_size, b->ya_tex_size);
203 EXPECT_EQ(a->uv_tex_size, b->uv_tex_size); 204 EXPECT_EQ(a->uv_tex_size, b->uv_tex_size);
204 EXPECT_EQ(a->y_plane_resource_id, b->y_plane_resource_id); 205 EXPECT_EQ(a->y_plane_resource_id, b->y_plane_resource_id);
205 EXPECT_EQ(a->u_plane_resource_id, b->u_plane_resource_id); 206 EXPECT_EQ(a->u_plane_resource_id, b->u_plane_resource_id);
206 EXPECT_EQ(a->v_plane_resource_id, b->v_plane_resource_id); 207 EXPECT_EQ(a->v_plane_resource_id, b->v_plane_resource_id);
207 EXPECT_EQ(a->a_plane_resource_id, b->a_plane_resource_id); 208 EXPECT_EQ(a->a_plane_resource_id, b->a_plane_resource_id);
208 EXPECT_EQ(a->color_space, b->color_space); 209 EXPECT_EQ(a->color_space, b->color_space);
209 } 210 }
210 211
211 void Compare(const TransferableResource& a, const TransferableResource& b) { 212 void Compare(const TransferableResource& a, const TransferableResource& b) {
(...skipping 28 matching lines...) Expand all
240 gfx::Rect arbitrary_rect2(40, 23, 11, 7); 241 gfx::Rect arbitrary_rect2(40, 23, 11, 7);
241 gfx::Rect arbitrary_rect1_inside_rect2(44, 23, 4, 2); 242 gfx::Rect arbitrary_rect1_inside_rect2(44, 23, 4, 2);
242 gfx::Rect arbitrary_rect2_inside_rect2(41, 25, 3, 5); 243 gfx::Rect arbitrary_rect2_inside_rect2(41, 25, 3, 5);
243 gfx::Rect arbitrary_rect3(7, -53, 22, 19); 244 gfx::Rect arbitrary_rect3(7, -53, 22, 19);
244 gfx::Rect arbitrary_rect1_inside_rect3(10, -40, 6, 3); 245 gfx::Rect arbitrary_rect1_inside_rect3(10, -40, 6, 3);
245 gfx::Rect arbitrary_rect2_inside_rect3(12, -51, 5, 12); 246 gfx::Rect arbitrary_rect2_inside_rect3(12, -51, 5, 12);
246 gfx::Size arbitrary_size1(15, 19); 247 gfx::Size arbitrary_size1(15, 19);
247 gfx::Size arbitrary_size2(3, 99); 248 gfx::Size arbitrary_size2(3, 99);
248 gfx::Size arbitrary_size3(75, 1281); 249 gfx::Size arbitrary_size3(75, 1281);
249 gfx::RectF arbitrary_rectf1(4.2f, -922.1f, 15.6f, 29.5f); 250 gfx::RectF arbitrary_rectf1(4.2f, -922.1f, 15.6f, 29.5f);
251 gfx::RectF arbitrary_rectf2(2.1f, -411.05f, 7.8f, 14.75f);
250 gfx::SizeF arbitrary_sizef1(15.2f, 104.6f); 252 gfx::SizeF arbitrary_sizef1(15.2f, 104.6f);
251 gfx::PointF arbitrary_pointf1(31.4f, 15.9f); 253 gfx::PointF arbitrary_pointf1(31.4f, 15.9f);
252 gfx::PointF arbitrary_pointf2(26.5f, -35.8f); 254 gfx::PointF arbitrary_pointf2(26.5f, -35.8f);
253 gfx::Vector2dF arbitrary_vector2df1(16.2f, -85.1f); 255 gfx::Vector2dF arbitrary_vector2df1(16.2f, -85.1f);
254 gfx::Vector2dF arbitrary_vector2df2(-8.3f, 0.47f); 256 gfx::Vector2dF arbitrary_vector2df2(-8.3f, 0.47f);
255 float arbitrary_float1 = 0.7f; 257 float arbitrary_float1 = 0.7f;
256 float arbitrary_float2 = 0.3f; 258 float arbitrary_float2 = 0.3f;
257 float arbitrary_float3 = 0.9f; 259 float arbitrary_float3 = 0.9f;
258 float arbitrary_float_array[4] = {3.5f, 6.2f, 9.3f, 12.3f}; 260 float arbitrary_float_array[4] = {3.5f, 6.2f, 9.3f, 12.3f};
259 bool arbitrary_bool1 = true; 261 bool arbitrary_bool1 = true;
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 arbitrary_bool1, 441 arbitrary_bool1,
440 arbitrary_resourceid3, 442 arbitrary_resourceid3,
441 arbitrary_rectf1, 443 arbitrary_rectf1,
442 arbitrary_size1, 444 arbitrary_size1,
443 arbitrary_bool2, 445 arbitrary_bool2,
444 arbitrary_bool3); 446 arbitrary_bool3);
445 pass_cmp->CopyFromAndAppendDrawQuad(tile_in, tile_in->shared_quad_state); 447 pass_cmp->CopyFromAndAppendDrawQuad(tile_in, tile_in->shared_quad_state);
446 448
447 YUVVideoDrawQuad* yuvvideo_in = 449 YUVVideoDrawQuad* yuvvideo_in =
448 pass_in->CreateAndAppendDrawQuad<YUVVideoDrawQuad>(); 450 pass_in->CreateAndAppendDrawQuad<YUVVideoDrawQuad>();
449 yuvvideo_in->SetAll(shared_state3_in, 451 yuvvideo_in->SetAll(
450 arbitrary_rect1, 452 shared_state3_in, arbitrary_rect1, arbitrary_rect2_inside_rect1,
451 arbitrary_rect2_inside_rect1, 453 arbitrary_rect1_inside_rect1, arbitrary_bool1, arbitrary_rectf1,
452 arbitrary_rect1_inside_rect1, 454 arbitrary_rectf2, arbitrary_size1, arbitrary_size2, arbitrary_resourceid1,
453 arbitrary_bool1, 455 arbitrary_resourceid2, arbitrary_resourceid3, arbitrary_resourceid4,
454 arbitrary_rectf1, 456 arbitrary_color_space);
455 arbitrary_size1,
456 arbitrary_size2,
457 arbitrary_resourceid1,
458 arbitrary_resourceid2,
459 arbitrary_resourceid3,
460 arbitrary_resourceid4,
461 arbitrary_color_space);
462 pass_cmp->CopyFromAndAppendDrawQuad(yuvvideo_in, 457 pass_cmp->CopyFromAndAppendDrawQuad(yuvvideo_in,
463 yuvvideo_in->shared_quad_state); 458 yuvvideo_in->shared_quad_state);
464 459
465 // Make sure the in and cmp RenderPasses match. 460 // Make sure the in and cmp RenderPasses match.
466 Compare(child_pass_cmp.get(), child_pass_in.get()); 461 Compare(child_pass_cmp.get(), child_pass_in.get());
467 ASSERT_EQ(0u, child_pass_in->shared_quad_state_list.size()); 462 ASSERT_EQ(0u, child_pass_in->shared_quad_state_list.size());
468 ASSERT_EQ(0u, child_pass_in->quad_list.size()); 463 ASSERT_EQ(0u, child_pass_in->quad_list.size());
469 Compare(pass_cmp.get(), pass_in.get()); 464 Compare(pass_cmp.get(), pass_in.get());
470 ASSERT_EQ(3u, pass_in->shared_quad_state_list.size()); 465 ASSERT_EQ(3u, pass_in->shared_quad_state_list.size());
471 ASSERT_EQ(10u, pass_in->quad_list.size()); 466 ASSERT_EQ(10u, pass_in->quad_list.size());
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 SoftwareFrameData frame_out; 753 SoftwareFrameData frame_out;
759 PickleIterator iter(msg); 754 PickleIterator iter(msg);
760 EXPECT_EQ( 755 EXPECT_EQ(
761 expect_read, 756 expect_read,
762 IPC::ParamTraits<SoftwareFrameData>::Read(&msg, &iter, &frame_out)); 757 IPC::ParamTraits<SoftwareFrameData>::Read(&msg, &iter, &frame_out));
763 } 758 }
764 } 759 }
765 760
766 } // namespace 761 } // namespace
767 } // namespace content 762 } // namespace content
OLDNEW
« cc/test/render_pass_test_common.cc ('K') | « content/common/cc_messages.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698