fix bookmaker

more strict bookmaker rules are now in effect;
all methods require documentation, and all documentation
is checked for accuracy.

In this case, the multiple temporary copies of SkPaint::getHinting
and SkPaint::setHinting are checked.

In an upcoming change, bookmaker will ignore symbols marked
as deprecated, experimental, or private; making this bookmaker's
strictness a little more palatable.

TBR=reed@google.com

Docs-Preview: https://skia.org/?cl=169822
Bug: skia:
Change-Id: If1bc079a13828a5ca435911338b9c75acbe8ad6f
Reviewed-on: https://skia-review.googlesource.com/c/169822
Commit-Queue: Cary Clark <caryclark@skia.org>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Cary Clark <caryclark@skia.org>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Cary Clark <caryclark@skia.org>
This commit is contained in:
Cary Clark 2018-11-08 13:31:39 -05:00 committed by Skia Commit-Bot
parent 909e61c26c
commit 885f10787b
4 changed files with 30 additions and 16 deletions

View File

@ -391,7 +391,7 @@ Set SkPaintDefaults_Hinting at compile time to change the default setting.
## ##
## ##
#Method void setHinting(Hinting hintingLevel) #Method void setHinting(Hinting h)
#In Hinting #In Hinting
#Populate #Populate

View File

@ -345,14 +345,14 @@ FT_Load_Glyph
## ##
#Class SkFont #Class SkFont
## ##
#Enum SkFontHinting #EnumClass SkFontHinting
#Const kNo_SkFontHinting 0 #Const kNone 0
## ##
#Const kSlight_SkFontHinting 1 #Const kSlight 1
## ##
#Const kNormal_SkFontHinting 2 #Const kNormal 2
## ##
#Const kFull_SkFontHinting 3 #Const kFull 3
## ##
## ##
#Struct SkFontMetrics #Struct SkFontMetrics

View File

@ -201,18 +201,31 @@ public:
/** Sets level of glyph outline adjustment. /** Sets level of glyph outline adjustment.
Does not check for valid values of hintingLevel. Does not check for valid values of hintingLevel.
@param hintingLevel one of: kNo_SkFontHinting, kSlight_SkFontHinting, @param hintingLevel one of: SkFontHinting::kNone, SkFontHinting::kSlight,
kNormal_SkFontHinting, kFull_SkFontHinting SkFontHinting::kNormal, SkFontHinting::kFull
*/ */
void setHinting(SkFontHinting hintingLevel); void setHinting(SkFontHinting hintingLevel);
#ifdef SK_SUPPORT_LEGACY_NESTED_HINTINGENUM #ifdef SK_SUPPORT_LEGACY_NESTED_HINTINGENUM
/** Returns level of glyph outline adjustment.
@return one of: kNo_Hinting, kSlight_Hinting, kNormal_Hinting, kFull_Hinting
*/
Hinting getHinting() const { return (Hinting)fBitfields.fHinting; } Hinting getHinting() const { return (Hinting)fBitfields.fHinting; }
/** Sets level of glyph outline adjustment.
Does not check for valid values of h.
@param h one of: kNo_Hinting, kSlight_Hinting, kNormal_Hinting, kFull_Hinting
*/
void setHinting(Hinting h) { void setHinting(Hinting h) {
this->setHinting((SkFontHinting)h); this->setHinting((SkFontHinting)h);
} }
#else #else
/** Returns level of glyph outline adjustment. /** Returns level of glyph outline adjustment.
@return one of: SkFontHinting::kNone, SkFontHinting::kSlight, SkFontHinting::kNormal,
SkFontHinting::kFull
*/ */
SkFontHinting getHinting() const { return (SkFontHinting)fBitfields.fHinting; } SkFontHinting getHinting() const { return (SkFontHinting)fBitfields.fHinting; }
#endif #endif

View File

@ -27,11 +27,12 @@ class <a href='SkPaint_Reference#SkPaint'>SkPaint</a> {
<a href='#SkPaint_kFull_Hinting'>kFull_Hinting</a> = 3, <a href='#SkPaint_kFull_Hinting'>kFull_Hinting</a> = 3,
}; };
<a href='#SkPaint_kFull_Hinting'>void</a> <a href='#SkPaint_setHinting'>setHinting</a>(<a href='undocumented#SkFontHinting'>SkFontHinting</a> <a href='undocumented#SkFontHinting'>hintingLevel</a>);
<a href='#SkPaint_Hinting'>Hinting</a> <a href='#SkPaint_getHinting'>getHinting</a>() <a href='#SkPaint_getHinting'>const</a>; <a href='#SkPaint_Hinting'>Hinting</a> <a href='#SkPaint_getHinting'>getHinting</a>() <a href='#SkPaint_getHinting'>const</a>;
<a href='#SkPaint_getHinting'>void</a> <a href='#SkPaint_setHinting'>setHinting</a>(<a href='undocumented#SkFontHinting'>SkFontHinting</a> <a href='undocumented#SkFontHinting'>hintingLevel</a>); <a href='#SkPaint_getHinting'>void</a> <a href='#SkPaint_setHinting'>setHinting</a>(<a href='#SkPaint_Hinting'>Hinting</a> <a href='#SkPaint_Hinting'>h</a>);
<a href='undocumented#SkFontHinting'>void</a> <a href='#SkPaint_setHinting'>setHinting</a>(<a href='#SkPaint_Hinting'>Hinting</a> <a href='#SkPaint_Hinting'>hintingLevel</a>); <a href='undocumented#SkFontHinting'>SkFontHinting</a> <a href='#SkPaint_getHinting'>getHinting</a>() <a href='#SkPaint_getHinting'>const</a>;
<a href='#SkPaint_Hinting'>enum</a> <a href='#SkPaint_Flags'>Flags</a> { <a href='#SkPaint_getHinting'>enum</a> <a href='#SkPaint_Flags'>Flags</a> {
<a href='#SkPaint_kAntiAlias_Flag'>kAntiAlias_Flag</a> = 0<a href='#SkPaint_kAntiAlias_Flag'>x01</a>, <a href='#SkPaint_kAntiAlias_Flag'>kAntiAlias_Flag</a> = 0<a href='#SkPaint_kAntiAlias_Flag'>x01</a>,
<a href='#SkPaint_kDither_Flag'>kDither_Flag</a> = 0<a href='#SkPaint_kDither_Flag'>x04</a>, <a href='#SkPaint_kDither_Flag'>kDither_Flag</a> = 0<a href='#SkPaint_kDither_Flag'>x04</a>,
<a href='#SkPaint_kFakeBoldText_Flag'>kFakeBoldText_Flag</a> = 0<a href='#SkPaint_kFakeBoldText_Flag'>x20</a>, <a href='#SkPaint_kFakeBoldText_Flag'>kFakeBoldText_Flag</a> = 0<a href='#SkPaint_kFakeBoldText_Flag'>x20</a>,
@ -715,11 +716,11 @@ Does not check for valid values of <a href='#SkPaint_setHinting_hintingLevel'>hi
### Parameters ### Parameters
<table> <tr> <td><a name='SkPaint_setHinting_hintingLevel'><code><strong>hintingLevel</strong></code></a></td> <table> <tr> <td><a name='SkPaint_setHinting_hintingLevel'><code><strong>hintingLevel</strong></code></a></td>
<td>one of: <a href='undocumented#kNo_SkFontHinting'>kNo_SkFontHinting</a>, <a href='undocumented#kSlight_SkFontHinting'>kSlight_SkFontHinting</a>,</td> <td>one of: <a href='undocumented#SkFontHinting'>SkFontHinting</a>::<a href='#SkFontHinting_kNone'>kNone</a>, <a href='undocumented#SkFontHinting'>SkFontHinting</a>::<a href='#SkFontHinting_kSlight'>kSlight</a>,</td>
</tr> </tr>
</table> </table>
<a href='undocumented#kNormal_SkFontHinting'>kNormal_SkFontHinting</a>, <a href='undocumented#kFull_SkFontHinting'>kFull_SkFontHinting</a> <a href='undocumented#SkFontHinting'>SkFontHinting</a>::<a href='#SkFontHinting_kNormal'>kNormal</a>, <a href='undocumented#SkFontHinting'>SkFontHinting</a>::<a href='#SkFontHinting_kFull'>kFull</a>
### Example ### Example
@ -738,15 +739,15 @@ paint1 == paint2
--- ---
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
void <a href='#SkPaint_setHinting'>setHinting</a>(<a href='#SkPaint_Hinting'>Hinting</a> <a href='#SkPaint_Hinting'>hintingLevel</a>) void <a href='#SkPaint_setHinting'>setHinting</a>(<a href='#SkPaint_Hinting'>Hinting</a> <a href='#SkPaint_Hinting'>h</a>)
</pre> </pre>
Sets level of <a href='undocumented#Glyph'>glyph</a> <a href='undocumented#Glyph'>outline</a> <a href='undocumented#Glyph'>adjustment</a>. Sets level of <a href='undocumented#Glyph'>glyph</a> <a href='undocumented#Glyph'>outline</a> <a href='undocumented#Glyph'>adjustment</a>.
Does not check for valid values of <a href='#SkPaint_setHinting_2_hintingLevel'>hintingLevel</a>. Does not check for valid values of <a href='#SkPaint_setHinting_2_h'>h</a>.
### Parameters ### Parameters
<table> <tr> <td><a name='SkPaint_setHinting_2_hintingLevel'><code><strong>hintingLevel</strong></code></a></td> <table> <tr> <td><a name='SkPaint_setHinting_2_h'><code><strong>h</strong></code></a></td>
<td>one of: <a href='#SkPaint_kNo_Hinting'>kNo_Hinting</a>, <a href='#SkPaint_kSlight_Hinting'>kSlight_Hinting</a>, <a href='#SkPaint_kNormal_Hinting'>kNormal_Hinting</a>, <a href='#SkPaint_kFull_Hinting'>kFull_Hinting</a></td> <td>one of: <a href='#SkPaint_kNo_Hinting'>kNo_Hinting</a>, <a href='#SkPaint_kSlight_Hinting'>kSlight_Hinting</a>, <a href='#SkPaint_kNormal_Hinting'>kNormal_Hinting</a>, <a href='#SkPaint_kFull_Hinting'>kFull_Hinting</a></td>
</tr> </tr>
</table> </table>