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

Side by Side Diff: cc/ipc/cc_param_traits_unittest.cc

Issue 2683763003: cc: make resource keep video buffer format for hardware overlay.
Patch Set: plumbing video format to ozone Created 3 years, 10 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 <stddef.h> 5 #include <stddef.h>
6 #include <string.h> 6 #include <string.h>
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 } 155 }
156 156
157 void Compare(const SolidColorDrawQuad* a, const SolidColorDrawQuad* b) { 157 void Compare(const SolidColorDrawQuad* a, const SolidColorDrawQuad* b) {
158 EXPECT_EQ(a->color, b->color); 158 EXPECT_EQ(a->color, b->color);
159 EXPECT_EQ(a->force_anti_aliasing_off, b->force_anti_aliasing_off); 159 EXPECT_EQ(a->force_anti_aliasing_off, b->force_anti_aliasing_off);
160 } 160 }
161 161
162 void Compare(const StreamVideoDrawQuad* a, const StreamVideoDrawQuad* b) { 162 void Compare(const StreamVideoDrawQuad* a, const StreamVideoDrawQuad* b) {
163 EXPECT_EQ(a->resource_id(), b->resource_id()); 163 EXPECT_EQ(a->resource_id(), b->resource_id());
164 EXPECT_EQ(a->resource_size_in_pixels(), b->resource_size_in_pixels()); 164 EXPECT_EQ(a->resource_size_in_pixels(), b->resource_size_in_pixels());
165 EXPECT_EQ(a->format, b->format);
165 EXPECT_EQ(a->matrix, b->matrix); 166 EXPECT_EQ(a->matrix, b->matrix);
166 } 167 }
167 168
168 void Compare(const SurfaceDrawQuad* a, const SurfaceDrawQuad* b) { 169 void Compare(const SurfaceDrawQuad* a, const SurfaceDrawQuad* b) {
169 EXPECT_EQ(a->surface_id, b->surface_id); 170 EXPECT_EQ(a->surface_id, b->surface_id);
170 } 171 }
171 172
172 void Compare(const TextureDrawQuad* a, const TextureDrawQuad* b) { 173 void Compare(const TextureDrawQuad* a, const TextureDrawQuad* b) {
173 EXPECT_EQ(a->resource_id(), b->resource_id()); 174 EXPECT_EQ(a->resource_id(), b->resource_id());
174 EXPECT_EQ(a->resource_size_in_pixels(), b->resource_size_in_pixels()); 175 EXPECT_EQ(a->resource_size_in_pixels(), b->resource_size_in_pixels());
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 gfx::Size arbitrary_size1(15, 19); 249 gfx::Size arbitrary_size1(15, 19);
249 gfx::Size arbitrary_size2(3, 99); 250 gfx::Size arbitrary_size2(3, 99);
250 gfx::Size arbitrary_size3(75, 1281); 251 gfx::Size arbitrary_size3(75, 1281);
251 gfx::RectF arbitrary_rectf1(4.2f, -922.1f, 15.6f, 29.5f); 252 gfx::RectF arbitrary_rectf1(4.2f, -922.1f, 15.6f, 29.5f);
252 gfx::RectF arbitrary_rectf2(2.1f, -411.05f, 7.8f, 14.75f); 253 gfx::RectF arbitrary_rectf2(2.1f, -411.05f, 7.8f, 14.75f);
253 gfx::SizeF arbitrary_sizef1(15.2f, 104.6f); 254 gfx::SizeF arbitrary_sizef1(15.2f, 104.6f);
254 gfx::PointF arbitrary_pointf1(31.4f, 15.9f); 255 gfx::PointF arbitrary_pointf1(31.4f, 15.9f);
255 gfx::PointF arbitrary_pointf2(26.5f, -35.8f); 256 gfx::PointF arbitrary_pointf2(26.5f, -35.8f);
256 gfx::Vector2dF arbitrary_vector2df1(16.2f, -85.1f); 257 gfx::Vector2dF arbitrary_vector2df1(16.2f, -85.1f);
257 gfx::Vector2dF arbitrary_vector2df2(-8.3f, 0.47f); 258 gfx::Vector2dF arbitrary_vector2df2(-8.3f, 0.47f);
259 gfx::BufferFormat arbitrary_format = gfx::BufferFormat::YVU_420;
258 float arbitrary_float1 = 0.7f; 260 float arbitrary_float1 = 0.7f;
259 float arbitrary_float2 = 0.3f; 261 float arbitrary_float2 = 0.3f;
260 float arbitrary_float3 = 0.9f; 262 float arbitrary_float3 = 0.9f;
261 float arbitrary_float_array[4] = {3.5f, 6.2f, 9.3f, 12.3f}; 263 float arbitrary_float_array[4] = {3.5f, 6.2f, 9.3f, 12.3f};
262 bool arbitrary_bool1 = true; 264 bool arbitrary_bool1 = true;
263 bool arbitrary_bool2 = false; 265 bool arbitrary_bool2 = false;
264 bool arbitrary_bool3 = true; 266 bool arbitrary_bool3 = true;
265 bool arbitrary_bool4 = true; 267 bool arbitrary_bool4 = true;
266 bool arbitrary_bool5 = false; 268 bool arbitrary_bool5 = false;
267 bool arbitrary_bool6 = true; 269 bool arbitrary_bool6 = true;
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 arbitrary_rect2_inside_rect3, arbitrary_bool1, 367 arbitrary_rect2_inside_rect3, arbitrary_bool1,
366 arbitrary_color, arbitrary_bool2); 368 arbitrary_color, arbitrary_bool2);
367 pass_cmp->CopyFromAndAppendDrawQuad(solidcolor_in, 369 pass_cmp->CopyFromAndAppendDrawQuad(solidcolor_in,
368 solidcolor_in->shared_quad_state); 370 solidcolor_in->shared_quad_state);
369 371
370 StreamVideoDrawQuad* streamvideo_in = 372 StreamVideoDrawQuad* streamvideo_in =
371 pass_in->CreateAndAppendDrawQuad<StreamVideoDrawQuad>(); 373 pass_in->CreateAndAppendDrawQuad<StreamVideoDrawQuad>();
372 streamvideo_in->SetAll( 374 streamvideo_in->SetAll(
373 shared_state3_in, arbitrary_rect2, arbitrary_rect2_inside_rect2, 375 shared_state3_in, arbitrary_rect2, arbitrary_rect2_inside_rect2,
374 arbitrary_rect1_inside_rect2, arbitrary_bool1, arbitrary_resourceid2, 376 arbitrary_rect1_inside_rect2, arbitrary_bool1, arbitrary_resourceid2,
375 arbitrary_size1, arbitrary_matrix1); 377 arbitrary_size1, arbitrary_format, arbitrary_matrix1);
376 pass_cmp->CopyFromAndAppendDrawQuad(streamvideo_in, 378 pass_cmp->CopyFromAndAppendDrawQuad(streamvideo_in,
377 streamvideo_in->shared_quad_state); 379 streamvideo_in->shared_quad_state);
378 380
379 cc::SurfaceId arbitrary_surface_id( 381 cc::SurfaceId arbitrary_surface_id(
380 kArbitraryFrameSinkId, 382 kArbitraryFrameSinkId,
381 cc::LocalSurfaceId(3, base::UnguessableToken::Create())); 383 cc::LocalSurfaceId(3, base::UnguessableToken::Create()));
382 SurfaceDrawQuad* surface_in = 384 SurfaceDrawQuad* surface_in =
383 pass_in->CreateAndAppendDrawQuad<SurfaceDrawQuad>(); 385 pass_in->CreateAndAppendDrawQuad<SurfaceDrawQuad>();
384 surface_in->SetAll(shared_state3_in, arbitrary_rect2, 386 surface_in->SetAll(shared_state3_in, arbitrary_rect2,
385 arbitrary_rect2_inside_rect2, arbitrary_rect1_inside_rect2, 387 arbitrary_rect2_inside_rect2, arbitrary_rect1_inside_rect2,
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 base::PickleIterator iter(msg); 621 base::PickleIterator iter(msg);
620 EXPECT_TRUE(IPC::ParamTraits<CompositorFrame>::Read(&msg, &iter, &frame_out)); 622 EXPECT_TRUE(IPC::ParamTraits<CompositorFrame>::Read(&msg, &iter, &frame_out));
621 623
622 ASSERT_EQ(2u, frame_out.resource_list.size()); 624 ASSERT_EQ(2u, frame_out.resource_list.size());
623 Compare(arbitrary_resource1, frame_out.resource_list[0]); 625 Compare(arbitrary_resource1, frame_out.resource_list[0]);
624 Compare(arbitrary_resource2, frame_out.resource_list[1]); 626 Compare(arbitrary_resource2, frame_out.resource_list[1]);
625 } 627 }
626 628
627 } // namespace 629 } // namespace
628 } // namespace content 630 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698