Chromium Code Reviews| Index: include/core/SkYUVSizeInfo.h |
| diff --git a/include/core/SkYUVSizeInfo.h b/include/core/SkYUVSizeInfo.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d8561084c2408c92c664c466c14c9ca8152b79aa |
| --- /dev/null |
| +++ b/include/core/SkYUVSizeInfo.h |
| @@ -0,0 +1,35 @@ |
| +/* |
| + * 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, |
| + kPlaneCount = 3, |
|
reed1
2016/02/19 22:00:23
nit: In general we have shied away from placing th
msarett
2016/02/19 22:16:12
Makes sense. No reason not to just use 3 :).
|
| + }; |
| + SkISize fSizes[kPlaneCount]; |
| + |
| + /** |
| + * 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[kPlaneCount]; |
| +}; |
| + |
| +#endif // SkYUVSizeInfo_DEFINED |