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

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

Issue 2173563002: Improve GL shader YUV adjustment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebaseline cc tests Created 4 years, 5 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/ipc/quads_struct_traits.h" 5 #include "cc/ipc/quads_struct_traits.h"
6 #include "ui/gfx/mojo/transform_struct_traits.h" 6 #include "ui/gfx/mojo/transform_struct_traits.h"
7 7
8 namespace mojo { 8 namespace mojo {
9 9
10 namespace { 10 namespace {
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 data.a_plane_resource_id(); 283 data.a_plane_resource_id();
284 static_assert(cc::YUVVideoDrawQuad::kAPlaneResourceIdIndex == 284 static_assert(cc::YUVVideoDrawQuad::kAPlaneResourceIdIndex ==
285 cc::DrawQuad::Resources::kMaxResourceIdCount - 1, 285 cc::DrawQuad::Resources::kMaxResourceIdCount - 1,
286 "The A plane resource should be the last resource ID."); 286 "The A plane resource should be the last resource ID.");
287 quad->resources.count = data.a_plane_resource_id() ? 4 : 3; 287 quad->resources.count = data.a_plane_resource_id() ? 4 : 3;
288 288
289 if (!data.ReadColorSpace(&quad->color_space)) 289 if (!data.ReadColorSpace(&quad->color_space))
290 return false; 290 return false;
291 quad->resource_offset = data.resource_offset(); 291 quad->resource_offset = data.resource_offset();
292 quad->resource_multiplier = data.resource_multiplier(); 292 quad->resource_multiplier = data.resource_multiplier();
293 quad->bits_per_channel = data.bits_per_channel();
293 return true; 294 return true;
294 } 295 }
295 296
296 // static 297 // static
297 bool StructTraits<cc::mojom::DrawQuad, cc::DrawQuad>::Read( 298 bool StructTraits<cc::mojom::DrawQuad, cc::DrawQuad>::Read(
298 cc::mojom::DrawQuadDataView data, 299 cc::mojom::DrawQuadDataView data,
299 cc::DrawQuad* out) { 300 cc::DrawQuad* out) {
300 if (!ReadDrawQuad(data, out)) 301 if (!ReadDrawQuad(data, out))
301 return false; 302 return false;
302 switch (data.material()) { 303 switch (data.material()) {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 if (!AllocateAndConstruct(materials[i], out)) 368 if (!AllocateAndConstruct(materials[i], out))
368 return false; 369 return false;
369 } 370 }
370 // The materials array and the quads array are expected to be the same size. 371 // The materials array and the quads array are expected to be the same size.
371 // If they are not, then deserialization will fail. 372 // If they are not, then deserialization will fail.
372 QuadListArray quad_list_array = {materials.size(), out}; 373 QuadListArray quad_list_array = {materials.size(), out};
373 return data.ReadQuads(&quad_list_array); 374 return data.ReadQuads(&quad_list_array);
374 } 375 }
375 376
376 } // namespace mojo 377 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698