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

Unified Diff: components/arc/video_accelerator/video_accelerator_struct_traits.cc

Issue 2513973002: Use mojo typemap to simplify the code using DmabufPlane (Closed)
Patch Set: Addressed comments Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/arc/video_accelerator/video_accelerator_struct_traits.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/arc/video_accelerator/video_accelerator_struct_traits.cc
diff --git a/components/arc/video_accelerator/video_accelerator_struct_traits.cc b/components/arc/video_accelerator/video_accelerator_struct_traits.cc
new file mode 100644
index 0000000000000000000000000000000000000000..3feb966d8af5945eb215abd0145c92a85bae8bdb
--- /dev/null
+++ b/components/arc/video_accelerator/video_accelerator_struct_traits.cc
@@ -0,0 +1,23 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/arc/video_accelerator/video_accelerator_struct_traits.h"
+
+namespace mojo {
+
+// static
+bool StructTraits<arc::mojom::ArcVideoAcceleratorDmabufPlaneDataView,
+ arc::ArcVideoAcceleratorDmabufPlane>::
+ Read(arc::mojom::ArcVideoAcceleratorDmabufPlaneDataView data,
+ arc::ArcVideoAcceleratorDmabufPlane* out) {
+ if (data.offset() < 0 || data.stride() < 0) {
+ return false;
+ }
+
+ out->offset = data.offset();
+ out->stride = data.stride();
+ return true;
+}
+
+} // namespace mojo
« no previous file with comments | « components/arc/video_accelerator/video_accelerator_struct_traits.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698