diff options
author | 2018-04-26 08:32:37 -0400 | |
---|---|---|
committer | 2018-04-26 17:11:53 +0000 | |
commit | d98f78cd019d96f902197711c5e7e43afec3c3de (patch) | |
tree | 376d0bae10124bc51f150a8834c1e54d989d6a7e /site/user/api/SkMatrix_Reference.md | |
parent | ba37e5b1c9bd24a86584a3e80347a82175a2403a (diff) |
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>
Diffstat (limited to 'site/user/api/SkMatrix_Reference.md')
-rw-r--r-- | site/user/api/SkMatrix_Reference.md | 44 |
1 files changed, 19 insertions, 25 deletions
diff --git a/site/user/api/SkMatrix_Reference.md b/site/user/api/SkMatrix_Reference.md index a42edc1a85..6acd4b64a8 100644 --- a/site/user/api/SkMatrix_Reference.md +++ b/site/user/api/SkMatrix_Reference.md @@ -121,6 +121,8 @@ improve performance. <a href="#Matrix">Matrix</a> is not thread safe unless <a h | name | description | | --- | --- | +| <a href="#AffineIndex">AffineIndex</a> | affine member indices | +| <a href="#MemberIndex">MemberIndex</a> | member indices | | <a href="#Property">Property</a> | values and attributes | | <a href="#Set">Set</a> | set one or more matrix values | | <a href="#Transform">Transform</a> | map points with <a href="#Matrix">Matrix</a> | @@ -792,20 +794,18 @@ Skews are not similar and do not preserve right angles. --- -## <a name="SkMatrix__anonymous"></a> Enum SkMatrix::_anonymous +## <a name="MemberIndex"></a> MemberIndex <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - enum { - <a href="#SkMatrix_kMScaleX">kMScaleX</a>, - <a href="#SkMatrix_kMSkewX">kMSkewX</a>, - <a href="#SkMatrix_kMTransX">kMTransX</a>, - <a href="#SkMatrix_kMSkewY">kMSkewY</a>, - <a href="#SkMatrix_kMScaleY">kMScaleY</a>, - <a href="#SkMatrix_kMTransY">kMTransY</a>, - <a href="#SkMatrix_kMPersp0">kMPersp0</a>, - <a href="#SkMatrix_kMPersp1">kMPersp1</a>, - <a href="#SkMatrix_kMPersp2">kMPersp2</a>, - }; + static constexpr int <a href="#SkMatrix_kMScaleX">kMScaleX</a> = 0; + static constexpr int <a href="#SkMatrix_kMSkewX">kMSkewX</a> = 1; + static constexpr int <a href="#SkMatrix_kMTransX">kMTransX</a> = 2; + static constexpr int <a href="#SkMatrix_kMSkewY">kMSkewY</a> = 3; + static constexpr int <a href="#SkMatrix_kMScaleY">kMScaleY</a> = 4; + static constexpr int <a href="#SkMatrix_kMTransY">kMTransY</a> = 5; + static constexpr int <a href="#SkMatrix_kMPersp0">kMPersp0</a> = 6; + static constexpr int <a href="#SkMatrix_kMPersp1">kMPersp1</a> = 7; + static constexpr int <a href="#SkMatrix_kMPersp2">kMPersp2</a> = 8; </pre> <a href="#Matrix">Matrix</a> organizes its values in row order. These members correspond to @@ -851,19 +851,15 @@ each value in <a href="#Matrix">Matrix</a>. <a href="#SkMatrix_get">get</a> <a href="#SkMatrix_set">set</a> - - -## <a name="SkMatrix__anonymous_2"></a> Enum SkMatrix::_anonymous_2 +## <a name="AffineIndex"></a> AffineIndex <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - enum { - <a href="#SkMatrix_kAScaleX">kAScaleX</a>, - <a href="#SkMatrix_kASkewY">kASkewY</a>, - <a href="#SkMatrix_kASkewX">kASkewX</a>, - <a href="#SkMatrix_kAScaleY">kAScaleY</a>, - <a href="#SkMatrix_kATransX">kATransX</a>, - <a href="#SkMatrix_kATransY">kATransY</a>, - }; + static constexpr int <a href="#SkMatrix_kAScaleX">kAScaleX</a> = 0; + static constexpr int <a href="#SkMatrix_kASkewY">kASkewY</a> = 1; + static constexpr int <a href="#SkMatrix_kASkewX">kASkewX</a> = 2; + static constexpr int <a href="#SkMatrix_kAScaleY">kAScaleY</a> = 3; + static constexpr int <a href="#SkMatrix_kATransX">kATransX</a> = 4; + static constexpr int <a href="#SkMatrix_kATransY">kATransY</a> = 5; </pre> Affine arrays are in column major order to match the matrix used by @@ -896,8 +892,6 @@ PDF and XPS. <a href="#SkMatrix_SetAffineIdentity">SetAffineIdentity</a> <a href="#SkMatrix_asAffine">asAffine</a> <a href="#SkMatrix_setAffine">setAffine</a> - - ## <a name="Operator"></a> Operator | name | description | |