From d98f78cd019d96f902197711c5e7e43afec3c3de Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Thu, 26 Apr 2018 08:32:37 -0400 Subject: 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 Commit-Queue: Cary Clark --- docs/SkCanvas_Reference.bmh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'docs/SkCanvas_Reference.bmh') diff --git a/docs/SkCanvas_Reference.bmh b/docs/SkCanvas_Reference.bmh index 0bce15e947..f4672c4dc5 100644 --- a/docs/SkCanvas_Reference.bmh +++ b/docs/SkCanvas_Reference.bmh @@ -1678,15 +1678,17 @@ add new markup to associate typedef SaveLayerFlags with Enum so that, for documentation purposes, this enum is named rather than anonymous ## -#Enum +#Enum SaveLayerFlagsSet #Line # sets SaveLayerRec options ## #Code - enum { + enum SaveLayerFlagsSet { kPreserveLCDText_SaveLayerFlag = 1 << 1, kInitWithPrevious_SaveLayerFlag = 1 << 2, kMaskAgainstCoverage_EXPERIMENTAL_DONT_USE_SaveLayerFlag = 1 << 3, kDontClipToLayer_Legacy_SaveLayerFlag = kDontClipToLayer_PrivateSaveLayerFlag, }; + + typedef uint32_t SaveLayerFlags; ## SaveLayerFlags provides options that may be used in any combination in SaveLayerRec, @@ -1838,7 +1840,8 @@ Sets fBounds, fPaint, and fBackdrop to nullptr. Clears fSaveLayerFlags. ## -#Method SaveLayerRec(const SkRect* bounds, const SkPaint* paint, SaveLayerFlags saveLayerFlags = 0) +#Method SaveLayerRec(const SkRect* bounds, const SkPaint* paint, + SaveLayerFlags saveLayerFlags = 0) Sets fBounds, fPaint, and fSaveLayerFlags; sets fBackdrop to nullptr. -- cgit v1.2.3