diff options
author | msarett <msarett@google.com> | 2016-03-07 08:39:12 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-07 08:39:12 -0800 |
commit | 095d31c8a0eeb5d491febf064bc3c8a44e22b94f (patch) | |
tree | 415ad73df7c480fcb9329cec90ac2883c4c9b72f /include/core/SkYUVSizeInfo.h | |
parent | a9101eef5ffc5f329a5edc75fd67441d868b0e9b (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.h | 34 |
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 |