aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkYUVSizeInfo.h
diff options
context:
space:
mode:
authorGravatar msarett <msarett@google.com>2016-03-07 08:39:12 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-07 08:39:12 -0800
commit095d31c8a0eeb5d491febf064bc3c8a44e22b94f (patch)
tree415ad73df7c480fcb9329cec90ac2883c4c9b72f /include/core/SkYUVSizeInfo.h
parenta9101eef5ffc5f329a5edc75fd67441d868b0e9b (diff)
Update Skia's YUV API
We should match the recently designed API in SkCodec. https://codereview.chromium.org/1549473003/ This requires changes in Chromium as well. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1716523002 Review URL: https://codereview.chromium.org/1716523002
Diffstat (limited to 'include/core/SkYUVSizeInfo.h')
-rw-r--r--include/core/SkYUVSizeInfo.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/include/core/SkYUVSizeInfo.h b/include/core/SkYUVSizeInfo.h
new file mode 100644
index 0000000000..2c5a51d794
--- /dev/null
+++ b/include/core/SkYUVSizeInfo.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2016 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkYUVSizeInfo_DEFINED
+#define SkYUVSizeInfo_DEFINED
+
+struct SkYUVSizeInfo {
+ enum {
+ kY = 0,
+ kU = 1,
+ kV = 2,
+ };
+ SkISize fSizes[3];
+
+ /**
+ * While the widths of the Y, U, and V planes are not restricted, the
+ * implementation often requires that the width of the memory allocated
+ * for each plane be a multiple of 8.
+ *
+ * This struct allows us to inform the client how many "widthBytes"
+ * that we need. Note that we use the new idea of "widthBytes"
+ * because this idea is distinct from "rowBytes" (used elsewhere in
+ * Skia). "rowBytes" allow the last row of the allocation to not
+ * include any extra padding, while, in this case, every single row of
+ * the allocation must be at least "widthBytes".
+ */
+ size_t fWidthBytes[3];
+};
+
+#endif // SkYUVSizeInfo_DEFINED