skia2/include/core/SkYUVSizeInfo.h
Cary Clark d98f78cd01 alternative no anonymous enums
Anonymous enums play havoc with documentation;
there's no name to refer to. It may be that all
enums may either be named or replaced with constexpr
without breaking anything. Try replacing all
anonymous enums in include/core to see what happens.

This names SkCanvas::SaveLayerFlagsSet but leaves
SkCanvas::SaveLayerFlags as a uint32_t, to reduce
risk as compared to review.skia.org/123584.

There's also some chance that external linkage will
break if some client refers to anonymous enum in a way
that could require its address: see
https://stackoverflow.com/questions/22867654/enum-vs-constexpr-for-actual-static-constants-inside-classes
(This CL does not require definitions + declarations)

Brought bookmaker docs in line with this change.
This also tripped over missing code in bookmaker
handling constexpr so added that as well.

R=reed@google.com,bsalomon@google.com

Docs-Preview: https://skia.org/?cl=123920
Docs-Preview: https://skia.org/?cl=123584
Bug: skia:6898
Change-Id: I14a342edcfd59e139ef9e4501f562417c4c60391
Reviewed-on: https://skia-review.googlesource.com/123920
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
2018-04-26 17:11:53 +00:00

37 lines
1.0 KiB
C

/*
* 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
#include "SkSize.h"
struct SkYUVSizeInfo {
enum YUVIndex {
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