blob: ae938fbffefd62fe2f7756222aa1bbcf35b0039c [file] [log] [blame] [view]
Cary Clark12799e12017-07-28 15:18:29 -04001SkPaint Reference
2===
3
4# <a name="Paint"></a> Paint
5<a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> controls options applied when drawing and measuring. <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> collects all
6options outside of the <a href="bmh_SkCanvas_Reference?cl=9919#Clip">Canvas Clip</a> and <a href="bmh_SkCanvas_Reference?cl=9919#Matrix">Canvas Matrix</a>.
7
8Various options apply to text, strokes and fills, and images.
9
10Some options may not be implemented on all platforms; in these cases, setting
11the option has no effect. Some options are conveniences that duplicate <a href="bmh_SkCanvas_Reference?cl=9919#Canvas">Canvas</a>
12functionality; for instance, text size is identical to matrix scale.
13
14<a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> options are rarely exclusive; each option modifies a stage of the drawing
15pipeline and multiple pipeline stages may be affected by a single <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a>.
16
17<a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> collects effects and filters that describe single-pass and multiple-pass
18algorithms that alter the drawing geometry, color, and transparency. For instance,
19<a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> does not directly implement dashing or blur, but contains the objects that do so.
20
21The objects contained by <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> are opaque, and cannot be edited outside of the <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a>
22to affect it. The implementation is free to defer computations associated with the
23<a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a>, or ignore them altogether. For instance, some <a href="bmh_undocumented?cl=9919#GPU">GPU</a> implementations draw all
24<a href="bmh_SkPath_Reference?cl=9919#Path">Path</a> geometries with anti-aliasing, regardless of <a href="bmh_SkPaint_Reference?cl=9919#kAntiAlias_Flag">SkPaint::kAntiAlias Flag</a> setting.
25
26<a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> describes a single color, a single font, a single image quality, and so on.
27Multiple colors are drawn either by using multiple paints or with objects like
28<a href="bmh_undocumented?cl=9919#Shader">Shader</a> attached to <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a>.
29
30# <a name="SkPaint"></a> Class SkPaint
31
32# <a name="Overview"></a> Overview
33
34## <a name="Subtopics"></a> Subtopics
35
36| topics | description |
37| --- | --- |
38| <a href="bmh_SkPaint_Reference?cl=9919#Initializers">Initializers</a> | Constructors and initialization. |
39| <a href="bmh_SkPaint_Reference?cl=9919#Destructor">Destructor</a> | <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> termination. |
40| <a href="bmh_SkPaint_Reference?cl=9919#Management">Management</a> | <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> copying, moving, comparing. |
41| <a href="bmh_SkPaint_Reference?cl=9919#Hinting">Hinting</a> | <a href="bmh_undocumented?cl=9919#Glyph">Glyph</a> outline adjustment. |
42| <a href="bmh_SkPaint_Reference?cl=9919#Flags">Flags</a> | Attributes represented by single bits. |
43| <a href="bmh_SkPaint_Reference?cl=9919#Anti_alias">Anti-alias</a> | Approximating coverage with transparency. |
44| <a href="bmh_SkPaint_Reference?cl=9919#Dither">Dither</a> | Distributing color error. |
45| <a href="bmh_SkPaint_Reference?cl=9919#Device_Text">Device Text</a> | Increase precision of glyph position. |
46| <a href="bmh_SkPaint_Reference?cl=9919#Font_Embedded_Bitmaps">Font Embedded Bitmaps</a> | Custom-sized bitmap glyphs. |
47| <a href="bmh_SkPaint_Reference?cl=9919#Automatic_Hinting">Automatic Hinting</a> | Always adjust glyph paths. |
48| <a href="bmh_SkPaint_Reference?cl=9919#Vertical_Text">Vertical Text</a> | Orient text from top to bottom. |
49| <a href="bmh_SkPaint_Reference?cl=9919#Fake_Bold">Fake Bold</a> | Approximate font styles. |
50| <a href="bmh_SkPaint_Reference?cl=9919#Full_Hinting_Spacing">Full Hinting Spacing</a> | <a href="bmh_undocumented?cl=9919#Glyph">Glyph</a> spacing affected by hinting. |
51| <a href="bmh_SkPaint_Reference?cl=9919#Filter_Quality_Methods">Filter Quality Methods</a> | Get and set <a href="bmh_undocumented?cl=9919#Filter_Quality">Filter Quality</a>. |
52| <a href="bmh_SkPaint_Reference?cl=9919#Color_Methods">Color Methods</a> | Get and set <a href="bmh_undocumented?cl=9919#Color">Color</a>. |
53| <a href="bmh_SkPaint_Reference?cl=9919#Style">Style</a> | Geometry filling, stroking. |
54| <a href="bmh_SkPaint_Reference?cl=9919#Stroke_Width">Stroke Width</a> | Thickness perpendicular to geometry. |
55| <a href="bmh_SkPaint_Reference?cl=9919#Miter_Limit">Miter Limit</a> | Maximum length of stroked corners. |
56| <a href="bmh_SkPaint_Reference?cl=9919#Stroke_Cap">Stroke Cap</a> | Decorations at ends of open strokes. |
57| <a href="bmh_SkPaint_Reference?cl=9919#Stroke_Join">Stroke Join</a> | Decoration at corners of strokes. |
58| <a href="bmh_SkPaint_Reference?cl=9919#Fill_Path">Fill Path</a> | Make <a href="bmh_SkPath_Reference?cl=9919#Path">Path</a> from <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a>, stroking. |
59| <a href="bmh_SkPaint_Reference?cl=9919#Shader_Methods">Shader Methods</a> | Get and set <a href="bmh_undocumented?cl=9919#Shader">Shader</a>. |
60| <a href="bmh_SkPaint_Reference?cl=9919#Color_Filter_Methods">Color Filter Methods</a> | Get and set <a href="bmh_undocumented?cl=9919#Color_Filter">Color Filter</a>. |
61| <a href="bmh_SkPaint_Reference?cl=9919#Blend_Mode_Methods">Blend Mode Methods</a> | Get and set <a href="bmh_undocumented?cl=9919#Blend_Mode">Blend Mode</a>. |
62| <a href="bmh_SkPaint_Reference?cl=9919#Path_Effect_Methods">Path Effect Methods</a> | Get and set <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a>. |
63| <a href="bmh_SkPaint_Reference?cl=9919#Mask_Filter_Methods">Mask Filter Methods</a> | Get and set <a href="bmh_undocumented?cl=9919#Mask_Filter">Mask Filter</a>. |
64| <a href="bmh_SkPaint_Reference?cl=9919#Typeface_Methods">Typeface Methods</a> | Get and set <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a>. |
65| <a href="bmh_SkPaint_Reference?cl=9919#Rasterizer_Methods">Rasterizer Methods</a> | Get and set <a href="bmh_undocumented?cl=9919#Rasterizer">Rasterizer</a>. |
66| <a href="bmh_SkPaint_Reference?cl=9919#Image_Filter_Methods">Image Filter Methods</a> | Get and set <a href="bmh_undocumented?cl=9919#Image_Filter">Image Filter</a>. |
67| <a href="bmh_SkPaint_Reference?cl=9919#Draw_Looper_Methods">Draw Looper Methods</a> | Get and set <a href="bmh_undocumented?cl=9919#Draw_Looper">Draw Looper</a>. |
68| <a href="bmh_SkPaint_Reference?cl=9919#Text_Align">Text Align</a> | <a href="bmh_undocumented?cl=9919#Text">Text</a> placement relative to position. |
69| <a href="bmh_SkPaint_Reference?cl=9919#Text_Size">Text Size</a> | Overall height in points. |
70| <a href="bmh_SkPaint_Reference?cl=9919#Text_Scale_X">Text Scale X</a> | <a href="bmh_undocumented?cl=9919#Text">Text</a> horizontal scale. |
71| <a href="bmh_SkPaint_Reference?cl=9919#Text_Skew_X">Text Skew X</a> | <a href="bmh_undocumented?cl=9919#Text">Text</a> horizontal slant. |
72| <a href="bmh_SkPaint_Reference?cl=9919#Text_Encoding">Text Encoding</a> | <a href="bmh_undocumented?cl=9919#Text">Text</a> encoded as characters or glyphs. |
73| <a href="bmh_SkPaint_Reference?cl=9919#Font_Metrics">Font Metrics</a> | Common glyph dimensions. |
74| <a href="bmh_SkPaint_Reference?cl=9919#Measure_Text">Measure Text</a> | Width, height, bounds of text. |
75| <a href="bmh_SkPaint_Reference?cl=9919#Text_Path">Text Path</a> | Geometry of glyphs. |
76| <a href="bmh_SkPaint_Reference?cl=9919#Text_Intercepts">Text Intercepts</a> | Advanced underline, strike through. |
77| <a href="bmh_SkPaint_Reference?cl=9919#Fast_Bounds">Fast Bounds</a> | Appproxiate area required by <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a>. |
78
79## <a name="Constants"></a> Constants
80
81| constants | description |
82| --- | --- |
83| <a href="bmh_SkPaint_Reference?cl=9919#Align">Align</a> | <a href="bmh_undocumented?cl=9919#Glyph">Glyph</a> locations relative to text position. |
84| <a href="bmh_SkPaint_Reference?cl=9919#Cap">Cap</a> | Start and end geometry on stroked shapes. |
85| <a href="bmh_SkPaint_Reference?cl=9919#Flags">Flags</a> | Values described by bits and masks. |
86| <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_FontMetricsFlags">FontMetrics::FontMetricsFlags</a> | Valid <a href="bmh_SkPaint_Reference?cl=9919#Font_Metrics">Font Metrics</a>. |
87| <a href="bmh_SkPaint_Reference?cl=9919#Hinting">Hinting</a> | Level of glyph outline adjustment. |
88| <a href="bmh_SkPaint_Reference?cl=9919#Join">Join</a> | Corner geometry on stroked shapes. |
89| <a href="bmh_SkPaint_Reference?cl=9919#Style">Style</a> | Stroke, fill, or both. |
90| <a href="bmh_SkPaint_Reference?cl=9919#TextEncoding">TextEncoding</a> | Character or glyph encoding size. |
91
92## <a name="Structs"></a> Structs
93
94| struct | description |
95| --- | --- |
96| <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics">FontMetrics</a> | <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a> values. |
97
98## <a name="Constructors"></a> Constructors
99
100| | description |
101| --- | --- |
102| <a href="bmh_SkPaint_Reference?cl=9919#empty_constructor">SkPaint()</a> | Constructs with default values. |
103| <a href="bmh_SkPaint_Reference?cl=9919#copy_constructor">SkPaint(const SkPaint& paint)</a> | Makes a shallow copy. |
104| <a href="bmh_SkPaint_Reference?cl=9919#move_constructor">SkPaint(SkPaint&& paint)</a> | Moves paint without copying it. |
105| | Decreases <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a> of owned objects. |
106
107## <a name="Operators"></a> Operators
108
109| operator | description |
110| --- | --- |
111| <a href="bmh_SkPaint_Reference?cl=9919#copy_assignment_operator">operator=(const SkPaint& paint)</a> | Makes a shallow copy. |
112| <a href="bmh_SkPaint_Reference?cl=9919#move_assignment_operator">operator=(SkPaint&& paint)</a> | Moves paint without copying it. |
113| <a href="bmh_SkPaint_Reference?cl=9919#equal_operator">operator==(const SkPaint& a, const SkPaint& b)</a> | Compares paints for equality. |
114| <a href="bmh_SkPaint_Reference?cl=9919#not_equal_operator">operator!=(const SkPaint& a, const SkPaint& b)</a> | Compares paints for inequality. |
115
116## <a name="Member_Functions"></a> Member Functions
117
118| function | description |
119| --- | --- |
120| <a href="bmh_SkPaint_Reference?cl=9919#breakText">breakText</a> | Returns text that fits in a width. |
121| <a href="bmh_SkPaint_Reference?cl=9919#canComputeFastBounds">canComputeFastBounds</a> | Returns true if settings allow for fast bounds computation. |
122| <a href="bmh_SkPaint_Reference?cl=9919#computeFastBounds">computeFastBounds</a> | Returns fill bounds for quick reject tests. |
123| <a href="bmh_SkPaint_Reference?cl=9919#computeFastStrokeBounds">computeFastStrokeBounds</a> | Returns stroke bounds for quick reject tests. |
124| <a href="bmh_SkPaint_Reference?cl=9919#containsText">containsText</a> | Returns if all text corresponds to glyphs. |
125| <a href="bmh_SkPaint_Reference?cl=9919#countText">countText</a> | Returns number of glyphs in text. |
126| <a href="bmh_SkPaint_Reference?cl=9919#doComputeFastBounds">doComputeFastBounds</a> | Returns bounds for quick reject tests. |
127| <a href="bmh_SkPaint_Reference?cl=9919#flatten">flatten</a> | Serializes into a buffer. |
128| <a href="bmh_SkPaint_Reference?cl=9919#getAlpha">getAlpha</a> | Returns <a href="bmh_undocumented?cl=9919#Alpha">Color Alpha</a>, color opacity. |
129| <a href="bmh_SkPaint_Reference?cl=9919#getBlendMode">getBlendMode</a> | Returns <a href="bmh_undocumented?cl=9919#Blend_Mode">Blend Mode</a>, how colors combine with dest. |
130| <a href="bmh_SkPaint_Reference?cl=9919#getColor">getColor</a> | Returns <a href="bmh_undocumented?cl=9919#Alpha">Color Alpha</a> and <a href="bmh_undocumented?cl=9919#RGB">Color RGB</a>, one drawing color. |
131| <a href="bmh_SkPaint_Reference?cl=9919#getColorFilter">getColorFilter</a> | Returns <a href="bmh_undocumented?cl=9919#Color_Filter">Color Filter</a>, how colors are altered. |
132| <a href="bmh_SkPaint_Reference?cl=9919#getDrawLooper">getDrawLooper</a> | Returns <a href="bmh_undocumented?cl=9919#Draw_Looper">Draw Looper</a>, multiple layers. |
133| <a href="bmh_SkPaint_Reference?cl=9919#getFillPath">getFillPath</a> | Returns fill path equivalent to stroke. |
134| <a href="bmh_SkPaint_Reference?cl=9919#getFilterQuality">getFilterQuality</a> | Returns <a href="bmh_undocumented?cl=9919#Filter_Quality">Filter Quality</a>, image filtering level. |
135| <a href="bmh_SkPaint_Reference?cl=9919#getFlags">getFlags</a> | Returns <a href="bmh_SkPaint_Reference?cl=9919#Flags">Flags</a> stored in a bit field. |
136| <a href="bmh_SkPaint_Reference?cl=9919#getFontBounds">getFontBounds</a> | Returns union all glyph bounds. |
137| <a href="bmh_SkPaint_Reference?cl=9919#getFontMetrics">getFontMetrics</a> | Returns <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a> metrics scaled by text size. |
138| <a href="bmh_SkPaint_Reference?cl=9919#getFontSpacing">getFontSpacing</a> | Returns recommended spacing between lines. |
139| <a href="bmh_SkPaint_Reference?cl=9919#getHash">getHash</a> | Returns a shallow hash for equality checks. |
140| <a href="bmh_SkPaint_Reference?cl=9919#getHinting">getHinting</a> | Returns <a href="bmh_SkPaint_Reference?cl=9919#Hinting">Hinting</a>, glyph outline adjustment level. |
141| <a href="bmh_SkPaint_Reference?cl=9919#getImageFilter">getImageFilter</a> | Returns <a href="bmh_undocumented?cl=9919#Image_Filter">Image Filter</a>, alter pixels; blur. |
142| <a href="bmh_SkPaint_Reference?cl=9919#getMaskFilter">getMaskFilter</a> | Returns <a href="bmh_undocumented?cl=9919#Mask_Filter">Mask Filter</a>, alterations to <a href="bmh_undocumented?cl=9919#Mask_Alpha">Mask Alpha</a>. |
143| <a href="bmh_SkPaint_Reference?cl=9919#getPathEffect">getPathEffect</a> | Returns <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a>, modifications to path geometry; dashing. |
144| <a href="bmh_SkPaint_Reference?cl=9919#getPosTextPath">getPosTextPath</a> | Returns <a href="bmh_SkPath_Reference?cl=9919#Path">Path</a> equivalent to positioned text. |
145| <a href="bmh_SkPaint_Reference?cl=9919#getPosTextIntercepts">getPosTextIntercepts</a> | Returns where lines intersect positioned text; underlines. |
146| <a href="bmh_SkPaint_Reference?cl=9919#getPosTextHIntercepts">getPosTextHIntercepts</a> | Returns where lines intersect horizontally positioned text; underlines. |
147| <a href="bmh_SkPaint_Reference?cl=9919#getRasterizer">getRasterizer</a> | Returns <a href="bmh_undocumented?cl=9919#Rasterizer">Rasterizer</a>, <a href="bmh_undocumented?cl=9919#Mask_Alpha">Mask Alpha</a> generation from <a href="bmh_SkPath_Reference?cl=9919#Path">Path</a>. |
148| <a href="bmh_SkPaint_Reference?cl=9919#getShader">getShader</a> | Returns <a href="bmh_undocumented?cl=9919#Shader">Shader</a>, multiple drawing colors; gradients. |
149| <a href="bmh_SkPaint_Reference?cl=9919#getStrokeCap">getStrokeCap</a> | Returns <a href="bmh_SkPaint_Reference?cl=9919#Cap">Cap</a>, the area drawn at path ends. |
150| <a href="bmh_SkPaint_Reference?cl=9919#getStrokeJoin">getStrokeJoin</a> | Returns <a href="bmh_SkPaint_Reference?cl=9919#Join">Join</a>, geometry on path corners. |
151| <a href="bmh_SkPaint_Reference?cl=9919#getStrokeMiter">getStrokeMiter</a> | Returns <a href="bmh_SkPaint_Reference?cl=9919#Miter_Limit">Miter Limit</a>, angles with sharp corners. |
152| <a href="bmh_SkPaint_Reference?cl=9919#getStrokeWidth">getStrokeWidth</a> | Returns thickness of the stroke. |
153| <a href="bmh_SkPaint_Reference?cl=9919#getStyle">getStyle</a> | Returns <a href="bmh_SkPaint_Reference?cl=9919#Style">Style</a>: stroke, fill, or both. |
154| <a href="bmh_SkPaint_Reference?cl=9919#getTextAlign">getTextAlign</a> | Returns <a href="bmh_SkPaint_Reference?cl=9919#Align">Align</a>: left, center, or right. |
155| <a href="bmh_SkPaint_Reference?cl=9919#getTextBlobIntercepts">getTextBlobIntercepts</a> | Returns where lines intersect <a href="bmh_undocumented?cl=9919#Text_Blob">Text Blob</a>; underlines. |
156| <a href="bmh_SkPaint_Reference?cl=9919#getTextEncoding">getTextEncoding</a> | Returns character or glyph encoding size. |
157| <a href="bmh_SkPaint_Reference?cl=9919#getTextIntercepts">getTextIntercepts</a> | Returns where lines intersect text; underlines. |
158| <a href="bmh_SkPaint_Reference?cl=9919#getTextPath">getTextPath</a> | Returns <a href="bmh_SkPath_Reference?cl=9919#Path">Path</a> equivalent to text. |
159| <a href="bmh_SkPaint_Reference?cl=9919#getTextScaleX">getTextScaleX</a> | Returns the text horizontal scale; condensed text. |
160| <a href="bmh_SkPaint_Reference?cl=9919#getTextSkewX">getTextSkewX</a> | Returns the text horizontal skew; oblique text. |
161| <a href="bmh_SkPaint_Reference?cl=9919#getTextSize">getTextSize</a> | Returns text size in points. |
162| <a href="bmh_SkPaint_Reference?cl=9919#getTextWidths">getTextWidths</a> | Returns advance and bounds for each glyph in text. |
163| <a href="bmh_SkPaint_Reference?cl=9919#getTypeface">getTypeface</a> | Returns <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a>, font description. |
164| <a href="bmh_SkPaint_Reference?cl=9919#glyphsToUnichars">glyphsToUnichars</a> | Converts glyphs into text. |
165| <a href="bmh_SkPaint_Reference?cl=9919#isAntiAlias">isAntiAlias</a> | Returns true if <a href="bmh_SkPaint_Reference?cl=9919#Anti_alias">Anti-alias</a> is set. |
166| <a href="bmh_SkPaint_Reference?cl=9919#isAutohinted">isAutohinted</a> | Returns true if glyphs are always hinted. |
167| <a href="bmh_SkPaint_Reference?cl=9919#isDevKernText">isDevKernText</a> | Returns true if <a href="bmh_SkPaint_Reference?cl=9919#Full_Hinting_Spacing">Full Hinting Spacing</a> is set. |
168| <a href="bmh_SkPaint_Reference?cl=9919#isDither">isDither</a> | Returns true if <a href="bmh_SkPaint_Reference?cl=9919#Dither">Dither</a> is set. |
169| <a href="bmh_SkPaint_Reference?cl=9919#isEmbeddedBitmapText">isEmbeddedBitmapText</a> | Returns true if <a href="bmh_SkPaint_Reference?cl=9919#Font_Embedded_Bitmaps">Font Embedded Bitmaps</a> is set. |
170| <a href="bmh_SkPaint_Reference?cl=9919#isFakeBoldText">isFakeBoldText</a> | Returns true if <a href="bmh_SkPaint_Reference?cl=9919#Fake_Bold">Fake Bold</a> is set. |
171| <a href="bmh_SkPaint_Reference?cl=9919#isLCDRenderText">isLCDRenderText</a> | Returns true if <a href="bmh_SkPaint_Reference?cl=9919#LCD_Text">LCD Text</a> is set. |
172| <a href="bmh_SkPaint_Reference?cl=9919#isSrcOver">isSrcOver</a> | Returns true if <a href="bmh_undocumented?cl=9919#Blend_Mode">Blend Mode</a> is <a href="bmh_undocumented?cl=9919#kSrcOver">SkBlendMode::kSrcOver</a>. |
173| <a href="bmh_SkPaint_Reference?cl=9919#isSubpixelText">isSubpixelText</a> | Returns true if <a href="bmh_SkPaint_Reference?cl=9919#Subpixel_Text">Subpixel Text</a> is set. |
174| <a href="bmh_SkPaint_Reference?cl=9919#isVerticalText">isVerticalText</a> | Returns true if <a href="bmh_SkPaint_Reference?cl=9919#Vertical_Text">Vertical Text</a> is set. |
175| <a href="bmh_SkPaint_Reference?cl=9919#measureText">measureText</a> | Returns advance width and bounds of text. |
176| <a href="bmh_SkPaint_Reference?cl=9919#nothingToDraw">nothingToDraw</a> | Returns true if <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> prevents all drawing. |
177| <a href="bmh_SkPaint_Reference?cl=9919#refColorFilter">refColorFilter</a> | References <a href="bmh_undocumented?cl=9919#Color_Filter">Color Filter</a>, how colors are altered. |
178| <a href="bmh_SkPaint_Reference?cl=9919#refDrawLooper">refDrawLooper</a> | References <a href="bmh_undocumented?cl=9919#Draw_Looper">Draw Looper</a>, multiple layers. |
179| <a href="bmh_SkPaint_Reference?cl=9919#refImageFilter">refImageFilter</a> | References <a href="bmh_undocumented?cl=9919#Image_Filter">Image Filter</a>, alter pixels; blur. |
180| <a href="bmh_SkPaint_Reference?cl=9919#refMaskFilter">refMaskFilter</a> | References <a href="bmh_undocumented?cl=9919#Mask_Filter">Mask Filter</a>, alterations to <a href="bmh_undocumented?cl=9919#Mask_Alpha">Mask Alpha</a>. |
181| <a href="bmh_SkPaint_Reference?cl=9919#refPathEffect">refPathEffect</a> | References <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a>, modifications to path geometry; dashing. |
182| <a href="bmh_SkPaint_Reference?cl=9919#refRasterizer">refRasterizer</a> | References <a href="bmh_undocumented?cl=9919#Rasterizer">Rasterizer</a>, mask generation from path. |
183| <a href="bmh_SkPaint_Reference?cl=9919#refShader">refShader</a> | References <a href="bmh_undocumented?cl=9919#Shader">Shader</a>, multiple drawing colors; gradients. |
184| <a href="bmh_SkPaint_Reference?cl=9919#refTypeface">refTypeface</a> | References <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a>, font description. |
185| <a href="bmh_SkPaint_Reference?cl=9919#reset">reset</a> | Sets to default values. |
186| <a href="bmh_SkPaint_Reference?cl=9919#setAlpha">setAlpha</a> | Sets <a href="bmh_undocumented?cl=9919#Alpha">Color Alpha</a>, color opacity. |
187| <a href="bmh_SkPaint_Reference?cl=9919#setAntiAlias">setAntiAlias</a> | Sets or clears <a href="bmh_SkPaint_Reference?cl=9919#Anti_alias">Anti-alias</a>. |
188| <a href="bmh_SkPaint_Reference?cl=9919#setARGB">setARGB</a> | Sets color by component. |
189| <a href="bmh_SkPaint_Reference?cl=9919#setAutohinted">setAutohinted</a> | Sets glyphs to always be hinted. |
190| <a href="bmh_SkPaint_Reference?cl=9919#setBlendMode">setBlendMode</a> | Sets <a href="bmh_undocumented?cl=9919#Blend_Mode">Blend Mode</a>, how colors combine with destination. |
191| <a href="bmh_SkPaint_Reference?cl=9919#setColor">setColor</a> | Sets <a href="bmh_undocumented?cl=9919#Alpha">Color Alpha</a> and <a href="bmh_undocumented?cl=9919#RGB">Color RGB</a>, one drawing color. |
192| <a href="bmh_SkPaint_Reference?cl=9919#setColorFilter">setColorFilter</a> | Sets <a href="bmh_undocumented?cl=9919#Color_Filter">Color Filter</a>, alters color. |
193| <a href="bmh_SkPaint_Reference?cl=9919#setDevKernText">setDevKernText</a> | Sets or clears <a href="bmh_SkPaint_Reference?cl=9919#Full_Hinting_Spacing">Full Hinting Spacing</a>. |
194| <a href="bmh_SkPaint_Reference?cl=9919#setDither">setDither</a> | Sets or clears <a href="bmh_SkPaint_Reference?cl=9919#Dither">Dither</a>. |
195| <a href="bmh_SkPaint_Reference?cl=9919#setDrawLooper">setDrawLooper</a> | Sets <a href="bmh_undocumented?cl=9919#Draw_Looper">Draw Looper</a>, multiple layers. |
196| <a href="bmh_SkPaint_Reference?cl=9919#setEmbeddedBitmapText">setEmbeddedBitmapText</a> | Sets or clears <a href="bmh_SkPaint_Reference?cl=9919#Font_Embedded_Bitmaps">Font Embedded Bitmaps</a>. |
197| <a href="bmh_SkPaint_Reference?cl=9919#setFakeBoldText">setFakeBoldText</a> | Sets or clears <a href="bmh_SkPaint_Reference?cl=9919#Fake_Bold">Fake Bold</a>. |
198| <a href="bmh_SkPaint_Reference?cl=9919#setFilterQuality">setFilterQuality</a> | Sets <a href="bmh_undocumented?cl=9919#Filter_Quality">Filter Quality</a>, the image filtering level. |
199| <a href="bmh_SkPaint_Reference?cl=9919#setFlags">setFlags</a> | Sets multiple <a href="bmh_SkPaint_Reference?cl=9919#Flags">Flags</a> in a bit field. |
200| <a href="bmh_SkPaint_Reference?cl=9919#setHinting">setHinting</a> | Sets <a href="bmh_SkPaint_Reference?cl=9919#Hinting">Hinting</a>, glyph outline adjustment level. |
201| <a href="bmh_SkPaint_Reference?cl=9919#setLCDRenderText">setLCDRenderText</a> | Sets or clears <a href="bmh_SkPaint_Reference?cl=9919#LCD_Text">LCD Text</a>. |
202| <a href="bmh_SkPaint_Reference?cl=9919#setMaskFilter">setMaskFilter</a> | Sets <a href="bmh_undocumented?cl=9919#Mask_Filter">Mask Filter</a>, alterations to <a href="bmh_undocumented?cl=9919#Mask_Alpha">Mask Alpha</a>. |
203| <a href="bmh_SkPaint_Reference?cl=9919#setPathEffect">setPathEffect</a> | Sets <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a>, modifications to path geometry; dashing. |
204| <a href="bmh_SkPaint_Reference?cl=9919#setRasterizer">setRasterizer</a> | Sets <a href="bmh_undocumented?cl=9919#Rasterizer">Rasterizer</a>, <a href="bmh_undocumented?cl=9919#Mask_Alpha">Mask Alpha</a> generation from <a href="bmh_SkPath_Reference?cl=9919#Path">Path</a>. |
205| <a href="bmh_SkPaint_Reference?cl=9919#setImageFilter">setImageFilter</a> | Sets <a href="bmh_undocumented?cl=9919#Image_Filter">Image Filter</a>, alter pixels; blur. |
206| <a href="bmh_SkPaint_Reference?cl=9919#setShader">setShader</a> | Sets <a href="bmh_undocumented?cl=9919#Shader">Shader</a>, multiple drawing colors; gradients. |
207| <a href="bmh_SkPaint_Reference?cl=9919#setStrokeCap">setStrokeCap</a> | Sets <a href="bmh_SkPaint_Reference?cl=9919#Cap">Cap</a>, the area drawn at path ends. |
208| <a href="bmh_SkPaint_Reference?cl=9919#setStrokeJoin">setStrokeJoin</a> | Sets <a href="bmh_SkPaint_Reference?cl=9919#Join">Join</a>, geometry on path corners. |
209| <a href="bmh_SkPaint_Reference?cl=9919#setStrokeMiter">setStrokeMiter</a> | Sets <a href="bmh_SkPaint_Reference?cl=9919#Miter_Limit">Miter Limit</a>, angles with sharp corners. |
210| <a href="bmh_SkPaint_Reference?cl=9919#setStrokeWidth">setStrokeWidth</a> | Sets thickness of the stroke. |
211| <a href="bmh_SkPaint_Reference?cl=9919#setStyle">setStyle</a> | Sets <a href="bmh_SkPaint_Reference?cl=9919#Style">Style</a>: stroke, fill, or both. |
212| <a href="bmh_SkPaint_Reference?cl=9919#setSubpixelText">setSubpixelText</a> | Sets or clears <a href="bmh_SkPaint_Reference?cl=9919#Subpixel_Text">Subpixel Text</a>. |
213| <a href="bmh_SkPaint_Reference?cl=9919#setTextAlign">setTextAlign</a> | Sets <a href="bmh_SkPaint_Reference?cl=9919#Align">Align</a>: left, center, or right. |
214| <a href="bmh_SkPaint_Reference?cl=9919#setTextEncoding">setTextEncoding</a> | Sets character or glyph encoding size. |
215| <a href="bmh_SkPaint_Reference?cl=9919#setTextScaleX">setTextScaleX</a> | Sets the text horizontal scale; condensed text. |
216| <a href="bmh_SkPaint_Reference?cl=9919#setTextSkewX">setTextSkewX</a> | Sets the text horizontal skew; oblique text. |
217| <a href="bmh_SkPaint_Reference?cl=9919#setTextSize">setTextSize</a> | Sets text size in points. |
218| <a href="bmh_SkPaint_Reference?cl=9919#setTypeface">setTypeface</a> | Sets <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a>, font description. |
219| <a href="bmh_SkPaint_Reference?cl=9919#setVerticalText">setVerticalText</a> | Sets or clears <a href="bmh_SkPaint_Reference?cl=9919#Vertical_Text">Vertical Text</a>. |
220| <a href="bmh_SkPaint_Reference?cl=9919#textToGlyphs">textToGlyphs</a> | Converts text into glyph indices. |
221| <a href="bmh_SkPaint_Reference?cl=9919#toString">toString</a> | Converts <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> to machine parsable form (<a href="bmh_undocumented?cl=9919#Developer_Mode">Developer Mode</a>) |
222| <a href="bmh_SkPaint_Reference?cl=9919#unflatten">unflatten</a> | Populates from a serialized stream. |
223
224# <a name="Initializers"></a> Initializers
225
226<a name="empty_constructor"></a>
227## SkPaint
228
229<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
230SkPaint()
231</pre>
232
233Constructs <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> with default values.
234
235| attribute | default value |
236| --- | --- |
237| <a href="bmh_SkPaint_Reference?cl=9919#Anti_alias">Anti-alias</a> | false |
238| <a href="bmh_undocumented?cl=9919#Blend_Mode">Blend Mode</a> | <a href="bmh_undocumented?cl=9919#kSrcOver">SkBlendMode::kSrcOver</a> |
239| <a href="bmh_undocumented?cl=9919#Color">Color</a> | <a href="bmh_undocumented?cl=9919#SK_ColorBLACK">SK ColorBLACK</a> |
240| <a href="bmh_undocumented?cl=9919#Alpha">Color Alpha</a> | 255 |
241| <a href="bmh_undocumented?cl=9919#Color_Filter">Color Filter</a> | nullptr |
242| <a href="bmh_SkPaint_Reference?cl=9919#Dither">Dither</a> | false |
243| <a href="bmh_undocumented?cl=9919#Draw_Looper">Draw Looper</a> | nullptr |
244| <a href="bmh_SkPaint_Reference?cl=9919#Fake_Bold">Fake Bold</a> | false |
245| <a href="bmh_undocumented?cl=9919#Filter_Quality">Filter Quality</a> | <a href="bmh_undocumented?cl=9919#SkFilterQuality">kNone SkFilterQuality</a> |
246| <a href="bmh_SkPaint_Reference?cl=9919#Font_Embedded_Bitmaps">Font Embedded Bitmaps</a> | false |
247| <a href="bmh_SkPaint_Reference?cl=9919#Automatic_Hinting">Automatic Hinting</a> | false |
248| <a href="bmh_SkPaint_Reference?cl=9919#Full_Hinting_Spacing">Full Hinting Spacing</a> | false |
249| <a href="bmh_SkPaint_Reference?cl=9919#Hinting">Hinting</a> | <a href="bmh_SkPaint_Reference?cl=9919#kNormal_Hinting">kNormal Hinting</a> |
250| <a href="bmh_undocumented?cl=9919#Image_Filter">Image Filter</a> | nullptr |
251| <a href="bmh_SkPaint_Reference?cl=9919#LCD_Text">LCD Text</a> | false |
252| <a href="bmh_SkPaint_Reference?cl=9919#Linear_Text">Linear Text</a> | false |
253| <a href="bmh_SkPaint_Reference?cl=9919#Miter_Limit">Miter Limit</a> | 4 |
254| <a href="bmh_undocumented?cl=9919#Mask_Filter">Mask Filter</a> | nullptr |
255| <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a> | nullptr |
256| <a href="bmh_undocumented?cl=9919#Rasterizer">Rasterizer</a> | nullptr |
257| <a href="bmh_undocumented?cl=9919#Shader">Shader</a> | nullptr |
258| <a href="bmh_SkPaint_Reference?cl=9919#Style">Style</a> | <a href="bmh_SkPaint_Reference?cl=9919#kFill_Style">kFill Style</a> |
259| <a href="bmh_SkPaint_Reference?cl=9919#Text_Align">Text Align</a> | <a href="bmh_SkPaint_Reference?cl=9919#kLeft_Align">kLeft Align</a> |
260| <a href="bmh_SkPaint_Reference?cl=9919#Text_Encoding">Text Encoding</a> | <a href="bmh_SkPaint_Reference?cl=9919#kUTF8_TextEncoding">kUTF8 TextEncoding</a> |
261| <a href="bmh_SkPaint_Reference?cl=9919#Text_Scale_X">Text Scale X</a> | 1 |
262| <a href="bmh_SkPaint_Reference?cl=9919#Text_Size">Text Size</a> | 12 |
263| <a href="bmh_SkPaint_Reference?cl=9919#Text_Skew_X">Text Skew X</a> | 0 |
264| <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a> | nullptr |
265| <a href="bmh_SkPaint_Reference?cl=9919#Stroke_Cap">Stroke Cap</a> | <a href="bmh_SkPaint_Reference?cl=9919#kButt_Cap">kButt Cap</a> |
266| <a href="bmh_SkPaint_Reference?cl=9919#Stroke_Join">Stroke Join</a> | <a href="bmh_SkPaint_Reference?cl=9919#kMiter_Join">kMiter Join</a> |
267| <a href="bmh_SkPaint_Reference?cl=9919#Stroke_Width">Stroke Width</a> | 0 |
268| <a href="bmh_SkPaint_Reference?cl=9919#Subpixel_Text">Subpixel Text</a> | false |
269| <a href="bmh_SkPaint_Reference?cl=9919#Vertical_Text">Vertical Text</a> | false |
270
271The flags, text size, hinting, and miter limit may be overridden at compile time by defining
272paint default values. The overrides may be included in <a href="bmh_undocumented?cl=9919#SkUserConfig.h">SkUserConfig.h</a> or predefined by the
273build system.
274
275### Return Value
276
277default initialized <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a>
278
279### Example
280
281<div><fiddle-embed name="c4b2186d85c142a481298f7144295ffd"></fiddle-embed></div>
282
283---
284
285<a name="copy_constructor"></a>
286## SkPaint
287
288<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
289SkPaint(const SkPaint& paint)
290</pre>
291
292Makes a shallow copy of <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a>. <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a>, <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a>, <a href="bmh_undocumented?cl=9919#Shader">Shader</a>,
293<a href="bmh_undocumented?cl=9919#Mask_Filter">Mask Filter</a>, <a href="bmh_undocumented?cl=9919#Color_Filter">Color Filter</a>, <a href="bmh_undocumented?cl=9919#Rasterizer">Rasterizer</a>, <a href="bmh_undocumented?cl=9919#Draw_Looper">Draw Looper</a>, and <a href="bmh_undocumented?cl=9919#Image_Filter">Image Filter</a> are shared
294between the original <a href="bmh_SkPaint_Reference?cl=9919#paint">paint</a> and the copy. These objects' <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a> are increased.
295
296The referenced objects <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a>, <a href="bmh_undocumented?cl=9919#Shader">Shader</a>, <a href="bmh_undocumented?cl=9919#Mask_Filter">Mask Filter</a>, <a href="bmh_undocumented?cl=9919#Color_Filter">Color Filter</a>, <a href="bmh_undocumented?cl=9919#Rasterizer">Rasterizer</a>,
297<a href="bmh_undocumented?cl=9919#Draw_Looper">Draw Looper</a>, and <a href="bmh_undocumented?cl=9919#Image_Filter">Image Filter</a> cannot be modified after they are created.
298This prevents objects with <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a> from being modified once <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> refers to them.
299
300### Parameters
301
302<table> <tr> <td><code><strong>paint </strong></code></td> <td>
303original to copy</td>
304 </tr>
305</table>
306
307### Return Value
308
309shallow copy of <a href="bmh_SkPaint_Reference?cl=9919#paint">paint</a>
310
311### Example
312
313<div><fiddle-embed name="b99971ad0ef243d617925289d963b62d">
314
315#### Example Output
316
317~~~~
318SK_ColorRED == paint1.getColor()
319SK_ColorBLUE == paint2.getColor()
320~~~~
321
322</fiddle-embed></div>
323
324---
325
326<a name="move_constructor"></a>
327## SkPaint
328
329<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
330SkPaint(SkPaint&& paint)
331</pre>
332
333Implements a move constructor to avoid incrementing the reference counts
334of objects referenced by the <a href="bmh_SkPaint_Reference?cl=9919#paint">paint</a>.
335
336After the call, <a href="bmh_SkPaint_Reference?cl=9919#paint">paint</a> is undefined, and can be safely destructed.
337
338### Parameters
339
340<table> <tr> <td><code><strong>paint </strong></code></td> <td>
341original to move</td>
342 </tr>
343</table>
344
345### Return Value
346
347content of <a href="bmh_SkPaint_Reference?cl=9919#paint">paint</a>
348
349### Example
350
351<div><fiddle-embed name="8ed1488a503cd5282b86a51614aa90b1">
352
353#### Example Output
354
355~~~~
356path effect unique: true
357~~~~
358
359</fiddle-embed></div>
360
361---
362
363<a name="reset"></a>
364## reset
365
366<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
367void reset()
368</pre>
369
370Sets all paint's contents to their initial values. This is equivalent to replacing
371the paint with the result of <a href="bmh_SkPaint_Reference?cl=9919#empty_constructor">SkPaint()</a>.
372
373### Example
374
375<div><fiddle-embed name="ef269937ade7e7353635121d9a64f9f7">
376
377#### Example Output
378
379~~~~
380paint1 == paint2
381~~~~
382
383</fiddle-embed></div>
384
385---
386
387# <a name="Destructor"></a> Destructor
388
389<a name="destructor"></a>
390## ~SkPaint
391
392<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
393~SkPaint()
394</pre>
395
396Decreases <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a> of owned objects: <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a>, <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a>, <a href="bmh_undocumented?cl=9919#Shader">Shader</a>,
397<a href="bmh_undocumented?cl=9919#Mask_Filter">Mask Filter</a>, <a href="bmh_undocumented?cl=9919#Color_Filter">Color Filter</a>, <a href="bmh_undocumented?cl=9919#Rasterizer">Rasterizer</a>, <a href="bmh_undocumented?cl=9919#Draw_Looper">Draw Looper</a>, and <a href="bmh_undocumented?cl=9919#Image_Filter">Image Filter</a>. If the
398objects' reference count goes to zero, they are deleted.
399
400---
401
402# <a name="Management"></a> Management
403
404<a name="copy_assignment_operator"></a>
405## operator=
406
407<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
408SkPaint& operator=(const SkPaint& paint)
409</pre>
410
411Makes a shallow copy of <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a>. <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a>, <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a>, <a href="bmh_undocumented?cl=9919#Shader">Shader</a>,
412<a href="bmh_undocumented?cl=9919#Mask_Filter">Mask Filter</a>, <a href="bmh_undocumented?cl=9919#Color_Filter">Color Filter</a>, <a href="bmh_undocumented?cl=9919#Rasterizer">Rasterizer</a>, <a href="bmh_undocumented?cl=9919#Draw_Looper">Draw Looper</a>, and <a href="bmh_undocumented?cl=9919#Image_Filter">Image Filter</a> are shared
413between the original <a href="bmh_SkPaint_Reference?cl=9919#paint">paint</a> and the copy. The objects' <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a> are in the
414prior destination are decreased by one, and the referenced objects are deleted if the
415resulting count is zero. The objects' <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a> in the parameter <a href="bmh_SkPaint_Reference?cl=9919#paint">paint</a> are increased
416by one. <a href="bmh_SkPaint_Reference?cl=9919#paint">paint</a> is unmodified.
417
418### Parameters
419
420<table> <tr> <td><code><strong>paint </strong></code></td> <td>
421original to copy</td>
422 </tr>
423</table>
424
425### Return Value
426
427content of <a href="bmh_SkPaint_Reference?cl=9919#paint">paint</a>
428
429### Example
430
431<div><fiddle-embed name="b476a9088f80dece176ed577807d3992">
432
433#### Example Output
434
435~~~~
436SK_ColorRED == paint1.getColor()
437SK_ColorRED == paint2.getColor()
438~~~~
439
440</fiddle-embed></div>
441
442---
443
444<a name="move_assignment_operator"></a>
445## operator=
446
447<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
448SkPaint& operator=(SkPaint&& paint)
449</pre>
450
451Moves the <a href="bmh_SkPaint_Reference?cl=9919#paint">paint</a> to avoid incrementing the reference counts
452of objects referenced by the <a href="bmh_SkPaint_Reference?cl=9919#paint">paint</a> parameter. The objects' <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a> are in the
453prior destination are decreased by one, and the referenced objects are deleted if the
454resulting count is zero.
455
456After the call, <a href="bmh_SkPaint_Reference?cl=9919#paint">paint</a> is undefined, and can be safely destructed.
457
458### Parameters
459
460<table> <tr> <td><code><strong>paint </strong></code></td> <td>
461original to move</td>
462 </tr>
463</table>
464
465### Return Value
466
467content of <a href="bmh_SkPaint_Reference?cl=9919#paint">paint</a>
468
469### Example
470
471<div><fiddle-embed name="9fb7459b097d713f5f1fe5675afe14f5">
472
473#### Example Output
474
475~~~~
476SK_ColorRED == paint2.getColor()
477~~~~
478
479</fiddle-embed></div>
480
481---
482
483<a name="equal_operator"></a>
484## operator==
485
486<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
487bool operator==(const SkPaint& a, const SkPaint& b)
488</pre>
489
490Compares <a href="bmh_SkPaint_Reference?cl=9919#a">a</a> and <a href="bmh_SkPaint_Reference?cl=9919#b">b</a>, and returns true if <a href="bmh_SkPaint_Reference?cl=9919#a">a</a> and <a href="bmh_SkPaint_Reference?cl=9919#b">b</a> are equivalent. May return false
491if <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a>, <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a>, <a href="bmh_undocumented?cl=9919#Shader">Shader</a>, <a href="bmh_undocumented?cl=9919#Mask_Filter">Mask Filter</a>, <a href="bmh_undocumented?cl=9919#Color_Filter">Color Filter</a>, <a href="bmh_undocumented?cl=9919#Rasterizer">Rasterizer</a>,
492<a href="bmh_undocumented?cl=9919#Draw_Looper">Draw Looper</a>, or <a href="bmh_undocumented?cl=9919#Image_Filter">Image Filter</a> have identical contents but different pointers.
493
494### Parameters
495
496<table> <tr> <td><code><strong>a </strong></code></td> <td>
497<a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> to compare</td>
498 </tr> <tr> <td><code><strong>b </strong></code></td> <td>
499<a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> to compare</td>
500 </tr>
501</table>
502
503### Return Value
504
505true if <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> pair are equivalent
506
507### Example
508
509<div><fiddle-embed name="7481a948e34672720337a631830586dd">
510
511#### Example Output
512
513~~~~
514paint1 == paint2
515paint1 != paint2
516~~~~
517
518</fiddle-embed></div>
519
520---
521
522<a name="not_equal_operator"></a>
523## operator!=
524
525<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
526bool operator!=(const SkPaint& a, const SkPaint& b)
527</pre>
528
529Compares <a href="bmh_SkPaint_Reference?cl=9919#a">a</a> and <a href="bmh_SkPaint_Reference?cl=9919#b">b</a>, and returns true if <a href="bmh_SkPaint_Reference?cl=9919#a">a</a> and <a href="bmh_SkPaint_Reference?cl=9919#b">b</a> are not equivalent. May return true
530if <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a>, <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a>, <a href="bmh_undocumented?cl=9919#Shader">Shader</a>, <a href="bmh_undocumented?cl=9919#Mask_Filter">Mask Filter</a>, <a href="bmh_undocumented?cl=9919#Color_Filter">Color Filter</a>, <a href="bmh_undocumented?cl=9919#Rasterizer">Rasterizer</a>,
531<a href="bmh_undocumented?cl=9919#Draw_Looper">Draw Looper</a>, or <a href="bmh_undocumented?cl=9919#Image_Filter">Image Filter</a> have identical contents but different pointers.
532
533### Parameters
534
535<table> <tr> <td><code><strong>a </strong></code></td> <td>
536<a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> to compare</td>
537 </tr> <tr> <td><code><strong>b </strong></code></td> <td>
538<a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> to compare</td>
539 </tr>
540</table>
541
542### Return Value
543
544true if <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> pair are not equivalent
545
546### Example
547
548<div><fiddle-embed name="b6c8484b1187f555b435ad5369833be4">
549
550#### Example Output
551
552~~~~
553paint1 == paint2
554paint1 == paint2
555~~~~
556
557</fiddle-embed></div>
558
559---
560
561<a name="getHash"></a>
562## getHash
563
564<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
565uint32_t getHash() const
566</pre>
567
568Returns a hash generated from <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> values and pointers.
569Identical hashes guarantee that the paints are
570equivalent, but differing hashes do not guarantee that the paints have differing
571contents.
572
573If <a href="bmh_SkPaint_Reference?cl=9919#equal_operator">operator==(const SkPaint& a, const SkPaint& b)</a> returns true for two paints,
574their hashes are also equal.
575
576The hash returned is platform and implementation specific.
577
578### Return Value
579
580a shallow hash
581
582### Example
583
584<div><fiddle-embed name="7f7e1b701361912b344f90ae6b530393">
585
586#### Example Output
587
588~~~~
589paint1 == paint2
590paint1.getHash() == paint2.getHash()
591~~~~
592
593</fiddle-embed></div>
594
595---
596
597<a name="flatten"></a>
598## flatten
599
600<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
601void flatten(SkWriteBuffer& buffer) const
602</pre>
603
604Serializes <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> into a <a href="bmh_SkPaint_Reference?cl=9919#buffer">buffer</a>. A companion <a href="bmh_SkPaint_Reference?cl=9919#unflatten">unflatten</a> call
605can reconstitute the paint at a later time.
606
607### Parameters
608
609<table> <tr> <td><code><strong>buffer </strong></code></td> <td>
610<a href="bmh_undocumented?cl=9919#Write_Buffer">Write Buffer</a> receiving the flattened <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> data</td>
611 </tr>
612</table>
613
614### Example
615
616<div><fiddle-embed name="670672b146b50eced4d3dd10c701e0a7">
617
618#### Example Output
619
620~~~~
621color = 0xffff0000
622~~~~
623
624</fiddle-embed></div>
625
626---
627
628<a name="unflatten"></a>
629## unflatten
630
631<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
632void unflatten(SkReadBuffer& buffer)
633</pre>
634
635Populates <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a>, typically from a serialized stream, created by calling
636<a href="bmh_SkPaint_Reference?cl=9919#flatten">flatten</a> at an earlier time.
637
638<a href="bmh_undocumented?cl=9919#SkReadBuffer">SkReadBuffer</a> class is not public, so <a href="bmh_SkPaint_Reference?cl=9919#unflatten">unflatten</a> cannot be meaningfully called
639by the client.
640
641### Parameters
642
643<table> <tr> <td><code><strong>buffer </strong></code></td> <td>
644serialized data to unflatten</td>
645 </tr>
646</table>
647
648---
649
650# <a name="Hinting"></a> Hinting
651
652## <a name="SkPaint::Hinting"></a> Enum SkPaint::Hinting
653
654<pre style="padding: 1em 1em 1em 1em;width: 44em; background-color: #f0f0f0">
655enum <a href="bmh_SkPaint_Reference?cl=9919#Hinting">Hinting</a> {
656<a href="bmh_SkPaint_Reference?cl=9919#kNo_Hinting">kNo Hinting</a> = 0,
657<a href="bmh_SkPaint_Reference?cl=9919#kSlight_Hinting">kSlight Hinting</a> = 1,
658<a href="bmh_SkPaint_Reference?cl=9919#kNormal_Hinting">kNormal Hinting</a> = 2,
659<a href="bmh_SkPaint_Reference?cl=9919#kFull_Hinting">kFull Hinting</a> = 3
660};</pre>
661
662<a href="bmh_SkPaint_Reference?cl=9919#Hinting">Hinting</a> adjusts the glyph outlines so that the shape provides a uniform
663look at a given point size on font engines that support it. <a href="bmh_SkPaint_Reference?cl=9919#Hinting">Hinting</a> may have a
664muted effect or no effect at all depending on the platform.
665
666The four levels roughly control corresponding features on platforms that use <a href="bmh_undocumented?cl=9919#FreeType">FreeType</a>
667as the <a href="bmh_undocumented?cl=9919#Engine">Font Engine</a>.
668
669### Constants
670
671<table>
672 <tr>
673 <td><a name="SkPaint::kNo_Hinting"></a> <code><strong>SkPaint::kNo_Hinting </strong></code></td><td>0</td><td>Leaves glyph outlines unchanged from their native representation.
674With <a href="bmh_undocumented?cl=9919#FreeType">FreeType</a>, this is equivalent to the <a href="bmh_undocumented?cl=9919#FT_LOAD_NO_HINTING">FT LOAD NO HINTING</a>
675bit-field constant supplied to <a href="bmh_undocumented?cl=9919#FT_Load_Glyph">FT Load Glyph</a>, which indicates that the vector
676outline being loaded should not be fitted to the pixel grid but simply scaled
677to 26.6 fractional pixels.</td>
678 </tr>
679 <tr>
680 <td><a name="SkPaint::kSlight_Hinting"></a> <code><strong>SkPaint::kSlight_Hinting </strong></code></td><td>1</td><td>Modifies glyph outlines minimally to improve constrast.
681With <a href="bmh_undocumented?cl=9919#FreeType">FreeType</a>, this is equivalent in spirit to the
682<a href="bmh_undocumented?cl=9919#FT_LOAD_TARGET_LIGHT">FT LOAD TARGET LIGHT</a> value supplied to <a href="bmh_undocumented?cl=9919#FT_Load_Glyph">FT Load Glyph</a>. It chooses a
683lighter hinting algorithm for non-monochrome modes.
684Generated glyphs may be fuzzy but better resemble their original shape.</td>
685 </tr>
686 <tr>
687 <td><a name="SkPaint::kNormal_Hinting"></a> <code><strong>SkPaint::kNormal_Hinting </strong></code></td><td>2</td><td>Modifies glyph outlines to improve constrast. This is the default.
688With <a href="bmh_undocumented?cl=9919#FreeType">FreeType</a>, this supplies <a href="bmh_undocumented?cl=9919#FT_LOAD_TARGET_NORMAL">FT LOAD TARGET NORMAL</a> to <a href="bmh_undocumented?cl=9919#FT_Load_Glyph">FT Load Glyph</a>,
689choosing the default hinting algorithm, which is optimized for standard
690gray-level rendering.</td>
691 </tr>
692 <tr>
693 <td><a name="SkPaint::kFull_Hinting"></a> <code><strong>SkPaint::kFull_Hinting </strong></code></td><td>3</td><td>Modifies glyph outlines for maxiumum constrast. With <a href="bmh_undocumented?cl=9919#FreeType">FreeType</a>, this selects
694<a href="bmh_undocumented?cl=9919#FT_LOAD_TARGET_LCD">FT LOAD TARGET LCD</a> or <a href="bmh_undocumented?cl=9919#FT_LOAD_TARGET_LCD_V">FT LOAD TARGET LCD V</a> if <a href="bmh_SkPaint_Reference?cl=9919#kLCDRenderText_Flag">kLCDRenderText Flag</a> is set.
695<a href="bmh_undocumented?cl=9919#FT_LOAD_TARGET_LCD">FT LOAD TARGET LCD</a> is a variant of <a href="bmh_undocumented?cl=9919#FT_LOAD_TARGET_NORMAL">FT LOAD TARGET NORMAL</a> optimized for
696horizontally decimated <a href="bmh_undocumented?cl=9919#LCD">LCD</a> displays; <a href="bmh_undocumented?cl=9919#FT_LOAD_TARGET_LCD_V">FT LOAD TARGET LCD V</a> is a
697variant of <a href="bmh_undocumented?cl=9919#FT_LOAD_TARGET_NORMAL">FT LOAD TARGET NORMAL</a> optimized for vertically decimated <a href="bmh_undocumented?cl=9919#LCD">LCD</a> displays.</td>
698 </tr>
699</table>
700
701On <a href="bmh_undocumented?cl=9919#Windows">Windows</a> with <a href="bmh_undocumented?cl=9919#DirectWrite">DirectWrite</a>, <a href="bmh_SkPaint_Reference?cl=9919#Hinting">Hinting</a> has no effect.
702
703<a href="bmh_SkPaint_Reference?cl=9919#Hinting">Hinting</a> defaults to <a href="bmh_SkPaint_Reference?cl=9919#kNormal_Hinting">kNormal Hinting</a>.
704Set <a href="bmh_undocumented?cl=9919#SkPaintDefaults_Hinting">SkPaintDefaults Hinting</a> at compile time to change the default setting.
705
706
707
708<a name="getHinting"></a>
709## getHinting
710
711<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
712Hinting getHinting() const
713</pre>
714
715Returns level of glyph outline adjustment.
716
717### Return Value
718
719one of: <a href="bmh_SkPaint_Reference?cl=9919#kNo_Hinting">kNo Hinting</a>, <a href="bmh_SkPaint_Reference?cl=9919#kSlight_Hinting">kSlight Hinting</a>, <a href="bmh_SkPaint_Reference?cl=9919#kNormal_Hinting">kNormal Hinting</a>, <a href="bmh_SkPaint_Reference?cl=9919#kFull_Hinting">kFull Hinting</a>
720
721### Example
722
723<div><fiddle-embed name="329e2e5a5919ac431e1c58878a5b99e0">
724
725#### Example Output
726
727~~~~
728SkPaint::kNormal_Hinting == paint.getHinting()
729~~~~
730
731</fiddle-embed></div>
732
733---
734
735<a name="setHinting"></a>
736## setHinting
737
738<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
739void setHinting(Hinting hintingLevel)
740</pre>
741
742Sets level of glyph outline adjustment.
743Does not check for valid values of <a href="bmh_SkPaint_Reference?cl=9919#hintingLevel">hintingLevel</a>.
744
745| <a href="bmh_SkPaint_Reference?cl=9919#Hinting">Hinting</a> | value | effect on generated glyph outlines |
746| --- | --- | --- |
747| <a href="bmh_SkPaint_Reference?cl=9919#kNo_Hinting">kNo Hinting</a> | 0 | leaves glyph outlines unchanged from their native representation |
748| <a href="bmh_SkPaint_Reference?cl=9919#kSlight_Hinting">kSlight Hinting</a> | 1 | modifies glyph outlines minimally to improve constrast |
749| <a href="bmh_SkPaint_Reference?cl=9919#kNormal_Hinting">kNormal Hinting</a> | 2 | modifies glyph outlines to improve constrast |
750| <a href="bmh_SkPaint_Reference?cl=9919#kFull_Hinting">kFull Hinting</a> | 3 | modifies glyph outlines for maxiumum constrast |
751
752### Parameters
753
754<table> <tr> <td><code><strong>hintingLevel </strong></code></td> <td>
755one of: <a href="bmh_SkPaint_Reference?cl=9919#kNo_Hinting">kNo Hinting</a>, <a href="bmh_SkPaint_Reference?cl=9919#kSlight_Hinting">kSlight Hinting</a>, <a href="bmh_SkPaint_Reference?cl=9919#kNormal_Hinting">kNormal Hinting</a>, <a href="bmh_SkPaint_Reference?cl=9919#kFull_Hinting">kFull Hinting</a></td>
756 </tr>
757</table>
758
759### Example
760
761<div><fiddle-embed name="78153fbd3f1000cb33b97bbe831ed34e">
762
763#### Example Output
764
765~~~~
766paint1 == paint2
767~~~~
768
769</fiddle-embed></div>
770
771---
772
773# <a name="Flags"></a> Flags
774
775## <a name="SkPaint::Flags"></a> Enum SkPaint::Flags
776
777<pre style="padding: 1em 1em 1em 1em;width: 44em; background-color: #f0f0f0">
778enum <a href="bmh_SkPaint_Reference?cl=9919#Flags">Flags</a> {
779<a href="bmh_SkPaint_Reference?cl=9919#kAntiAlias_Flag">kAntiAlias Flag</a> = 0x01,
780<a href="bmh_SkPaint_Reference?cl=9919#kDither_Flag">kDither Flag</a> = 0x04,
781<a href="bmh_SkPaint_Reference?cl=9919#kFakeBoldText_Flag">kFakeBoldText Flag</a> = 0x20,
782<a href="bmh_SkPaint_Reference?cl=9919#kLinearText_Flag">kLinearText Flag</a> = 0x40,
783<a href="bmh_SkPaint_Reference?cl=9919#kSubpixelText_Flag">kSubpixelText Flag</a> = 0x80,
784<a href="bmh_SkPaint_Reference?cl=9919#kDevKernText_Flag">kDevKernText Flag</a> = 0x100,
785<a href="bmh_SkPaint_Reference?cl=9919#kLCDRenderText_Flag">kLCDRenderText Flag</a> = 0x200,
786<a href="bmh_SkPaint_Reference?cl=9919#kEmbeddedBitmapText_Flag">kEmbeddedBitmapText Flag</a> = 0x400,
787<a href="bmh_SkPaint_Reference?cl=9919#kAutoHinting_Flag">kAutoHinting Flag</a> = 0x800,
788<a href="bmh_SkPaint_Reference?cl=9919#kVerticalText_Flag">kVerticalText Flag</a> = 0x1000,
789<a href="bmh_SkPaint_Reference?cl=9919#kGenA8FromLCD_Flag">kGenA8FromLCD Flag</a> = 0x2000,
790
791<a href="bmh_SkPaint_Reference?cl=9919#kAllFlags">kAllFlags</a> = 0xFFFF,
792};
793</pre>
794
795The bit values stored in <a href="bmh_SkPaint_Reference?cl=9919#Flags">Flags</a>.
796The default value for <a href="bmh_SkPaint_Reference?cl=9919#Flags">Flags</a>, normally zero, can be changed at compile time
797with a custom definition of <a href="bmh_undocumented?cl=9919#SkPaintDefaults_Flags">SkPaintDefaults Flags</a>.
798All flags can be read and written explicitly; <a href="bmh_SkPaint_Reference?cl=9919#Flags">Flags</a> allows manipulating
799multiple settings at once.
800
801### Constants
802
803<table>
804 <tr>
805 <td><a name="SkPaint::kAntiAlias_Flag"></a> <code><strong>SkPaint::kAntiAlias_Flag </strong></code></td><td>0x0001 </td><td>mask for setting <a href="bmh_SkPaint_Reference?cl=9919#Anti_alias">Anti-alias</a></td>
806 </tr>
807 <tr>
808 <td><a name="SkPaint::kDither_Flag"></a> <code><strong>SkPaint::kDither_Flag </strong></code></td><td>0x0004</td><td>mask for setting <a href="bmh_SkPaint_Reference?cl=9919#Dither">Dither</a></td>
809 </tr>
810 <tr>
811 <td><a name="SkPaint::kFakeBoldText_Flag"></a> <code><strong>SkPaint::kFakeBoldText_Flag </strong></code></td><td>0x0020</td><td>mask for setting <a href="bmh_SkPaint_Reference?cl=9919#Fake_Bold">Fake Bold</a></td>
812 </tr>
813 <tr>
814 <td><a name="SkPaint::kLinearText_Flag"></a> <code><strong>SkPaint::kLinearText_Flag </strong></code></td><td>0x0040</td><td>mask for setting <a href="bmh_SkPaint_Reference?cl=9919#Linear_Text">Linear Text</a></td>
815 </tr>
816 <tr>
817 <td><a name="SkPaint::kSubpixelText_Flag"></a> <code><strong>SkPaint::kSubpixelText_Flag </strong></code></td><td>0x0080</td><td>mask for setting <a href="bmh_SkPaint_Reference?cl=9919#Subpixel_Text">Subpixel Text</a></td>
818 </tr>
819 <tr>
820 <td><a name="SkPaint::kDevKernText_Flag"></a> <code><strong>SkPaint::kDevKernText_Flag </strong></code></td><td>0x0100</td><td>mask for setting <a href="bmh_SkPaint_Reference?cl=9919#Full_Hinting_Spacing">Full Hinting Spacing</a></td>
821 </tr>
822 <tr>
823 <td><a name="SkPaint::kLCDRenderText_Flag"></a> <code><strong>SkPaint::kLCDRenderText_Flag </strong></code></td><td>0x0200</td><td>mask for setting <a href="bmh_SkPaint_Reference?cl=9919#LCD_Text">LCD Text</a></td>
824 </tr>
825 <tr>
826 <td><a name="SkPaint::kEmbeddedBitmapText_Flag"></a> <code><strong>SkPaint::kEmbeddedBitmapText_Flag </strong></code></td><td>0x0400</td><td>mask for setting <a href="bmh_SkPaint_Reference?cl=9919#Font_Embedded_Bitmaps">Font Embedded Bitmaps</a></td>
827 </tr>
828 <tr>
829 <td><a name="SkPaint::kAutoHinting_Flag"></a> <code><strong>SkPaint::kAutoHinting_Flag </strong></code></td><td>0x0800</td><td>mask for setting <a href="bmh_SkPaint_Reference?cl=9919#Automatic_Hinting">Automatic Hinting</a></td>
830 </tr>
831 <tr>
832 <td><a name="SkPaint::kVerticalText_Flag"></a> <code><strong>SkPaint::kVerticalText_Flag </strong></code></td><td>0x1000</td><td>mask for setting <a href="bmh_SkPaint_Reference?cl=9919#Vertical_Text">Vertical Text</a></td>
833 </tr>
834 <tr>
835 <td><a name="SkPaint::kGenA8FromLCD_Flag"></a> <code><strong>SkPaint::kGenA8FromLCD_Flag </strong></code></td><td>0x2000</td><td>not intended for public use</td>
836 </tr>
837 <tr>
838 <td><a name="SkPaint::kAllFlags"></a> <code><strong>SkPaint::kAllFlags </strong></code></td><td>0xFFFF</td><td>mask of all <a href="bmh_SkPaint_Reference?cl=9919#Flags">Flags</a>, including private flags and flags reserved for future use</td>
839 </tr>
840<a href="bmh_SkPaint_Reference?cl=9919#Flags">Flags</a> default to all flags clear, disabling the associated feature.
841
842</table>
843
844## <a name="SkPaint::ReserveFlags"></a> Enum SkPaint::ReserveFlags
845
846<pre style="padding: 1em 1em 1em 1em;width: 44em; background-color: #f0f0f0">
847enum <a href="bmh_SkPaint_Reference?cl=9919#ReserveFlags">ReserveFlags</a> {
848<a href="bmh_SkPaint_Reference?cl=9919#kUnderlineText_ReserveFlag">kUnderlineText ReserveFlag</a> = 0x08,
849<a href="bmh_SkPaint_Reference?cl=9919#kStrikeThruText_ReserveFlag">kStrikeThruText ReserveFlag</a> = 0x10,
850};</pre>
851
852### Constants
853
854<table>
855 <tr>
856 <td><a name="SkPaint::kUnderlineText_ReserveFlag"></a> <code><strong>SkPaint::kUnderlineText_ReserveFlag </strong></code></td><td>0x0008</td><td>mask for underline text</td>
857 </tr>
858 <tr>
859 <td><a name="SkPaint::kStrikeThruText_ReserveFlag"></a> <code><strong>SkPaint::kStrikeThruText_ReserveFlag </strong></code></td><td>0x0010</td><td>mask for strike-thru text</td>
860 </tr>
861</table>
862
863
864
865<a name="getFlags"></a>
866## getFlags
867
868<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
869uint32_t getFlags() const
870</pre>
871
872Returns paint settings described by <a href="bmh_SkPaint_Reference?cl=9919#Flags">Flags</a>. Each setting uses one
873bit, and can be tested with <a href="bmh_SkPaint_Reference?cl=9919#Flags">Flags</a> members.
874
875### Return Value
876
877zero, one, or more bits described by <a href="bmh_SkPaint_Reference?cl=9919#Flags">Flags</a>
878
879### Example
880
881<div><fiddle-embed name="8a3f8c309533388b01aa66e1267f322d">
882
883#### Example Output
884
885~~~~
886(SkPaint::kAntiAlias_Flag & paint.getFlags()) != 0
887~~~~
888
889</fiddle-embed></div>
890
891---
892
893<a name="setFlags"></a>
894## setFlags
895
896<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
897void setFlags(uint32_t flags)
898</pre>
899
900Replaces <a href="bmh_SkPaint_Reference?cl=9919#Flags">Flags</a> with <a href="bmh_SkPaint_Reference?cl=9919#flags">flags</a>, the union of the <a href="bmh_SkPaint_Reference?cl=9919#Flags">Flags</a> members.
901All <a href="bmh_SkPaint_Reference?cl=9919#Flags">Flags</a> members may be cleared, or one or more may be set.
902
903### Parameters
904
905<table> <tr> <td><code><strong>flags </strong></code></td> <td>
906union of <a href="bmh_SkPaint_Reference?cl=9919#Flags">Flags</a> for <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a></td>
907 </tr>
908</table>
909
910### Example
911
912<div><fiddle-embed name="54baed3f6bc4b9c31ba664e27767fdc7">
913
914#### Example Output
915
916~~~~
917paint.isAntiAlias()
918paint.isDither()
919~~~~
920
921</fiddle-embed></div>
922
923---
924
925# <a name="Anti-alias"></a> Anti-alias
926<a href="bmh_SkPaint_Reference?cl=9919#Anti_alias">Anti-alias</a> drawing approximates partial pixel coverage with transparency.
927If <a href="bmh_SkPaint_Reference?cl=9919#kAntiAlias_Flag">kAntiAlias Flag</a> is clear, pixel centers contained by the shape edge are drawn opaque.
928If <a href="bmh_SkPaint_Reference?cl=9919#kAntiAlias_Flag">kAntiAlias Flag</a> is set, pixels are drawn with <a href="bmh_undocumented?cl=9919#Alpha">Color Alpha</a> equal to their coverage.
929
930The rule for aliased pixels is inconsistent across platforms. A shape edge
931passing through the pixel center may, but is not required to, draw the pixel.
932
933<a href="bmh_undocumented?cl=9919#Raster_Engine">Raster Engine</a> draws aliased pixels whose centers are on or to the right of the start of an
934active <a href="bmh_SkPath_Reference?cl=9919#Path">Path</a> edge, and whose center is to the left of the end of the active <a href="bmh_SkPath_Reference?cl=9919#Path">Path</a> edge.
935
936A platform may only support anti-aliased drawing. Some <a href="bmh_undocumented?cl=9919#GPU_backed">GPU-backed</a> platforms use
937supersampling to anti-alias all drawing, and have no mechanism to selectively
938alias.
939
940The amount of coverage computed for anti-aliased pixels also varies across platforms.
941
942<a href="bmh_SkPaint_Reference?cl=9919#Anti_alias">Anti-alias</a> is disabled by default.
943<a href="bmh_SkPaint_Reference?cl=9919#Anti_alias">Anti-alias</a> can be enabled by default by setting <a href="bmh_undocumented?cl=9919#SkPaintDefaults_Flags">SkPaintDefaults Flags</a> to <a href="bmh_SkPaint_Reference?cl=9919#kAntiAlias_Flag">kAntiAlias Flag</a>
944at compile time.
945
946### Example
947
948<div><fiddle-embed name="a6575a49467ce8d28bb01cc7638fa04d"><div>A red line is drawn with transparency on the edges to make it look smoother.
949A blue line draws only where the pixel centers are contained.
950The lines are drawn into an offscreen bitmap, then drawn magified to make the
951aliasing easier to see.</div></fiddle-embed></div>
952
953<a name="isAntiAlias"></a>
954## isAntiAlias
955
956<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
957bool isAntiAlias() const
958</pre>
959
960If true, pixels on the active edges of <a href="bmh_SkPath_Reference?cl=9919#Path">Path</a> may be drawn with partial transparency.
961
962Equivalent to <a href="bmh_SkPaint_Reference?cl=9919#getFlags">getFlags</a> masked with <a href="bmh_SkPaint_Reference?cl=9919#kAntiAlias_Flag">kAntiAlias Flag</a>.
963
964### Return Value
965
966<a href="bmh_SkPaint_Reference?cl=9919#kAntiAlias_Flag">kAntiAlias Flag</a> state
967
968### Example
969
970<div><fiddle-embed name="d7d5f4f7da7acd5104a652f490c6f7b8">
971
972#### Example Output
973
974~~~~
975paint.isAntiAlias() == !!(paint.getFlags() & SkPaint::kAntiAlias_Flag)
976paint.isAntiAlias() == !!(paint.getFlags() & SkPaint::kAntiAlias_Flag)
977~~~~
978
979</fiddle-embed></div>
980
981---
982
983<a name="setAntiAlias"></a>
984## setAntiAlias
985
986<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
987void setAntiAlias(bool aa)
988</pre>
989
990Requests, but does not require, that <a href="bmh_SkPath_Reference?cl=9919#Path">Path</a> edge pixels draw opaque or with
991partial transparency.
992
993Sets <a href="bmh_SkPaint_Reference?cl=9919#kAntiAlias_Flag">kAntiAlias Flag</a> if <a href="bmh_SkPaint_Reference?cl=9919#aa">aa</a> is true.
994Clears <a href="bmh_SkPaint_Reference?cl=9919#kAntiAlias_Flag">kAntiAlias Flag</a> if <a href="bmh_SkPaint_Reference?cl=9919#aa">aa</a> is false.
995
996### Parameters
997
998<table> <tr> <td><code><strong>aa </strong></code></td> <td>
999setting for <a href="bmh_SkPaint_Reference?cl=9919#kAntiAlias_Flag">kAntiAlias Flag</a></td>
1000 </tr>
1001</table>
1002
1003### Example
1004
1005<div><fiddle-embed name="c2ff148374d01cbef845b223e725905c">
1006
1007#### Example Output
1008
1009~~~~
1010paint1 == paint2
1011~~~~
1012
1013</fiddle-embed></div>
1014
1015---
1016
1017# <a name="Dither"></a> Dither
1018<a href="bmh_SkPaint_Reference?cl=9919#Dither">Dither</a> increases fidelity by adjusting the color of adjcent pixels.
1019This can help to smooth color transitions and reducing banding in gradients.
1020Dithering lessens visible banding from <a href="bmh_undocumented?cl=9919#SkColorType">kRGB 565 SkColorType</a>
1021and <a href="bmh_undocumented?cl=9919#SkColorType">kRGBA 8888 SkColorType</a> gradients,
1022and improves rendering into a <a href="bmh_undocumented?cl=9919#SkColorType">kRGB 565 SkColorType</a> <a href="bmh_undocumented?cl=9919#Surface">Surface</a>.
1023
1024Dithering is always enabled for linear gradients drawing into
1025<a href="bmh_undocumented?cl=9919#SkColorType">kRGB 565 SkColorType</a> <a href="bmh_undocumented?cl=9919#Surface">Surface</a> and <a href="bmh_undocumented?cl=9919#SkColorType">kRGBA 8888 SkColorType</a> <a href="bmh_undocumented?cl=9919#Surface">Surface</a>.
1026<a href="bmh_SkPaint_Reference?cl=9919#Dither">Dither</a> cannot be enabled for <a href="bmh_undocumented?cl=9919#SkColorType">kAlpha 8 SkColorType</a> <a href="bmh_undocumented?cl=9919#Surface">Surface</a> and
1027<a href="bmh_undocumented?cl=9919#SkColorType">kRGBA F16 SkColorType</a> <a href="bmh_undocumented?cl=9919#Surface">Surface</a>.
1028
1029<a href="bmh_SkPaint_Reference?cl=9919#Dither">Dither</a> is disabled by default.
1030<a href="bmh_SkPaint_Reference?cl=9919#Dither">Dither</a> can be enabled by default by setting <a href="bmh_undocumented?cl=9919#SkPaintDefaults_Flags">SkPaintDefaults Flags</a> to <a href="bmh_SkPaint_Reference?cl=9919#kDither_Flag">kDither Flag</a>
1031at compile time.
1032
1033Some platform implementations may ignore dithering. Setto ignore <a href="bmh_SkPaint_Reference?cl=9919#Dither">Dither</a> on <a href="bmh_undocumented?cl=9919#GPU">GPU Surface</a>.
1034
1035### Example
1036
1037<div><fiddle-embed name="8b26507690b71462f44642b911890bbf"><div>Dithering in the bottom half more closely approximates the requested color by
1038alternating nearby colors from pixel to pixel.</div></fiddle-embed></div>
1039
1040### Example
1041
1042<div><fiddle-embed name="76d4d4a7931a48495e4d5f54e073be53"><div>Dithering introduces subtle adjustments to color to smooth gradients.
1043Drawing the gradient repeatedly with <a href="bmh_undocumented?cl=9919#kPlus">SkBlendMode::kPlus</a> exaggerates the
1044dither, making it easier to see.</div></fiddle-embed></div>
1045
1046<a name="isDither"></a>
1047## isDither
1048
1049<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
1050bool isDither() const
1051</pre>
1052
1053If true, color error may be distributed to smooth color transition.
1054Equivalent to <a href="bmh_SkPaint_Reference?cl=9919#getFlags">getFlags</a> masked with <a href="bmh_SkPaint_Reference?cl=9919#kDither_Flag">kDither Flag</a>.
1055
1056### Return Value
1057
1058<a href="bmh_SkPaint_Reference?cl=9919#kDither_Flag">kDither Flag</a> state
1059
1060### Example
1061
1062<div><fiddle-embed name="f4ce93f6c5e7335436a985377fd980c0">
1063
1064#### Example Output
1065
1066~~~~
1067paint.isDither() == !!(paint.getFlags() & SkPaint::kDither_Flag)
1068paint.isDither() == !!(paint.getFlags() & SkPaint::kDither_Flag)
1069~~~~
1070
1071</fiddle-embed></div>
1072
1073---
1074
1075<a name="setDither"></a>
1076## setDither
1077
1078<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
1079void setDither(bool dither)
1080</pre>
1081
1082Requests, but does not require, to distribute color error.
1083
1084Sets <a href="bmh_SkPaint_Reference?cl=9919#kDither_Flag">kDither Flag</a> if <a href="bmh_SkPaint_Reference?cl=9919#dither">dither</a> is true.
1085Clears <a href="bmh_SkPaint_Reference?cl=9919#kDither_Flag">kDither Flag</a> if <a href="bmh_SkPaint_Reference?cl=9919#dither">dither</a> is false.
1086
1087### Parameters
1088
1089<table> <tr> <td><code><strong>dither </strong></code></td> <td>
1090setting for <a href="bmh_SkPaint_Reference?cl=9919#kDither_Flag">kDither Flag</a></td>
1091 </tr>
1092</table>
1093
1094### Example
1095
1096<div><fiddle-embed name="69b7162e8324d9239dd02dd9ada2bdff">
1097
1098#### Example Output
1099
1100~~~~
1101paint1 == paint2
1102~~~~
1103
1104</fiddle-embed></div>
1105
1106### See Also
1107
1108<a href="bmh_undocumented?cl=9919#SkColorType">kRGB 565 SkColorType</a>
1109
1110---
1111
1112### See Also
1113
1114Gradient <a href="bmh_undocumented?cl=9919#RGB_565">Color RGB-565</a>
1115
1116# <a name="Device_Text"></a> Device Text
1117<a href="bmh_SkPaint_Reference?cl=9919#LCD_Text">LCD Text</a> and <a href="bmh_SkPaint_Reference?cl=9919#Subpixel_Text">Subpixel Text</a> increase the precision of glyph position.
1118
1119When set, <a href="bmh_SkPaint_Reference?cl=9919#Flags">Flags</a> <a href="bmh_SkPaint_Reference?cl=9919#kLCDRenderText_Flag">kLCDRenderText Flag</a> takes advantage of the organization of <a href="bmh_undocumented?cl=9919#RGB">Color RGB</a> stripes that
1120create a color, and relies
1121on the small size of the stripe and visual perception to make the color fringing inperceptible.
1122<a href="bmh_SkPaint_Reference?cl=9919#LCD_Text">LCD Text</a> can be enabled on devices that orient stripes horizontally or vertically, and that order
1123the color components as <a href="bmh_undocumented?cl=9919#RGB">Color RGB</a> or <a href="bmh_undocumented?cl=9919#RBG">Color RBG</a>.
1124
1125<a href="bmh_SkPaint_Reference?cl=9919#Flags">Flags</a> <a href="bmh_SkPaint_Reference?cl=9919#kSubpixelText_Flag">kSubpixelText Flag</a> uses the pixel transparency to represent a fractional offset.
1126As the opaqueness
1127of the color increases, the edge of the glyph appears to move towards the outside of the pixel.
1128
1129Either or both techniques can be enabled.
1130<a href="bmh_SkPaint_Reference?cl=9919#kLCDRenderText_Flag">kLCDRenderText Flag</a> and <a href="bmh_SkPaint_Reference?cl=9919#kSubpixelText_Flag">kSubpixelText Flag</a> are clear by default.
1131<a href="bmh_SkPaint_Reference?cl=9919#LCD_Text">LCD Text</a> or <a href="bmh_SkPaint_Reference?cl=9919#Subpixel_Text">Subpixel Text</a> can be enabled by default by setting <a href="bmh_undocumented?cl=9919#SkPaintDefaults_Flags">SkPaintDefaults Flags</a> to
1132<a href="bmh_SkPaint_Reference?cl=9919#kLCDRenderText_Flag">kLCDRenderText Flag</a> or <a href="bmh_SkPaint_Reference?cl=9919#kSubpixelText_Flag">kSubpixelText Flag</a> (or both) at compile time.
1133
1134### Example
1135
1136<div><fiddle-embed name="4606ae1be792d6bc46d496432f050ee9"><div>Four commas are drawn normally and with combinations of <a href="bmh_SkPaint_Reference?cl=9919#LCD_Text">LCD Text</a> and <a href="bmh_SkPaint_Reference?cl=9919#Subpixel_Text">Subpixel Text</a>.
1137When <a href="bmh_SkPaint_Reference?cl=9919#Subpixel_Text">Subpixel Text</a> is disabled, the comma glyphs are indentical, but not evenly spaced.
1138When <a href="bmh_SkPaint_Reference?cl=9919#Subpixel_Text">Subpixel Text</a> is enabled, the comma glyphs are unique, but appear evenly spaced.</div></fiddle-embed></div>
1139
1140## <a name="Linear_Text"></a> Linear Text
1141
1142<a href="bmh_SkPaint_Reference?cl=9919#Linear_Text">Linear Text</a> selects whether text is rendered as a <a href="bmh_undocumented?cl=9919#Glyph">Glyph</a> or as a <a href="bmh_SkPath_Reference?cl=9919#Path">Path</a>.
1143If <a href="bmh_SkPaint_Reference?cl=9919#kLinearText_Flag">kLinearText Flag</a> is set, it has the same effect as setting <a href="bmh_SkPaint_Reference?cl=9919#Hinting">Hinting</a> to <a href="bmh_SkPaint_Reference?cl=9919#kNormal_Hinting">kNormal Hinting</a>.
1144If <a href="bmh_SkPaint_Reference?cl=9919#kLinearText_Flag">kLinearText Flag</a> is clear, it's the same as setting <a href="bmh_SkPaint_Reference?cl=9919#Hinting">Hinting</a> to <a href="bmh_SkPaint_Reference?cl=9919#kNo_Hinting">kNo Hinting</a>.
1145
1146<a name="isLinearText"></a>
1147## isLinearText
1148
1149<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
1150bool isLinearText() const
1151</pre>
1152
1153If true, text is converted to <a href="bmh_SkPath_Reference?cl=9919#Path">Path</a> before drawing and measuring.
1154
1155Equivalent to <a href="bmh_SkPaint_Reference?cl=9919#getFlags">getFlags</a> masked with <a href="bmh_SkPaint_Reference?cl=9919#kLinearText_Flag">kLinearText Flag</a>.
1156
1157### Return Value
1158
1159<a href="bmh_SkPaint_Reference?cl=9919#kLinearText_Flag">kLinearText Flag</a> state
1160
1161### Example
1162
1163<div><fiddle-embed name="2890ad644f980637837e6fcb386fb462"></fiddle-embed></div>
1164
1165### See Also
1166
1167<a href="bmh_SkPaint_Reference?cl=9919#setLinearText">setLinearText</a> <a href="bmh_SkPaint_Reference?cl=9919#Hinting">Hinting</a>
1168
1169---
1170
1171<a name="setLinearText"></a>
1172## setLinearText
1173
1174<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
1175void setLinearText(bool linearText)
1176</pre>
1177
1178If true, text is converted to <a href="bmh_SkPath_Reference?cl=9919#Path">Path</a> before drawing and measuring.
1179By default, <a href="bmh_SkPaint_Reference?cl=9919#kLinearText_Flag">kLinearText Flag</a> is clear.
1180
1181Sets <a href="bmh_SkPaint_Reference?cl=9919#kLinearText_Flag">kLinearText Flag</a> if <a href="bmh_SkPaint_Reference?cl=9919#linearText">linearText</a> is true.
1182Clears <a href="bmh_SkPaint_Reference?cl=9919#kLinearText_Flag">kLinearText Flag</a> if <a href="bmh_SkPaint_Reference?cl=9919#linearText">linearText</a> is false.
1183
1184### Parameters
1185
1186<table> <tr> <td><code><strong>linearText </strong></code></td> <td>
1187setting for <a href="bmh_SkPaint_Reference?cl=9919#kLinearText_Flag">kLinearText Flag</a></td>
1188 </tr>
1189</table>
1190
1191### Example
1192
1193<div><fiddle-embed name="c93bb912f3bddfb4d96d3ad70ada552b"></fiddle-embed></div>
1194
1195### See Also
1196
1197<a href="bmh_SkPaint_Reference?cl=9919#isLinearText">isLinearText</a> <a href="bmh_SkPaint_Reference?cl=9919#Hinting">Hinting</a>
1198
1199---
1200
1201## <a name="Subpixel_Text"></a> Subpixel Text
1202
1203<a href="bmh_SkPaint_Reference?cl=9919#Flags">Flags</a> <a href="bmh_SkPaint_Reference?cl=9919#kSubpixelText_Flag">kSubpixelText Flag</a> uses the pixel transparency to represent a fractional offset.
1204As the opaqueness
1205of the color increases, the edge of the glyph appears to move towards the outside of the pixel.
1206
1207<a name="isSubpixelText"></a>
1208## isSubpixelText
1209
1210<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
1211bool isSubpixelText() const
1212</pre>
1213
1214If true, glyphs at different sub-pixel positions may differ on pixel edge coverage.
1215
1216Equivalent to <a href="bmh_SkPaint_Reference?cl=9919#getFlags">getFlags</a> masked with <a href="bmh_SkPaint_Reference?cl=9919#kSubpixelText_Flag">kSubpixelText Flag</a>.
1217
1218### Return Value
1219
1220<a href="bmh_SkPaint_Reference?cl=9919#kSubpixelText_Flag">kSubpixelText Flag</a> state
1221
1222### Example
1223
1224<div><fiddle-embed name="abe9afc0932e2199324ae6cbb396e67c">
1225
1226#### Example Output
1227
1228~~~~
1229paint.isSubpixelText() == !!(paint.getFlags() & SkPaint::kSubpixelText_Flag)
1230paint.isSubpixelText() == !!(paint.getFlags() & SkPaint::kSubpixelText_Flag)
1231~~~~
1232
1233</fiddle-embed></div>
1234
1235---
1236
1237<a name="setSubpixelText"></a>
1238## setSubpixelText
1239
1240<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
1241void setSubpixelText(bool subpixelText)
1242</pre>
1243
1244Requests, but does not require, that glyphs respect sub-pixel positioning.
1245
1246Sets <a href="bmh_SkPaint_Reference?cl=9919#kSubpixelText_Flag">kSubpixelText Flag</a> if <a href="bmh_SkPaint_Reference?cl=9919#subpixelText">subpixelText</a> is true.
1247Clears <a href="bmh_SkPaint_Reference?cl=9919#kSubpixelText_Flag">kSubpixelText Flag</a> if <a href="bmh_SkPaint_Reference?cl=9919#subpixelText">subpixelText</a> is false.
1248
1249### Parameters
1250
1251<table> <tr> <td><code><strong>subpixelText </strong></code></td> <td>
1252setting for <a href="bmh_SkPaint_Reference?cl=9919#kSubpixelText_Flag">kSubpixelText Flag</a></td>
1253 </tr>
1254</table>
1255
1256### Example
1257
1258<div><fiddle-embed name="a77bbc1a4e3be9a8ab0f842f877c5ee4">
1259
1260#### Example Output
1261
1262~~~~
1263paint1 == paint2
1264~~~~
1265
1266</fiddle-embed></div>
1267
1268---
1269
1270## <a name="LCD_Text"></a> LCD Text
1271
1272When set, <a href="bmh_SkPaint_Reference?cl=9919#Flags">Flags</a> <a href="bmh_SkPaint_Reference?cl=9919#kLCDRenderText_Flag">kLCDRenderText Flag</a> takes advantage of the organization of <a href="bmh_undocumented?cl=9919#RGB">Color RGB</a> stripes that
1273create a color, and relies
1274on the small size of the stripe and visual perception to make the color fringing inperceptible.
1275<a href="bmh_SkPaint_Reference?cl=9919#LCD_Text">LCD Text</a> can be enabled on devices that orient stripes horizontally or vertically, and that order
1276the color components as <a href="bmh_undocumented?cl=9919#RGB">Color RGB</a> or <a href="bmh_undocumented?cl=9919#RBG">Color RBG</a>.
1277
1278<a name="isLCDRenderText"></a>
1279## isLCDRenderText
1280
1281<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
1282bool isLCDRenderText() const
1283</pre>
1284
1285If true, glyphs may use <a href="bmh_undocumented?cl=9919#LCD">LCD</a> striping to improve glyph edges.
1286
1287Returns true if <a href="bmh_SkPaint_Reference?cl=9919#Flags">Flags</a> <a href="bmh_SkPaint_Reference?cl=9919#kLCDRenderText_Flag">kLCDRenderText Flag</a> is set.
1288
1289### Return Value
1290
1291<a href="bmh_SkPaint_Reference?cl=9919#kLCDRenderText_Flag">kLCDRenderText Flag</a> state
1292
1293### Example
1294
1295<div><fiddle-embed name="68e1fd95dd2fd06a333899d2bd2396b9">
1296
1297#### Example Output
1298
1299~~~~
1300paint.isLCDRenderText() == !!(paint.getFlags() & SkPaint::kLCDRenderText_Flag)
1301paint.isLCDRenderText() == !!(paint.getFlags() & SkPaint::kLCDRenderText_Flag)
1302~~~~
1303
1304</fiddle-embed></div>
1305
1306---
1307
1308<a name="setLCDRenderText"></a>
1309## setLCDRenderText
1310
1311<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
1312void setLCDRenderText(bool lcdText)
1313</pre>
1314
1315Requests, but does not require, that glyphs use <a href="bmh_undocumented?cl=9919#LCD">LCD</a> striping for glyph edges.
1316
1317Sets <a href="bmh_SkPaint_Reference?cl=9919#kLCDRenderText_Flag">kLCDRenderText Flag</a> if <a href="bmh_SkPaint_Reference?cl=9919#lcdText">lcdText</a> is true.
1318Clears <a href="bmh_SkPaint_Reference?cl=9919#kLCDRenderText_Flag">kLCDRenderText Flag</a> if <a href="bmh_SkPaint_Reference?cl=9919#lcdText">lcdText</a> is false.
1319
1320### Parameters
1321
1322<table> <tr> <td><code><strong>lcdText </strong></code></td> <td>
1323setting for <a href="bmh_SkPaint_Reference?cl=9919#kLCDRenderText_Flag">kLCDRenderText Flag</a></td>
1324 </tr>
1325</table>
1326
1327### Example
1328
1329<div><fiddle-embed name="50dedf8450159571a3edaf4f0050defe">
1330
1331#### Example Output
1332
1333~~~~
1334paint1 == paint2
1335~~~~
1336
1337</fiddle-embed></div>
1338
1339---
1340
1341# <a name="Font_Embedded_Bitmaps"></a> Font Embedded Bitmaps
1342<a href="bmh_SkPaint_Reference?cl=9919#Font_Embedded_Bitmaps">Font Embedded Bitmaps</a> allows selecting custom-sized bitmap glyphs.
1343<a href="bmh_SkPaint_Reference?cl=9919#Flags">Flags</a> <a href="bmh_SkPaint_Reference?cl=9919#kEmbeddedBitmapText_Flag">kEmbeddedBitmapText Flag</a> when set chooses an embedded bitmap glyph over an outline contained
1344in a font if the platform supports this option.
1345
1346<a href="bmh_undocumented?cl=9919#FreeType">FreeType</a> selects the bitmap glyph if available when <a href="bmh_SkPaint_Reference?cl=9919#kEmbeddedBitmapText_Flag">kEmbeddedBitmapText Flag</a> is set, and selects
1347the outline glyph if <a href="bmh_SkPaint_Reference?cl=9919#kEmbeddedBitmapText_Flag">kEmbeddedBitmapText Flag</a> is clear.
1348<a href="bmh_undocumented?cl=9919#Windows">Windows</a> may select the bitmap glyph but is not required to do so.
1349<a href="bmh_undocumented?cl=9919#OS_X">OS X</a> and <a href="bmh_undocumented?cl=9919#iOS">iOS</a> do not support this option.
1350
1351<a href="bmh_SkPaint_Reference?cl=9919#Font_Embedded_Bitmaps">Font Embedded Bitmaps</a> is disabled by default.
1352<a href="bmh_SkPaint_Reference?cl=9919#Font_Embedded_Bitmaps">Font Embedded Bitmaps</a> can be enabled by default by setting <a href="bmh_undocumented?cl=9919#SkPaintDefaults_Flags">SkPaintDefaults Flags</a> to
1353<a href="bmh_SkPaint_Reference?cl=9919#kEmbeddedBitmapText_Flag">kEmbeddedBitmapText Flag</a> at compile time.
1354
1355### Example
1356
1357<pre style="padding: 1em 1em 1em 1em;width: 44em; background-color: #f0f0f0">
1358!fiddle<div>The hintgasp <a href="bmh_undocumented?cl=9919#TrueType">TrueType</a> font in the <a href="bmh_undocumented?cl=9919#Skia">Skia</a> resources/fonts directory includes an embedded
1359bitmap glyph at odd font sizes. This example works on platforms that use <a href="bmh_undocumented?cl=9919#FreeType">FreeType</a>
1360as their <a href="bmh_undocumented?cl=9919#Engine">Font Engine</a>.
1361<a href="bmh_undocumented?cl=9919#Windows">Windows</a> may, but is not required to, return a bitmap glyph if <a href="bmh_SkPaint_Reference?cl=9919#kEmbeddedBitmapText_Flag">kEmbeddedBitmapText Flag</a> is set.</div><a href="bmh_undocumented?cl=9919#SkBitmap">SkBitmap</a> bitmap;
1362bitmap.allocN32Pixels(30, 15);
1363bitmap.eraseColor(0);
1364<a href="bmh_SkCanvas_Reference?cl=9919#SkCanvas">SkCanvas</a> offscreen(bitmap);
1365<a href="bmh_SkPaint_Reference?cl=9919#SkPaint">SkPaint</a> paint;
1366paint.</pre>
1367
1368<a name="isEmbeddedBitmapText"></a>
1369## isEmbeddedBitmapText
1370
1371<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
1372bool isEmbeddedBitmapText() const
1373</pre>
1374
1375If true, <a href="bmh_undocumented?cl=9919#Engine">Font Engine</a> may return glyphs from font bitmaps instead of from outlines.
1376
1377Equivalent to <a href="bmh_SkPaint_Reference?cl=9919#getFlags">getFlags</a> masked with <a href="bmh_SkPaint_Reference?cl=9919#kEmbeddedBitmapText_Flag">kEmbeddedBitmapText Flag</a>.
1378
1379### Return Value
1380
1381<a href="bmh_SkPaint_Reference?cl=9919#kEmbeddedBitmapText_Flag">kEmbeddedBitmapText Flag</a> state
1382
1383### Example
1384
1385<div><fiddle-embed name="eba10b27b790e87183ae451b3fc5c4b1">
1386
1387#### Example Output
1388
1389~~~~
1390paint.isEmbeddedBitmapText() == !!(paint.getFlags() & SkPaint::kEmbeddedBitmapText_Flag)
1391paint.isEmbeddedBitmapText() == !!(paint.getFlags() & SkPaint::kEmbeddedBitmapText_Flag)
1392~~~~
1393
1394</fiddle-embed></div>
1395
1396---
1397
1398<a name="setEmbeddedBitmapText"></a>
1399## setEmbeddedBitmapText
1400
1401<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
1402void setEmbeddedBitmapText(bool useEmbeddedBitmapText)
1403</pre>
1404
1405Requests, but does not require, to use bitmaps in fonts instead of outlines.
1406
1407Sets <a href="bmh_SkPaint_Reference?cl=9919#kEmbeddedBitmapText_Flag">kEmbeddedBitmapText Flag</a> if <a href="bmh_SkPaint_Reference?cl=9919#useEmbeddedBitmapText">useEmbeddedBitmapText</a> is true.
1408Clears <a href="bmh_SkPaint_Reference?cl=9919#kEmbeddedBitmapText_Flag">kEmbeddedBitmapText Flag</a> if <a href="bmh_SkPaint_Reference?cl=9919#useEmbeddedBitmapText">useEmbeddedBitmapText</a> is false.
1409
1410### Parameters
1411
1412<table> <tr> <td><code><strong>useEmbeddedBitmapText </strong></code></td> <td>
1413setting for <a href="bmh_SkPaint_Reference?cl=9919#kEmbeddedBitmapText_Flag">kEmbeddedBitmapText Flag</a></td>
1414 </tr>
1415</table>
1416
1417### Example
1418
1419<div><fiddle-embed name="246dffdd93a484ba4ad7ecf71198a5d4">
1420
1421#### Example Output
1422
1423~~~~
1424paint1 == paint2
1425~~~~
1426
1427</fiddle-embed></div>
1428
1429---
1430
1431# <a name="Automatic_Hinting"></a> Automatic Hinting
1432If <a href="bmh_SkPaint_Reference?cl=9919#Hinting">Hinting</a> is set to <a href="bmh_SkPaint_Reference?cl=9919#kNormal_Hinting">kNormal Hinting</a> or <a href="bmh_SkPaint_Reference?cl=9919#kFull_Hinting">kFull Hinting</a>, <a href="bmh_SkPaint_Reference?cl=9919#Automatic_Hinting">Automatic Hinting</a>
1433instructs the <a href="bmh_undocumented?cl=9919#Font_Manager">Font Manager</a> to always hint Glyphs.
1434<a href="bmh_SkPaint_Reference?cl=9919#Automatic_Hinting">Automatic Hinting</a> has no effect if <a href="bmh_SkPaint_Reference?cl=9919#Hinting">Hinting</a> is set to <a href="bmh_SkPaint_Reference?cl=9919#kNo_Hinting">kNo Hinting</a> or
1435<a href="bmh_SkPaint_Reference?cl=9919#kSlight_Hinting">kSlight Hinting</a>.
1436
1437<a href="bmh_SkPaint_Reference?cl=9919#Automatic_Hinting">Automatic Hinting</a> only affects platforms that use <a href="bmh_undocumented?cl=9919#FreeType">FreeType</a> as the <a href="bmh_undocumented?cl=9919#Font_Manager">Font Manager</a>.
1438
1439<a name="isAutohinted"></a>
1440## isAutohinted
1441
1442<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
1443bool isAutohinted() const
1444</pre>
1445
1446If true, and if <a href="bmh_SkPaint_Reference?cl=9919#Hinting">Hinting</a> is set to <a href="bmh_SkPaint_Reference?cl=9919#kNormal_Hinting">kNormal Hinting</a> or <a href="bmh_SkPaint_Reference?cl=9919#kFull_Hinting">kFull Hinting</a>, and if
1447platform uses <a href="bmh_undocumented?cl=9919#FreeType">FreeType</a> as the <a href="bmh_undocumented?cl=9919#Font_Manager">Font Manager</a>, instruct the <a href="bmh_undocumented?cl=9919#Font_Manager">Font Manager</a> to always hint
1448Glyphs.
1449
1450Equivalent to <a href="bmh_SkPaint_Reference?cl=9919#getFlags">getFlags</a> masked with <a href="bmh_SkPaint_Reference?cl=9919#kAutoHinting_Flag">kAutoHinting Flag</a>.
1451
1452### Return Value
1453
1454<a href="bmh_SkPaint_Reference?cl=9919#kAutoHinting_Flag">kAutoHinting Flag</a> state
1455
1456### Example
1457
1458<div><fiddle-embed name="aa4781afbe3b90e7ef56a287e5b9ce1e">
1459
1460#### Example Output
1461
1462~~~~
1463paint.isAutohinted() == !!(paint.getFlags() & SkPaint::kAutoHinting_Flag)
1464paint.isAutohinted() == !!(paint.getFlags() & SkPaint::kAutoHinting_Flag)
1465~~~~
1466
1467</fiddle-embed></div>
1468
1469### See Also
1470
1471<a href="bmh_SkPaint_Reference?cl=9919#setAutohinted">setAutohinted</a> <a href="bmh_SkPaint_Reference?cl=9919#Hinting">Hinting</a>
1472
1473---
1474
1475<a name="setAutohinted"></a>
1476## setAutohinted
1477
1478<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
1479void setAutohinted(bool useAutohinter)
1480</pre>
1481
1482If <a href="bmh_SkPaint_Reference?cl=9919#Hinting">Hinting</a> is set to <a href="bmh_SkPaint_Reference?cl=9919#kNormal_Hinting">kNormal Hinting</a> or <a href="bmh_SkPaint_Reference?cl=9919#kFull_Hinting">kFull Hinting</a> and <a href="bmh_SkPaint_Reference?cl=9919#useAutohinter">useAutohinter</a> is set,
1483instruct the <a href="bmh_undocumented?cl=9919#Font_Manager">Font Manager</a> to always hint Glyphs.
1484<a href="bmh_SkPaint_Reference?cl=9919#Automatic_Hinting">Automatic Hinting</a> has no effect if <a href="bmh_SkPaint_Reference?cl=9919#Hinting">Hinting</a> is set to <a href="bmh_SkPaint_Reference?cl=9919#kNo_Hinting">kNo Hinting</a> or
1485<a href="bmh_SkPaint_Reference?cl=9919#kSlight_Hinting">kSlight Hinting</a>.
1486
1487<a href="bmh_SkPaint_Reference?cl=9919#setAutohinted">setAutohinted</a> only affects platforms that use <a href="bmh_undocumented?cl=9919#FreeType">FreeType</a> as the <a href="bmh_undocumented?cl=9919#Font_Manager">Font Manager</a>.
1488
1489Sets <a href="bmh_SkPaint_Reference?cl=9919#kAutoHinting_Flag">kAutoHinting Flag</a> if <a href="bmh_SkPaint_Reference?cl=9919#useAutohinter">useAutohinter</a> is true.
1490Clears <a href="bmh_SkPaint_Reference?cl=9919#kAutoHinting_Flag">kAutoHinting Flag</a> if <a href="bmh_SkPaint_Reference?cl=9919#useAutohinter">useAutohinter</a> is false.
1491
1492### Parameters
1493
1494<table> <tr> <td><code><strong>useAutohinter </strong></code></td> <td>
1495setting for <a href="bmh_SkPaint_Reference?cl=9919#kAutoHinting_Flag">kAutoHinting Flag</a></td>
1496 </tr>
1497</table>
1498
1499### Example
1500
1501<div><fiddle-embed name="4e185306d7de9390fe8445eed0139309"></fiddle-embed></div>
1502
1503### See Also
1504
1505<a href="bmh_SkPaint_Reference?cl=9919#isAutohinted">isAutohinted</a> <a href="bmh_SkPaint_Reference?cl=9919#Hinting">Hinting</a>
1506
1507---
1508
1509# <a name="Vertical_Text"></a> Vertical Text
1510<a href="bmh_undocumented?cl=9919#Text">Text</a> may be drawn by positioning each glyph, or by positioning the first glyph and
1511using <a href="bmh_undocumented?cl=9919#Advance">Font Advance</a> to position subsequent glyphs. By default, each successive glyph
1512is positioned to the right of the preceeding glyph. <a href="bmh_SkPaint_Reference?cl=9919#Vertical_Text">Vertical Text</a> sets successive
1513glyphs to position below the preceeding glyph.
1514
1515<a href="bmh_undocumented?cl=9919#Skia">Skia</a> can translate text character codes as a series of glyphs, but does not implement
1516font substitution,
1517textual substitution, line layout, or contextual spacing like kerning pairs. Use
1518a text shaping engine likeHarfBuzzhttp://harfbuzz.org/to translate text runs
1519into glyph series.
1520
1521<a href="bmh_SkPaint_Reference?cl=9919#Vertical_Text">Vertical Text</a> is clear if text is drawn left to right or set if drawn from top to bottom.
1522
1523<a href="bmh_SkPaint_Reference?cl=9919#Flags">Flags</a> <a href="bmh_SkPaint_Reference?cl=9919#kVerticalText_Flag">kVerticalText Flag</a> if clear draws text left to right.
1524<a href="bmh_SkPaint_Reference?cl=9919#Flags">Flags</a> <a href="bmh_SkPaint_Reference?cl=9919#kVerticalText_Flag">kVerticalText Flag</a> if set draws text top to bottom.
1525
1526<a href="bmh_SkPaint_Reference?cl=9919#Vertical_Text">Vertical Text</a> is clear by default.
1527<a href="bmh_SkPaint_Reference?cl=9919#Vertical_Text">Vertical Text</a> can be set by default by setting <a href="bmh_undocumented?cl=9919#SkPaintDefaults_Flags">SkPaintDefaults Flags</a> to
1528<a href="bmh_SkPaint_Reference?cl=9919#kVerticalText_Flag">kVerticalText Flag</a> at compile time.
1529
1530### Example
1531
1532<div><fiddle-embed name="8df5800819311b71373d9abb669b49b8"></fiddle-embed></div>
1533
1534<a name="isVerticalText"></a>
1535## isVerticalText
1536
1537<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
1538bool isVerticalText() const
1539</pre>
1540
1541If true, glyphs are drawn top to bottom instead of left to right.
1542
1543Equivalent to <a href="bmh_SkPaint_Reference?cl=9919#getFlags">getFlags</a> masked with <a href="bmh_SkPaint_Reference?cl=9919#kVerticalText_Flag">kVerticalText Flag</a>.
1544
1545### Return Value
1546
1547<a href="bmh_SkPaint_Reference?cl=9919#kVerticalText_Flag">kVerticalText Flag</a> state
1548
1549### Example
1550
1551<div><fiddle-embed name="4a269b16e644d473870ffa873396f139">
1552
1553#### Example Output
1554
1555~~~~
1556paint.isVerticalText() == !!(paint.getFlags() & SkPaint::kVerticalText_Flag)
1557paint.isVerticalText() == !!(paint.getFlags() & SkPaint::kVerticalText_Flag)
1558~~~~
1559
1560</fiddle-embed></div>
1561
1562---
1563
1564<a name="setVerticalText"></a>
1565## setVerticalText
1566
1567<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
1568void setVerticalText(bool verticalText)
1569</pre>
1570
1571If true, text advance positions the next glyph below the previous glyph instead of to the
1572right of previous glyph.
1573
1574Sets <a href="bmh_SkPaint_Reference?cl=9919#kVerticalText_Flag">kVerticalText Flag</a> if vertical is true.
1575Clears <a href="bmh_SkPaint_Reference?cl=9919#kVerticalText_Flag">kVerticalText Flag</a> if vertical is false.
1576
1577### Parameters
1578
1579<table> <tr> <td><code><strong>verticalText </strong></code></td> <td>
1580setting for <a href="bmh_SkPaint_Reference?cl=9919#kVerticalText_Flag">kVerticalText Flag</a></td>
1581 </tr>
1582</table>
1583
1584### Example
1585
1586<div><fiddle-embed name="6fbd7e9e1a346cb8d7f537786009c736">
1587
1588#### Example Output
1589
1590~~~~
1591paint1 == paint2
1592~~~~
1593
1594</fiddle-embed></div>
1595
1596---
1597
1598# <a name="Fake_Bold"></a> Fake Bold
1599<a href="bmh_SkPaint_Reference?cl=9919#Fake_Bold">Fake Bold</a> approximates the bold font style accompanying a normal font when a bold font face
1600is not available. <a href="bmh_undocumented?cl=9919#Skia">Skia</a> does not provide font substitution; it is up to the client to find the
1601bold font face using the platform's <a href="bmh_undocumented?cl=9919#Font_Manager">Font Manager</a>.
1602
1603Use <a href="bmh_SkPaint_Reference?cl=9919#Text_Skew_X">Text Skew X</a> to approximate an italic font style when the italic font face
1604is not available.
1605
1606A <a href="bmh_undocumented?cl=9919#FreeType_based">FreeType-based</a> port may define <a href="bmh_undocumented?cl=9919#SK_USE_FREETYPE_EMBOLDEN">SK USE FREETYPE EMBOLDEN</a> at compile time to direct
1607the font engine to create the bold glyphs. Otherwise, the extra bold is computed
1608by increasing the stroke width and setting the <a href="bmh_SkPaint_Reference?cl=9919#Style">Style</a> to <a href="bmh_SkPaint_Reference?cl=9919#kStrokeAndFill_Style">kStrokeAndFill Style</a> as needed.
1609
1610<a href="bmh_SkPaint_Reference?cl=9919#Fake_Bold">Fake Bold</a> is disabled by default.
1611
1612### Example
1613
1614<div><fiddle-embed name="e811f4829a2daaaeaad3795504a7e02a"></fiddle-embed></div>
1615
1616<a name="isFakeBoldText"></a>
1617## isFakeBoldText
1618
1619<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
1620bool isFakeBoldText() const
1621</pre>
1622
1623If true, approximate bold by increasing the stroke width when creating glyph bitmaps
1624from outlines.
1625
1626Equivalent to <a href="bmh_SkPaint_Reference?cl=9919#getFlags">getFlags</a> masked with <a href="bmh_SkPaint_Reference?cl=9919#kFakeBoldText_Flag">kFakeBoldText Flag</a>.
1627
1628### Return Value
1629
1630<a href="bmh_SkPaint_Reference?cl=9919#kFakeBoldText_Flag">kFakeBoldText Flag</a> state
1631
1632### Example
1633
1634<div><fiddle-embed name="f54d1f85b16073b80b9eef2e1a1d151d">
1635
1636#### Example Output
1637
1638~~~~
1639paint.isFakeBoldText() == !!(paint.getFlags() & SkPaint::kFakeBoldText_Flag)
1640paint.isFakeBoldText() == !!(paint.getFlags() & SkPaint::kFakeBoldText_Flag)
1641~~~~
1642
1643</fiddle-embed></div>
1644
1645---
1646
1647<a name="setFakeBoldText"></a>
1648## setFakeBoldText
1649
1650<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
1651void setFakeBoldText(bool fakeBoldText)
1652</pre>
1653
1654Use increased stroke width when creating glyph bitmaps to approximate bolding.
1655
1656Sets <a href="bmh_SkPaint_Reference?cl=9919#kFakeBoldText_Flag">kFakeBoldText Flag</a> if <a href="bmh_SkPaint_Reference?cl=9919#fakeBoldText">fakeBoldText</a> is true.
1657Clears <a href="bmh_SkPaint_Reference?cl=9919#kFakeBoldText_Flag">kFakeBoldText Flag</a> if <a href="bmh_SkPaint_Reference?cl=9919#fakeBoldText">fakeBoldText</a> is false.
1658
1659### Parameters
1660
1661<table> <tr> <td><code><strong>fakeBoldText </strong></code></td> <td>
1662setting for <a href="bmh_SkPaint_Reference?cl=9919#kFakeBoldText_Flag">kFakeBoldText Flag</a></td>
1663 </tr>
1664</table>
1665
1666### Example
1667
1668<div><fiddle-embed name="594d47858eb11028cb626515a520910a">
1669
1670#### Example Output
1671
1672~~~~
1673paint1 == paint2
1674~~~~
1675
1676</fiddle-embed></div>
1677
1678---
1679
1680# <a name="Full_Hinting_Spacing"></a> Full Hinting Spacing
1681<a href="bmh_SkPaint_Reference?cl=9919#Full_Hinting_Spacing">Full Hinting Spacing</a> adjusts the character spacing by the difference of the
1682hinted and unhinted left and right side bearings,
1683if <a href="bmh_SkPaint_Reference?cl=9919#Hinting">Hinting</a> is set to <a href="bmh_SkPaint_Reference?cl=9919#kFull_Hinting">kFull Hinting</a>. <a href="bmh_SkPaint_Reference?cl=9919#Full_Hinting_Spacing">Full Hinting Spacing</a> only
1684applies to platforms that use <a href="bmh_undocumented?cl=9919#FreeType">FreeType</a> as their <a href="bmh_undocumented?cl=9919#Engine">Font Engine</a>.
1685
1686<a href="bmh_SkPaint_Reference?cl=9919#Full_Hinting_Spacing">Full Hinting Spacing</a> is not related to text kerning, where the space between
1687a specific pair of characters is adjusted using data in the font's kerning tables.
1688
1689<a name="isDevKernText"></a>
1690## isDevKernText
1691
1692<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
1693bool isDevKernText() const
1694</pre>
1695
1696Returns if character spacing may be adjusted by the hinting difference.
1697
1698Equivalent to <a href="bmh_SkPaint_Reference?cl=9919#getFlags">getFlags</a> masked with <a href="bmh_SkPaint_Reference?cl=9919#kDevKernText_Flag">kDevKernText Flag</a>.
1699
1700### Return Value
1701
1702<a href="bmh_SkPaint_Reference?cl=9919#kDevKernText_Flag">kDevKernText Flag</a> state
1703
1704### Example
1705
1706<div><fiddle-embed name="4f69a84b2505b12809c30b0cc09c5157"></fiddle-embed></div>
1707
1708---
1709
1710<a name="setDevKernText"></a>
1711## setDevKernText
1712
1713<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
1714void setDevKernText(bool devKernText)
1715</pre>
1716
1717Requests, but does not require, to use hinting to adjust glyph spacing.
1718
1719Sets <a href="bmh_SkPaint_Reference?cl=9919#kDevKernText_Flag">kDevKernText Flag</a> if <a href="bmh_SkPaint_Reference?cl=9919#devKernText">devKernText</a> is true.
1720Clears <a href="bmh_SkPaint_Reference?cl=9919#kDevKernText_Flag">kDevKernText Flag</a> if <a href="bmh_SkPaint_Reference?cl=9919#devKernText">devKernText</a> is false.
1721
1722### Parameters
1723
1724<table> <tr> <td><code><strong>devKernText </strong></code></td> <td>
1725setting for <a href="bmh_SkPaint_Reference?cl=9919#devKernText">devKernText</a></td>
1726 </tr>
1727</table>
1728
1729### Example
1730
1731<div><fiddle-embed name="2b718a059072908bf68942503f264797">
1732
1733#### Example Output
1734
1735~~~~
1736paint1 == paint2
1737~~~~
1738
1739</fiddle-embed></div>
1740
1741---
1742
1743# <a name="Filter_Quality_Methods"></a> Filter Quality Methods
1744<a href="bmh_undocumented?cl=9919#Filter_Quality">Filter Quality</a> trades speed for image filtering when the image is scaled.
1745A lower <a href="bmh_undocumented?cl=9919#Filter_Quality">Filter Quality</a> draws faster, but has less fidelity.
1746A higher <a href="bmh_undocumented?cl=9919#Filter_Quality">Filter Quality</a> draws slower, but looks better.
1747If the image is unscaled, the <a href="bmh_undocumented?cl=9919#Filter_Quality">Filter Quality</a> choice will not result in a noticable
1748difference.
1749
1750<a href="bmh_undocumented?cl=9919#Filter_Quality">Filter Quality</a> is used in <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> passed as a parameter to
1751
1752<table> <tr>
1753 <td><a href="bmh_SkCanvas_Reference?cl=9919#drawBitmap">SkCanvas::drawBitmap</a></td> </tr> <tr>
1754 <td><a href="bmh_SkCanvas_Reference?cl=9919#drawBitmapRect">SkCanvas::drawBitmapRect</a></td> </tr> <tr>
1755 <td><a href="bmh_SkCanvas_Reference?cl=9919#drawImage">SkCanvas::drawImage</a></td> </tr> <tr>
1756 <td><a href="bmh_SkCanvas_Reference?cl=9919#drawImageRect">SkCanvas::drawImageRect</a></td> </tr>
1757</table>
1758
1759and when <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> has a <a href="bmh_undocumented?cl=9919#Shader">Shader</a> specialization that uses <a href="bmh_undocumented?cl=9919#Image">Image</a> or <a href="bmh_undocumented?cl=9919#Bitmap">Bitmap</a>.
1760
1761<a href="bmh_undocumented?cl=9919#Filter_Quality">Filter Quality</a> is <a href="bmh_undocumented?cl=9919#SkFilterQuality">kNone SkFilterQuality</a> by default.
1762
1763### Example
1764
1765<div><fiddle-embed name="ee77f83f7291e07ae0d89f1380c7d67c"></fiddle-embed></div>
1766
1767<a name="getFilterQuality"></a>
1768## getFilterQuality
1769
1770<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
1771SkFilterQuality getFilterQuality() const
1772</pre>
1773
1774Returns <a href="bmh_undocumented?cl=9919#Filter_Quality">Filter Quality</a>, the image filtering level. A lower setting
1775draws faster; a higher setting looks better when the image is scaled.
1776
1777### Return Value
1778
1779one of: <a href="bmh_undocumented?cl=9919#SkFilterQuality">kNone SkFilterQuality</a>, <a href="bmh_undocumented?cl=9919#SkFilterQuality">kLow SkFilterQuality</a>,
1780<a href="bmh_undocumented?cl=9919#SkFilterQuality">kMedium SkFilterQuality</a>, <a href="bmh_undocumented?cl=9919#SkFilterQuality">kHigh SkFilterQuality</a>
1781
1782### Example
1783
1784<div><fiddle-embed name="d4ca1f23809b6835c4ba46ea98a86900">
1785
1786#### Example Output
1787
1788~~~~
1789kNone_SkFilterQuality == paint.getFilterQuality()
1790~~~~
1791
1792</fiddle-embed></div>
1793
1794---
1795
1796<a name="setFilterQuality"></a>
1797## setFilterQuality
1798
1799<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
1800void setFilterQuality(SkFilterQuality quality)
1801</pre>
1802
1803Sets <a href="bmh_undocumented?cl=9919#Filter_Quality">Filter Quality</a>, the image filtering level. A lower setting
1804draws faster; a higher setting looks better when the image is scaled.
1805<a href="bmh_SkPaint_Reference?cl=9919#setFilterQuality">setFilterQuality</a> does not check to see if <a href="bmh_SkPaint_Reference?cl=9919#setFilterQuality">quality</a> is valid.
1806
1807### Parameters
1808
1809<table> <tr> <td><code><strong>quality </strong></code></td> <td>
1810one of: <a href="bmh_undocumented?cl=9919#SkFilterQuality">kNone SkFilterQuality</a>, <a href="bmh_undocumented?cl=9919#SkFilterQuality">kLow SkFilterQuality</a>,
1811<a href="bmh_undocumented?cl=9919#SkFilterQuality">kMedium SkFilterQuality</a>, <a href="bmh_undocumented?cl=9919#SkFilterQuality">kHigh SkFilterQuality</a></td>
1812 </tr>
1813</table>
1814
1815### Example
1816
1817<div><fiddle-embed name="e4288fabf24ee60b645e8bb6ea0afadf">
1818
1819#### Example Output
1820
1821~~~~
1822kHigh_SkFilterQuality == paint.getFilterQuality()
1823~~~~
1824
1825</fiddle-embed></div>
1826
1827### See Also
1828
1829<a href="bmh_undocumented?cl=9919#SkFilterQuality">SkFilterQuality</a> <a href="bmh_undocumented?cl=9919#Image_Scaling">Image Scaling</a>
1830
1831---
1832
1833# <a name="Color_Methods"></a> Color Methods
1834<a href="bmh_undocumented?cl=9919#Color">Color</a> specifies the <a href="bmh_undocumented?cl=9919#RGB_Red">Color RGB Red</a>, <a href="bmh_undocumented?cl=9919#RGB_Blue">Color RGB Blue</a>, <a href="bmh_undocumented?cl=9919#RGB_Green">Color RGB Green</a>, and <a href="bmh_undocumented?cl=9919#Alpha">Color Alpha</a> values used to draw a filled
1835or stroked shape in a
183632-bit value. Each component occupies 8-bits, ranging from zero: no contribution;
1837to 255: full intensity. All values in any combination are valid.
1838
1839<a href="bmh_undocumented?cl=9919#Color">Color</a> is not premultiplied;
1840<a href="bmh_undocumented?cl=9919#Alpha">Color Alpha</a> sets the transparency independent of <a href="bmh_undocumented?cl=9919#RGB">Color RGB</a>: <a href="bmh_undocumented?cl=9919#RGB_Red">Color RGB Red</a>, <a href="bmh_undocumented?cl=9919#RGB_Blue">Color RGB Blue</a>, and <a href="bmh_undocumented?cl=9919#RGB_Green">Color RGB Green</a>.
1841
1842The bit positions of <a href="bmh_undocumented?cl=9919#Alpha">Color Alpha</a> and <a href="bmh_undocumented?cl=9919#RGB">Color RGB</a> are independent of the bit positions
1843on the output device, which may have more or fewer bits, and may have a different arrangement.
1844
1845| bit positions | <a href="bmh_undocumented?cl=9919#Alpha">Color Alpha</a> | <a href="bmh_undocumented?cl=9919#RGB_Red">Color RGB Red</a> | <a href="bmh_undocumented?cl=9919#RGB_Blue">Color RGB Blue</a> | <a href="bmh_undocumented?cl=9919#RGB_Green">Color RGB Green</a> |
1846| --- | --- | --- | --- | --- |
1847| | 31 - 24 | 23 - 16 | 15 - 8 | 7 - 0 |
1848
1849### Example
1850
1851<div><fiddle-embed name="214b559d75c65a7bef6ef4be1f860053"></fiddle-embed></div>
1852
1853<a name="getColor"></a>
1854## getColor
1855
1856<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
1857SkColor getColor() const
1858</pre>
1859
1860Retrieves <a href="bmh_undocumented?cl=9919#Alpha">Color Alpha</a> and <a href="bmh_undocumented?cl=9919#RGB">Color RGB</a>, unpremultiplied, packed into 32 bits.
1861Use helpers <a href="bmh_undocumented?cl=9919#SkColorGetA">SkColorGetA</a>, <a href="bmh_undocumented?cl=9919#SkColorGetR">SkColorGetR</a>, <a href="bmh_undocumented?cl=9919#SkColorGetG">SkColorGetG</a>, and <a href="bmh_undocumented?cl=9919#SkColorGetB">SkColorGetB</a> to extract
1862a color component.
1863
1864### Return Value
1865
1866<a href="bmh_undocumented?cl=9919#Unpremultiplied">Unpremultiplied</a> <a href="bmh_undocumented?cl=9919#ARGB">Color ARGB</a>
1867
1868### Example
1869
1870<div><fiddle-embed name="72d41f890203109a41f589a7403acae9">
1871
1872#### Example Output
1873
1874~~~~
1875Yellow is 100% red, 100% green, and 0% blue.
1876~~~~
1877
1878</fiddle-embed></div>
1879
1880### See Also
1881
1882<a href="bmh_undocumented?cl=9919#SkColor">SkColor</a>
1883
1884---
1885
1886<a name="setColor"></a>
1887## setColor
1888
1889<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
1890void setColor(SkColor color)
1891</pre>
1892
1893Sets <a href="bmh_undocumented?cl=9919#Alpha">Color Alpha</a> and <a href="bmh_undocumented?cl=9919#RGB">Color RGB</a> used when stroking and filling. The <a href="bmh_SkPaint_Reference?cl=9919#color">color</a> is a 32-bit value,
1894unpremutiplied, packing 8-bit components for <a href="bmh_undocumented?cl=9919#Alpha">Color Alpha</a>, <a href="bmh_undocumented?cl=9919#RGB_Red">Color RGB Red</a>, <a href="bmh_undocumented?cl=9919#RGB_Blue">Color RGB Blue</a>, and <a href="bmh_undocumented?cl=9919#RGB_Green">Color RGB Green</a>.
1895
1896### Parameters
1897
1898<table> <tr> <td><code><strong>color </strong></code></td> <td>
1899<a href="bmh_undocumented?cl=9919#Unpremultiplied">Unpremultiplied</a> <a href="bmh_undocumented?cl=9919#ARGB">Color ARGB</a></td>
1900 </tr>
1901</table>
1902
1903### Example
1904
1905<div><fiddle-embed name="6e70f18300bd676a3c056ceb6b62f8df">
1906
1907#### Example Output
1908
1909~~~~
1910green1 == green2
1911~~~~
1912
1913</fiddle-embed></div>
1914
1915### See Also
1916
1917<a href="bmh_undocumented?cl=9919#SkColor">SkColor</a> <a href="bmh_SkPaint_Reference?cl=9919#setARGB">setARGB</a> <a href="bmh_undocumented?cl=9919#SkColorSetARGB">SkColorSetARGB</a>
1918
1919---
1920
1921## <a name="Alpha_Methods"></a> Alpha Methods
1922
1923<a href="bmh_undocumented?cl=9919#Alpha">Color Alpha</a> sets the transparency independent of <a href="bmh_undocumented?cl=9919#RGB">Color RGB</a>: <a href="bmh_undocumented?cl=9919#RGB_Red">Color RGB Red</a>, <a href="bmh_undocumented?cl=9919#RGB_Blue">Color RGB Blue</a>, and <a href="bmh_undocumented?cl=9919#RGB_Green">Color RGB Green</a>.
1924
1925<a name="getAlpha"></a>
1926## getAlpha
1927
1928<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
1929uint8_t getAlpha() const
1930</pre>
1931
1932Retrieves <a href="bmh_undocumented?cl=9919#Alpha">Color Alpha</a> from the <a href="bmh_undocumented?cl=9919#Color">Color</a> used when stroking and filling.
1933
1934### Return Value
1935
1936<a href="bmh_undocumented?cl=9919#Alpha">Color Alpha</a> ranging from zero, fully transparent, to 255, fully opaque
1937
1938### Example
1939
1940<div><fiddle-embed name="9a85bb62fe3d877b18fb7f952c4fa7f7">
1941
1942#### Example Output
1943
1944~~~~
1945255 == paint.getAlpha()
1946~~~~
1947
1948</fiddle-embed></div>
1949
1950---
1951
1952<a name="setAlpha"></a>
1953## setAlpha
1954
1955<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
1956void setAlpha(U8CPU a)
1957</pre>
1958
1959Replaces <a href="bmh_undocumented?cl=9919#Alpha">Color Alpha</a>, leaving <a href="bmh_undocumented?cl=9919#RGB">Color RGB</a>
1960unchanged. An out of range value triggers an assert in the debug
1961build. <a href="bmh_SkPaint_Reference?cl=9919#a">a</a> is <a href="bmh_SkPaint_Reference?cl=9919#a">a</a> value from zero to 255.
1962<a href="bmh_SkPaint_Reference?cl=9919#a">a</a> set to zero makes <a href="bmh_undocumented?cl=9919#Color">Color</a> fully transparent; <a href="bmh_SkPaint_Reference?cl=9919#a">a</a> set to 255 makes <a href="bmh_undocumented?cl=9919#Color">Color</a>
1963fully opaque.
1964
1965### Parameters
1966
1967<table> <tr> <td><code><strong>a </strong></code></td> <td>
1968<a href="bmh_undocumented?cl=9919#Alpha">Color Alpha</a> component of <a href="bmh_undocumented?cl=9919#Color">Color</a></td>
1969 </tr>
1970</table>
1971
1972### Example
1973
1974<div><fiddle-embed name="6ddc0360512dfb9947e75c17e6a8103d">
1975
1976#### Example Output
1977
1978~~~~
19790x44112233 == paint.getColor()
1980~~~~
1981
1982</fiddle-embed></div>
1983
1984---
1985
1986<a name="setARGB"></a>
1987## setARGB
1988
1989<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
1990void setARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
1991</pre>
1992
1993Sets <a href="bmh_undocumented?cl=9919#Color">Color</a> used when drawing solid fills. The color components range from 0 to 255.
1994The color is unpremultiplied;
1995<a href="bmh_undocumented?cl=9919#Alpha">Color Alpha</a> sets the transparency independent of <a href="bmh_undocumented?cl=9919#RGB">Color RGB</a>.
1996
1997### Parameters
1998
1999<table> <tr> <td><code><strong>a </strong></code></td> <td>
2000amount of <a href="bmh_undocumented?cl=9919#Alpha">Color Alpha</a>, from fully transparent (0) to fully opaque (255)</td>
2001 </tr> <tr> <td><code><strong>r </strong></code></td> <td>
2002amount of <a href="bmh_undocumented?cl=9919#RGB_Red">Color RGB Red</a>, from no red (0) to full red (255)</td>
2003 </tr> <tr> <td><code><strong>g </strong></code></td> <td>
2004amount of <a href="bmh_undocumented?cl=9919#RGB_Green">Color RGB Green</a>, from no green (0) to full green (255)</td>
2005 </tr> <tr> <td><code><strong>b </strong></code></td> <td>
2006amount of <a href="bmh_undocumented?cl=9919#RGB_Blue">Color RGB Blue</a>, from no blue (0) to full blue (255)</td>
2007 </tr>
2008</table>
2009
2010### Example
2011
2012<div><fiddle-embed name="cb62e4755789ed32f7120dc55984959d">
2013
2014#### Example Output
2015
2016~~~~
2017transRed1 == transRed2
2018~~~~
2019
2020</fiddle-embed></div>
2021
2022### See Also
2023
2024<a href="bmh_SkPaint_Reference?cl=9919#setColor">setColor</a> <a href="bmh_undocumented?cl=9919#SkColorSetARGB">SkColorSetARGB</a>
2025
2026---
2027
2028# <a name="Style"></a> Style
2029<a href="bmh_SkPaint_Reference?cl=9919#Style">Style</a> specifies if the geometry is filled, stroked, or both filled and stroked.
2030Some shapes ignore <a href="bmh_SkPaint_Reference?cl=9919#Style">Style</a> and are always drawn filled or stroked.
2031
2032Set <a href="bmh_SkPaint_Reference?cl=9919#Style">Style</a> to <a href="bmh_SkPaint_Reference?cl=9919#kFill_Style">kFill Style</a> to fill the shape.
2033The fill covers the area inside the geometry for most shapes.
2034
2035Set <a href="bmh_SkPaint_Reference?cl=9919#Style">Style</a> to <a href="bmh_SkPaint_Reference?cl=9919#kStroke_Style">kStroke Style</a> to stroke the shape.
2036
2037## <a name="Fill"></a> Fill
2038
2039### See Also
2040
2041<a href="bmh_SkPath_Reference?cl=9919#Fill_Type">Path Fill Type</a>
2042
2043## <a name="Stroke"></a> Stroke
2044
2045The stroke covers the area described by following the shape's edge with a pen or brush of
2046<a href="bmh_SkPaint_Reference?cl=9919#Stroke_Width">Stroke Width</a>. The area covered where the shape starts and stops is described by <a href="bmh_SkPaint_Reference?cl=9919#Stroke_Cap">Stroke Cap</a>.
2047The area covered where the shape turns a corner is described by <a href="bmh_SkPaint_Reference?cl=9919#Stroke_Join">Stroke Join</a>.
2048The stroke is centered on the shape; it extends equally on either side of the shape's edge.
2049
2050As <a href="bmh_SkPaint_Reference?cl=9919#Stroke_Width">Stroke Width</a> gets smaller, the drawn path frame is thinner. <a href="bmh_SkPaint_Reference?cl=9919#Stroke_Width">Stroke Width</a> less than one
2051may have gaps, and if <a href="bmh_SkPaint_Reference?cl=9919#kAntiAlias_Flag">kAntiAlias Flag</a> is set, <a href="bmh_undocumented?cl=9919#Alpha">Color Alpha</a> will increase to visually decrease coverage.
2052
2053## <a name="Hairline"></a> Hairline
2054
2055<a href="bmh_SkPaint_Reference?cl=9919#Stroke_Width">Stroke Width</a> of zero has a special meaning and switches drawing to use <a href="bmh_SkPaint_Reference?cl=9919#Hairline">Hairline</a>.
2056<a href="bmh_SkPaint_Reference?cl=9919#Hairline">Hairline</a> draws the thinnest continuous frame. If <a href="bmh_SkPaint_Reference?cl=9919#kAntiAlias_Flag">kAntiAlias Flag</a> is clear, adjacent pixels
2057flow horizontally, vertically,or diagonally.
2058
2059<a href="bmh_SkPath_Reference?cl=9919#Path">Path</a> drawing with <a href="bmh_SkPaint_Reference?cl=9919#Hairline">Hairline</a> may hit the same pixel more than once. For instance, <a href="bmh_SkPath_Reference?cl=9919#Path">Path</a> containing
2060two lines in one <a href="bmh_SkPath_Reference?cl=9919#Contour">Path Contour</a> will draw the corner point once, but may both lines may draw the adjacent
2061pixel. If <a href="bmh_SkPaint_Reference?cl=9919#kAntiAlias_Flag">kAntiAlias Flag</a> is set, transparency is applied twice, resulting in a darker pixel. Some
2062<a href="bmh_undocumented?cl=9919#GPU_backed">GPU-backed</a> implementations apply transparency at a later drawing stage, avoiding double hit pixels
2063while stroking.
2064
2065## <a name="SkPaint::Style"></a> Enum SkPaint::Style
2066
2067<pre style="padding: 1em 1em 1em 1em;width: 44em; background-color: #f0f0f0">
2068enum <a href="bmh_SkPaint_Reference?cl=9919#Style">Style</a> {
2069<a href="bmh_SkPaint_Reference?cl=9919#kFill_Style">kFill Style</a>,
2070<a href="bmh_SkPaint_Reference?cl=9919#kStroke_Style">kStroke Style</a>,
2071<a href="bmh_SkPaint_Reference?cl=9919#kStrokeAndFill_Style">kStrokeAndFill Style</a>,
2072};</pre>
2073
2074Set <a href="bmh_SkPaint_Reference?cl=9919#Style">Style</a> to fill, stroke, or both fill and stroke geometry.
2075The stroke and fill
2076share all paint attributes; for instance, they are drawn with the same color.
2077
2078Use <a href="bmh_SkPaint_Reference?cl=9919#kStrokeAndFill_Style">kStrokeAndFill Style</a> to avoid hitting the same pixels twice with a stroke draw and
2079a fill draw.
2080
2081### Constants
2082
2083<table>
2084 <tr>
2085 <td><a name="SkPaint::kFill_Style"></a> <code><strong>SkPaint::kFill_Style </strong></code></td><td>0</td><td>Set to fill geometry.
2086Applies to <a href="bmh_undocumented?cl=9919#Rect">Rect</a>, <a href="bmh_undocumented?cl=9919#Region">Region</a>, <a href="bmh_undocumented?cl=9919#Round_Rect">Round Rect</a>, <a href="bmh_undocumented?cl=9919#Circle">Circle</a>, <a href="bmh_undocumented?cl=9919#Oval">Oval</a>, <a href="bmh_SkPath_Reference?cl=9919#Path">Path</a>, and <a href="bmh_undocumented?cl=9919#Text">Text</a>.
2087<a href="bmh_undocumented?cl=9919#Bitmap">Bitmap</a>, <a href="bmh_undocumented?cl=9919#Image">Image</a>, <a href="bmh_undocumented?cl=9919#Patch">Patch</a>, <a href="bmh_undocumented?cl=9919#Region">Region</a>, <a href="bmh_undocumented?cl=9919#Sprite">Sprite</a>, and <a href="bmh_undocumented?cl=9919#Vertices">Vertices</a> are painted as if
2088<a href="bmh_SkPaint_Reference?cl=9919#kFill_Style">kFill Style</a> is set, and ignore the set <a href="bmh_SkPaint_Reference?cl=9919#Style">Style</a>.
2089The <a href="bmh_SkPath_Reference?cl=9919#Fill_Type">Path Fill Type</a> specifies additional rules to fill the area outside the path edge,
2090and to create an unfilled hole inside the shape.
2091<a href="bmh_SkPaint_Reference?cl=9919#Style">Style</a> is set to <a href="bmh_SkPaint_Reference?cl=9919#kFill_Style">kFill Style</a> by default.</td>
2092 </tr>
2093 <tr>
2094 <td><a name="SkPaint::kStroke_Style"></a> <code><strong>SkPaint::kStroke_Style </strong></code></td><td>1</td><td>Set to stroke geometry.
2095Applies to <a href="bmh_undocumented?cl=9919#Rect">Rect</a>, <a href="bmh_undocumented?cl=9919#Region">Region</a>, <a href="bmh_undocumented?cl=9919#Round_Rect">Round Rect</a>, <a href="bmh_undocumented?cl=9919#Arc">Arc</a>, <a href="bmh_undocumented?cl=9919#Circle">Circle</a>, <a href="bmh_undocumented?cl=9919#Oval">Oval</a>,
2096<a href="bmh_SkPath_Reference?cl=9919#Path">Path</a>, and <a href="bmh_undocumented?cl=9919#Text">Text</a>.
2097<a href="bmh_undocumented?cl=9919#Arc">Arc</a>, <a href="bmh_undocumented?cl=9919#Line">Line</a>, <a href="bmh_undocumented?cl=9919#Point">Point</a>, and <a href="bmh_undocumented?cl=9919#Array">Point Array</a> are always drawn as if <a href="bmh_SkPaint_Reference?cl=9919#kStroke_Style">kStroke Style</a> is set,
2098and ignore the set <a href="bmh_SkPaint_Reference?cl=9919#Style">Style</a>.
2099The stroke construction is unaffected by the <a href="bmh_SkPath_Reference?cl=9919#Fill_Type">Path Fill Type</a>.</td>
2100 </tr>
2101 <tr>
2102 <td><a name="SkPaint::kStrokeAndFill_Style"></a> <code><strong>SkPaint::kStrokeAndFill_Style </strong></code></td><td>2</td><td>Set to stroke and fill geometry.
2103Applies to <a href="bmh_undocumented?cl=9919#Rect">Rect</a>, <a href="bmh_undocumented?cl=9919#Region">Region</a>, <a href="bmh_undocumented?cl=9919#Round_Rect">Round Rect</a>, <a href="bmh_undocumented?cl=9919#Circle">Circle</a>, <a href="bmh_undocumented?cl=9919#Oval">Oval</a>, <a href="bmh_SkPath_Reference?cl=9919#Path">Path</a>, and <a href="bmh_undocumented?cl=9919#Text">Text</a>.
2104<a href="bmh_SkPath_Reference?cl=9919#Path">Path</a> is treated as if it is set to <a href="bmh_SkPath_Reference?cl=9919#kWinding_FillType">SkPath::kWinding FillType</a>,
2105and the set <a href="bmh_SkPath_Reference?cl=9919#Fill_Type">Path Fill Type</a> is ignored.</td>
2106 </tr>
2107
2108</table>
2109
2110## <a name="SkPaint::_anonymous"></a> Enum SkPaint::_anonymous
2111
2112<pre style="padding: 1em 1em 1em 1em;width: 44em; background-color: #f0f0f0">
2113enum {
2114<a href="bmh_SkPaint_Reference?cl=9919#kStyleCount">kStyleCount</a> = <a href="bmh_SkPaint_Reference?cl=9919#kStrokeAndFill_Style">kStrokeAndFill Style</a> + 1
2115};</pre>
2116
2117### Constants
2118
2119<table>
2120 <tr>
2121 <td><a name="SkPaint::kStyleCount"></a> <code><strong>SkPaint::kStyleCount </strong></code></td><td>3</td><td>The number of different <a href="bmh_SkPaint_Reference?cl=9919#Style">Style</a> values defined.
2122May be used to verify that <a href="bmh_SkPaint_Reference?cl=9919#Style">Style</a> is a legal value.</td>
2123 </tr>
2124
2125</table>
2126
2127<a name="getStyle"></a>
2128## getStyle
2129
2130<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
2131Style getStyle() const
2132</pre>
2133
2134Whether the geometry is filled, stroked, or filled and stroked.
2135
2136### Return Value
2137
2138one of:<a href="bmh_SkPaint_Reference?cl=9919#kFill_Style">kFill Style</a>, <a href="bmh_SkPaint_Reference?cl=9919#kStroke_Style">kStroke Style</a>, <a href="bmh_SkPaint_Reference?cl=9919#kStrokeAndFill_Style">kStrokeAndFill Style</a>
2139
2140### Example
2141
2142<div><fiddle-embed name="1c5e18c3c0102d2dac86a78ba8c8ce01">
2143
2144#### Example Output
2145
2146~~~~
2147SkPaint::kFill_Style == paint.getStyle()
2148~~~~
2149
2150</fiddle-embed></div>
2151
2152### See Also
2153
2154<a href="bmh_SkPaint_Reference?cl=9919#Style">Style</a> <a href="bmh_SkPaint_Reference?cl=9919#setStyle">setStyle</a>
2155
2156---
2157
2158<a name="setStyle"></a>
2159## setStyle
2160
2161<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
2162void setStyle(Style style)
2163</pre>
2164
2165Sets whether the geometry is filled, stroked, or filled and stroked.
2166Has no effect if <a href="bmh_SkPaint_Reference?cl=9919#setStyle">style</a> is not a legal <a href="bmh_SkPaint_Reference?cl=9919#Style">Style</a> value.
2167
2168### Parameters
2169
2170<table> <tr> <td><code><strong>style </strong></code></td> <td>
2171one of: <a href="bmh_SkPaint_Reference?cl=9919#kFill_Style">kFill Style</a>, <a href="bmh_SkPaint_Reference?cl=9919#kStroke_Style">kStroke Style</a>, <a href="bmh_SkPaint_Reference?cl=9919#kStrokeAndFill_Style">kStrokeAndFill Style</a></td>
2172 </tr>
2173</table>
2174
2175### Example
2176
2177<div><fiddle-embed name="c7bb6248e4735b8d1a32d02fba40d344"></fiddle-embed></div>
2178
2179### See Also
2180
2181<a href="bmh_SkPaint_Reference?cl=9919#Style">Style</a> <a href="bmh_SkPaint_Reference?cl=9919#getStyle">getStyle</a>
2182
2183---
2184
2185### See Also
2186
2187<a href="bmh_SkPath_Reference?cl=9919#Fill_Type">Path Fill Type</a> <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a> <a href="bmh_SkPaint_Reference?cl=9919#Style_Fill">Style Fill</a> <a href="bmh_SkPaint_Reference?cl=9919#Style_Stroke">Style Stroke</a>
2188
2189# <a name="Stroke_Width"></a> Stroke Width
2190<a href="bmh_SkPaint_Reference?cl=9919#Stroke_Width">Stroke Width</a> sets the width for stroking. The width is the thickness
2191of the stroke perpendicular to the path's direction when the paint's style is
2192set to <a href="bmh_SkPaint_Reference?cl=9919#kStroke_Style">kStroke Style</a> or <a href="bmh_SkPaint_Reference?cl=9919#kStrokeAndFill_Style">kStrokeAndFill Style</a>.
2193
2194When width is greater than zero, the stroke encompasses as many pixels partially
2195or fully as needed. When the width equals zero, the paint enables hairlines;
2196the stroke is always one pixel wide.
2197
2198The stroke's dimensions are scaled by the canvas matrix, but <a href="bmh_SkPaint_Reference?cl=9919#Hairline">Hairline</a> stroke
2199remains one pixel wide regardless of scaling.
2200
2201The default width for the paint is zero.
2202
2203### Example
2204
2205<div><fiddle-embed name="01e3e08a3022a351628ff54e84887756">raster gpu<div>The pixels hit to represent thin lines vary with the angle of the
2206line and the platform's implementation.</div></fiddle-embed></div>
2207
2208<a name="getStrokeWidth"></a>
2209## getStrokeWidth
2210
2211<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
2212SkScalar getStrokeWidth() const
2213</pre>
2214
2215Returns the thickness of the pen used by <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> to
2216outline the shape.
2217
2218### Return Value
2219
2220zero for <a href="bmh_SkPaint_Reference?cl=9919#Hairline">Hairline</a>, greater than zero for pen thickness
2221
2222### Example
2223
2224<div><fiddle-embed name="99aa73f64df8bbf06e656cd891a81b9e">
2225
2226#### Example Output
2227
2228~~~~
22290 == paint.getStrokeWidth()
2230~~~~
2231
2232</fiddle-embed></div>
2233
2234---
2235
2236<a name="setStrokeWidth"></a>
2237## setStrokeWidth
2238
2239<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
2240void setStrokeWidth(SkScalar width)
2241</pre>
2242
2243Sets the thickness of the pen used by the paint to
2244outline the shape.
2245Has no effect if <a href="bmh_SkPaint_Reference?cl=9919#setStrokeWidth">width</a> is less than zero.
2246
2247### Parameters
2248
2249<table> <tr> <td><code><strong>width </strong></code></td> <td>
2250zero thickness for <a href="bmh_SkPaint_Reference?cl=9919#Hairline">Hairline</a>; greater than zero for pen thickness</td>
2251 </tr>
2252</table>
2253
2254### Example
2255
2256<div><fiddle-embed name="0c4446c0870b5c7b5a2efe77ff92afb8">
2257
2258#### Example Output
2259
2260~~~~
22615 == paint.getStrokeWidth()
2262~~~~
2263
2264</fiddle-embed></div>
2265
2266---
2267
2268# <a name="Miter_Limit"></a> Miter Limit
2269<a href="bmh_SkPaint_Reference?cl=9919#Miter_Limit">Miter Limit</a> specifies the maximum miter length,
2270relative to the stroke width.
2271
2272<a href="bmh_SkPaint_Reference?cl=9919#Miter_Limit">Miter Limit</a> is used when the <a href="bmh_SkPaint_Reference?cl=9919#Stroke_Join">Stroke Join</a>
2273is set to <a href="bmh_SkPaint_Reference?cl=9919#kMiter_Join">kMiter Join</a>, and the <a href="bmh_SkPaint_Reference?cl=9919#Style">Style</a> is either <a href="bmh_SkPaint_Reference?cl=9919#kStroke_Style">kStroke Style</a>
2274or <a href="bmh_SkPaint_Reference?cl=9919#kStrokeAndFill_Style">kStrokeAndFill Style</a>.
2275
2276If the miter at a corner exceeds this limit, <a href="bmh_SkPaint_Reference?cl=9919#kMiter_Join">kMiter Join</a>
2277is replaced with <a href="bmh_SkPaint_Reference?cl=9919#kBevel_Join">kBevel Join</a>.
2278
2279<a href="bmh_SkPaint_Reference?cl=9919#Miter_Limit">Miter Limit</a> can be computed from the corner angle:
2280
2281miter limit = 1 / sin ( angle / 2 )<a href="bmh_SkPaint_Reference?cl=9919#Miter_Limit">Miter Limit</a> default value is 4.
2282The default may be changed at compile time by setting <a href="bmh_undocumented?cl=9919#SkPaintDefaults_MiterLimit">SkPaintDefaults MiterLimit</a>
2283in <a href="bmh_undocumented?cl=9919#SkUserConfig.h">SkUserConfig.h</a> or as a define supplied by the build environment.
2284
2285Here are some miter limits and the angles that triggers them.
2286
2287| miter limit | angle in degrees |
2288| --- | --- |
2289| 10 | 11.48 |
2290| 9 | 12.76 |
2291| 8 | 14.36 |
2292| 7 | 16.43 |
2293| 6 | 19.19 |
2294| 5 | 23.07 |
2295| 4 | 28.96 |
2296| 3 | 38.94 |
2297| 2 | 60 |
2298| 1 | 180 |
2299
2300### Example
2301
2302<div><fiddle-embed name="5de2de0f00354e59074a9bb1a42d5a63"><div>This example draws a stroked corner and the miter length beneath.
2303When the miter limit is decreased slightly, the miter join is replaced
2304by a bevel join.</div></fiddle-embed></div>
2305
2306<a name="getStrokeMiter"></a>
2307## getStrokeMiter
2308
2309<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
2310SkScalar getStrokeMiter() const
2311</pre>
2312
2313The limit at which a sharp corner is drawn beveled.
2314
2315### Return Value
2316
2317zero and greater <a href="bmh_SkPaint_Reference?cl=9919#Miter_Limit">Miter Limit</a>
2318
2319### Example
2320
2321<div><fiddle-embed name="50da74a43b725f07a914df588c867d36">
2322
2323#### Example Output
2324
2325~~~~
2326default miter limit == 4
2327~~~~
2328
2329</fiddle-embed></div>
2330
2331### See Also
2332
2333<a href="bmh_SkPaint_Reference?cl=9919#Miter_Limit">Miter Limit</a> <a href="bmh_SkPaint_Reference?cl=9919#setStrokeMiter">setStrokeMiter</a> <a href="bmh_SkPaint_Reference?cl=9919#Join">Join</a>
2334
2335---
2336
2337<a name="setStrokeMiter"></a>
2338## setStrokeMiter
2339
2340<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
2341void setStrokeMiter(SkScalar miter)
2342</pre>
2343
2344The limit at which a sharp corner is drawn beveled.
2345Valid values are zero and greater.
2346Has no effect if <a href="bmh_SkPaint_Reference?cl=9919#setStrokeMiter">miter</a> is less than zero.
2347
2348### Parameters
2349
2350<table> <tr> <td><code><strong>miter </strong></code></td> <td>
2351zero and greater <a href="bmh_SkPaint_Reference?cl=9919#Miter_Limit">Miter Limit</a></td>
2352 </tr>
2353</table>
2354
2355### Example
2356
2357<div><fiddle-embed name="700b284dbc97785c6a9c9636088713ad">
2358
2359#### Example Output
2360
2361~~~~
2362default miter limit == 8
2363~~~~
2364
2365</fiddle-embed></div>
2366
2367### See Also
2368
2369<a href="bmh_SkPaint_Reference?cl=9919#Miter_Limit">Miter Limit</a> <a href="bmh_SkPaint_Reference?cl=9919#getStrokeMiter">getStrokeMiter</a> <a href="bmh_SkPaint_Reference?cl=9919#Join">Join</a>
2370
2371---
2372
2373# <a name="Stroke_Cap"></a> Stroke Cap
2374
2375## <a name="SkPaint::Cap"></a> Enum SkPaint::Cap
2376
2377<pre style="padding: 1em 1em 1em 1em;width: 44em; background-color: #f0f0f0">
2378enum <a href="bmh_SkPaint_Reference?cl=9919#Cap">Cap</a> {
2379<a href="bmh_SkPaint_Reference?cl=9919#kButt_Cap">kButt Cap</a>,
2380<a href="bmh_SkPaint_Reference?cl=9919#kRound_Cap">kRound Cap</a>,
2381<a href="bmh_SkPaint_Reference?cl=9919#kSquare_Cap">kSquare Cap</a>,
2382
2383<a href="bmh_SkPaint_Reference?cl=9919#kLast_Cap">kLast Cap</a> = <a href="bmh_SkPaint_Reference?cl=9919#kSquare_Cap">kSquare Cap</a>,
2384<a href="bmh_SkPaint_Reference?cl=9919#kDefault_Cap">kDefault Cap</a> = <a href="bmh_SkPaint_Reference?cl=9919#kButt_Cap">kButt Cap</a>
2385};
2386static constexpr int <a href="bmh_SkPaint_Reference?cl=9919#kCapCount">kCapCount</a> = <a href="bmh_SkPaint_Reference?cl=9919#kLast_Cap">kLast Cap</a> + 1;</pre>
2387
2388<a href="bmh_SkPaint_Reference?cl=9919#Stroke_Cap">Stroke Cap</a> draws at the beginning and end of an open <a href="bmh_SkPath_Reference?cl=9919#Contour">Path Contour</a>.
2389
2390### Constants
2391
2392<table>
2393 <tr>
2394 <td><a name="SkPaint::kButt_Cap"></a> <code><strong>SkPaint::kButt_Cap </strong></code></td><td>0</td><td>Does not extend the stroke past the beginning or the end.</td>
2395 </tr>
2396 <tr>
2397 <td><a name="SkPaint::kRound_Cap"></a> <code><strong>SkPaint::kRound_Cap </strong></code></td><td>1</td><td>Adds a circle with a diameter equal to <a href="bmh_SkPaint_Reference?cl=9919#Stroke_Width">Stroke Width</a> at the beginning
2398and end.</td>
2399 </tr>
2400 <tr>
2401 <td><a name="SkPaint::kSquare_Cap"></a> <code><strong>SkPaint::kSquare_Cap </strong></code></td><td>2</td><td>Adds a square with sides equal to <a href="bmh_SkPaint_Reference?cl=9919#Stroke_Width">Stroke Width</a> at the beginning
2402and end. The square sides are parallel to the initial and final direction
2403of the stroke.</td>
2404 </tr>
2405 <tr>
2406 <td><a name="SkPaint::kLast_Cap"></a> <code><strong>SkPaint::kLast_Cap </strong></code></td><td>2</td><td>Equivalent to the largest value for <a href="bmh_SkPaint_Reference?cl=9919#Stroke_Cap">Stroke Cap</a>.</td>
2407 </tr>
2408 <tr>
2409 <td><a name="SkPaint::kDefault_Cap"></a> <code><strong>SkPaint::kDefault_Cap </strong></code></td><td>0</td><td>Equivalent to <a href="bmh_SkPaint_Reference?cl=9919#kButt_Cap">kButt Cap</a>.
2410<a href="bmh_SkPaint_Reference?cl=9919#Stroke_Cap">Stroke Cap</a> is set to <a href="bmh_SkPaint_Reference?cl=9919#kButt_Cap">kButt Cap</a> by default.</td>
2411 </tr>
2412 <tr>
2413 <td><a name="SkPaint::kCapCount"></a> <code><strong>SkPaint::kCapCount </strong></code></td><td>3</td><td>The number of different <a href="bmh_SkPaint_Reference?cl=9919#Stroke_Cap">Stroke Cap</a> values defined.
2414May be used to verify that <a href="bmh_SkPaint_Reference?cl=9919#Stroke_Cap">Stroke Cap</a> is a legal value.</td>
2415 </tr>
2416
2417Stroke describes the area covered by a pen of <a href="bmh_SkPaint_Reference?cl=9919#Stroke_Width">Stroke Width</a> as it
2418follows the <a href="bmh_SkPath_Reference?cl=9919#Contour">Path Contour</a>, moving parallel to the contours's direction.
2419
2420If the <a href="bmh_SkPath_Reference?cl=9919#Contour">Path Contour</a> is not terminated by <a href="bmh_SkPath_Reference?cl=9919#kClose_Verb">SkPath::kClose Verb</a>, the contour has a
2421visible beginning and end.
2422
2423<a href="bmh_SkPath_Reference?cl=9919#Contour">Path Contour</a> may start and end at the same point; defining <a href="bmh_SkPath_Reference?cl=9919#Zero_Length">Zero Length Contour</a>.
2424
2425<a href="bmh_SkPaint_Reference?cl=9919#kButt_Cap">kButt Cap</a> and <a href="bmh_SkPath_Reference?cl=9919#Zero_Length">Zero Length Contour</a> is not drawn.
2426<a href="bmh_SkPaint_Reference?cl=9919#kRound_Cap">kRound Cap</a> and <a href="bmh_SkPath_Reference?cl=9919#Zero_Length">Zero Length Contour</a> draws a circle of diameter <a href="bmh_SkPaint_Reference?cl=9919#Stroke_Width">Stroke Width</a>
2427at the contour point.
2428<a href="bmh_SkPaint_Reference?cl=9919#kSquare_Cap">kSquare Cap</a> and <a href="bmh_SkPath_Reference?cl=9919#Zero_Length">Zero Length Contour</a> draws an upright square with a side of
2429<a href="bmh_SkPaint_Reference?cl=9919#Stroke_Width">Stroke Width</a> at the contour point.
2430
2431<a href="bmh_SkPaint_Reference?cl=9919#Stroke_Cap">Stroke Cap</a> is <a href="bmh_SkPaint_Reference?cl=9919#kButt_Cap">kButt Cap</a> by default.
2432
2433</table>
2434
2435### Example
2436
2437<div><fiddle-embed name="3d92b449b298b4ce4004cfca6b91cee7"></fiddle-embed></div>
2438
2439<a name="getStrokeCap"></a>
2440## getStrokeCap
2441
2442<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
2443Cap getStrokeCap() const
2444</pre>
2445
2446The geometry drawn at the beginning and end of strokes.
2447
2448### Return Value
2449
2450one of: <a href="bmh_SkPaint_Reference?cl=9919#kButt_Cap">kButt Cap</a>, <a href="bmh_SkPaint_Reference?cl=9919#kRound_Cap">kRound Cap</a>, <a href="bmh_SkPaint_Reference?cl=9919#kSquare_Cap">kSquare Cap</a>
2451
2452### Example
2453
2454<div><fiddle-embed name="aabf9baee8e026fae36fca30e955512b">
2455
2456#### Example Output
2457
2458~~~~
2459kButt_Cap == default stroke cap
2460~~~~
2461
2462</fiddle-embed></div>
2463
2464### See Also
2465
2466<a href="bmh_SkPaint_Reference?cl=9919#Stroke_Cap">Stroke Cap</a> <a href="bmh_SkPaint_Reference?cl=9919#setStrokeCap">setStrokeCap</a>
2467
2468---
2469
2470<a name="setStrokeCap"></a>
2471## setStrokeCap
2472
2473<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
2474void setStrokeCap(Cap cap)
2475</pre>
2476
2477The geometry drawn at the beginning and end of strokes.
2478
2479### Parameters
2480
2481<table> <tr> <td><code><strong>cap </strong></code></td> <td>
2482one of: <a href="bmh_SkPaint_Reference?cl=9919#kButt_Cap">kButt Cap</a>, <a href="bmh_SkPaint_Reference?cl=9919#kRound_Cap">kRound Cap</a>, <a href="bmh_SkPaint_Reference?cl=9919#kSquare_Cap">kSquare Cap</a>;
2483has no effect if <a href="bmh_SkPaint_Reference?cl=9919#setStrokeCap">cap</a> is not valid</td>
2484 </tr>
2485</table>
2486
2487### Example
2488
2489<div><fiddle-embed name="de83fbd848a4625345b4b87a6e55d98a">
2490
2491#### Example Output
2492
2493~~~~
2494kRound_Cap == paint.getStrokeCap()
2495~~~~
2496
2497</fiddle-embed></div>
2498
2499### See Also
2500
2501<a href="bmh_SkPaint_Reference?cl=9919#Stroke_Cap">Stroke Cap</a> <a href="bmh_SkPaint_Reference?cl=9919#getStrokeCap">getStrokeCap</a>
2502
2503---
2504
2505# <a name="Stroke_Join"></a> Stroke Join
2506<a href="bmh_SkPaint_Reference?cl=9919#Stroke_Join">Stroke Join</a> draws at the sharp corners of an open or closed <a href="bmh_SkPath_Reference?cl=9919#Contour">Path Contour</a>.
2507
2508Stroke describes the area covered by a pen of <a href="bmh_SkPaint_Reference?cl=9919#Stroke_Width">Stroke Width</a> as it
2509follows the <a href="bmh_SkPath_Reference?cl=9919#Contour">Path Contour</a>, moving parallel to the contours's direction.
2510
2511If the contour direction changes abruptly, because the tangent direction leading
2512to the end of a curve within the contour does not match the tangent direction of
2513the following curve, the pair of curves meet at <a href="bmh_SkPaint_Reference?cl=9919#Stroke_Join">Stroke Join</a>.
2514
2515### Example
2516
2517<div><fiddle-embed name="4a4e41ed89a57d47eab5d1600c33b0e8"></fiddle-embed></div>
2518
2519## <a name="SkPaint::Join"></a> Enum SkPaint::Join
2520
2521<pre style="padding: 1em 1em 1em 1em;width: 44em; background-color: #f0f0f0">
2522enum <a href="bmh_SkPaint_Reference?cl=9919#Join">Join</a> {
2523<a href="bmh_SkPaint_Reference?cl=9919#kMiter_Join">kMiter Join</a>,
2524<a href="bmh_SkPaint_Reference?cl=9919#kRound_Join">kRound Join</a>,
2525<a href="bmh_SkPaint_Reference?cl=9919#kBevel_Join">kBevel Join</a>,
2526
2527<a href="bmh_SkPaint_Reference?cl=9919#kLast_Join">kLast Join</a> = <a href="bmh_SkPaint_Reference?cl=9919#kBevel_Join">kBevel Join</a>,
2528<a href="bmh_SkPaint_Reference?cl=9919#kDefault_Join">kDefault Join</a> = <a href="bmh_SkPaint_Reference?cl=9919#kMiter_Join">kMiter Join</a>
2529};
2530static constexpr int <a href="bmh_SkPaint_Reference?cl=9919#kJoinCount">kJoinCount</a> = <a href="bmh_SkPaint_Reference?cl=9919#kLast_Join">kLast Join</a> + 1;</pre>
2531
2532<a href="bmh_SkPaint_Reference?cl=9919#Join">Join</a> specifies how corners are drawn when a shape is stroked. The paint's <a href="bmh_SkPaint_Reference?cl=9919#Join">Join</a> setting
2533affects the four corners of a stroked rectangle, and the connected segments in a
2534stroked path.
2535
2536Choose miter join to draw sharp corners. Choose round join to draw a circle with a
2537radius equal to the stroke width on top of the corner. Choose bevel join to minimally
2538connect the thick strokes.
2539
2540The fill path constructed to describe the stroked path respects the join setting but may
2541not contain the actual join. For instance, a fill path constructed with round joins does
2542not necessarily include circles at each connected segment.
2543
2544### Constants
2545
2546<table>
2547 <tr>
2548 <td><a name="SkPaint::kMiter_Join"></a> <code><strong>SkPaint::kMiter_Join </strong></code></td><td>0</td><td>Extends the outside corner to the extent allowed by <a href="bmh_SkPaint_Reference?cl=9919#Miter_Limit">Miter Limit</a>.
2549If the extension exceeds <a href="bmh_SkPaint_Reference?cl=9919#Miter_Limit">Miter Limit</a>, <a href="bmh_SkPaint_Reference?cl=9919#kBevel_Join">kBevel Join</a> is used instead.</td>
2550 </tr>
2551 <tr>
2552 <td><a name="SkPaint::kRound_Join"></a> <code><strong>SkPaint::kRound_Join </strong></code></td><td>1</td><td>Adds a circle with a diameter of <a href="bmh_SkPaint_Reference?cl=9919#Stroke_Width">Stroke Width</a> at the sharp corner.</td>
2553 </tr>
2554 <tr>
2555 <td><a name="SkPaint::kBevel_Join"></a> <code><strong>SkPaint::kBevel_Join </strong></code></td><td>2</td><td>Connects the outside edges of the sharp corner.</td>
2556 </tr>
2557 <tr>
2558 <td><a name="SkPaint::kLast_Join"></a> <code><strong>SkPaint::kLast_Join </strong></code></td><td>2</td><td>Equivalent to the largest value for <a href="bmh_SkPaint_Reference?cl=9919#Stroke_Join">Stroke Join</a>.</td>
2559 </tr>
2560 <tr>
2561 <td><a name="SkPaint::kDefault_Join"></a> <code><strong>SkPaint::kDefault_Join </strong></code></td><td>1</td><td>Equivalent to <a href="bmh_SkPaint_Reference?cl=9919#kMiter_Join">kMiter Join</a>.
2562<a href="bmh_SkPaint_Reference?cl=9919#Stroke_Join">Stroke Join</a> is set to <a href="bmh_SkPaint_Reference?cl=9919#kMiter_Join">kMiter Join</a> by default.</td>
2563 </tr>
2564 <tr>
2565 <td><a name="SkPaint::kJoinCount"></a> <code><strong>SkPaint::kJoinCount </strong></code></td><td>3</td><td>The number of different <a href="bmh_SkPaint_Reference?cl=9919#Stroke_Join">Stroke Join</a> values defined.
2566May be used to verify that <a href="bmh_SkPaint_Reference?cl=9919#Stroke_Join">Stroke Join</a> is a legal value.</td>
2567 </tr>
2568</table>
2569
2570### Example
2571
2572<div><fiddle-embed name="3b1aebacc21c1836a52876b9b0b3905e"></fiddle-embed></div>
2573
2574### See Also
2575
2576<a href="bmh_SkPaint_Reference?cl=9919#setStrokeJoin">setStrokeJoin</a> <a href="bmh_SkPaint_Reference?cl=9919#getStrokeJoin">getStrokeJoin</a> <a href="bmh_SkPaint_Reference?cl=9919#setStrokeMiter">setStrokeMiter</a> <a href="bmh_SkPaint_Reference?cl=9919#getStrokeMiter">getStrokeMiter</a>
2577
2578
2579
2580<a name="getStrokeJoin"></a>
2581## getStrokeJoin
2582
2583<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
2584Join getStrokeJoin() const
2585</pre>
2586
2587The geometry drawn at the corners of strokes.
2588
2589### Return Value
2590
2591one of: <a href="bmh_SkPaint_Reference?cl=9919#kMiter_Join">kMiter Join</a>, <a href="bmh_SkPaint_Reference?cl=9919#kRound_Join">kRound Join</a>, <a href="bmh_SkPaint_Reference?cl=9919#kBevel_Join">kBevel Join</a>
2592
2593### Example
2594
2595<div><fiddle-embed name="31bf751d0a8ddf176b871810820d8199">
2596
2597#### Example Output
2598
2599~~~~
2600kMiter_Join == default stroke join
2601~~~~
2602
2603</fiddle-embed></div>
2604
2605### See Also
2606
2607<a href="bmh_SkPaint_Reference?cl=9919#Stroke_Join">Stroke Join</a> <a href="bmh_SkPaint_Reference?cl=9919#setStrokeJoin">setStrokeJoin</a>
2608
2609---
2610
2611<a name="setStrokeJoin"></a>
2612## setStrokeJoin
2613
2614<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
2615void setStrokeJoin(Join join)
2616</pre>
2617
2618The geometry drawn at the corners of strokes.
2619
2620### Parameters
2621
2622<table> <tr> <td><code><strong>join </strong></code></td> <td>
2623one of: <a href="bmh_SkPaint_Reference?cl=9919#kMiter_Join">kMiter Join</a>, <a href="bmh_SkPaint_Reference?cl=9919#kRound_Join">kRound Join</a>, <a href="bmh_SkPaint_Reference?cl=9919#kBevel_Join">kBevel Join</a>;
2624otherwise, <a href="bmh_SkPaint_Reference?cl=9919#setStrokeJoin">setStrokeJoin</a> has no effect</td>
2625 </tr>
2626</table>
2627
2628### Example
2629
2630<div><fiddle-embed name="48d963ad4286eddf680f9c511eb6da91">
2631
2632#### Example Output
2633
2634~~~~
2635kMiter_Join == paint.getStrokeJoin()
2636~~~~
2637
2638</fiddle-embed></div>
2639
2640### See Also
2641
2642<a href="bmh_SkPaint_Reference?cl=9919#Stroke_Join">Stroke Join</a> <a href="bmh_SkPaint_Reference?cl=9919#getStrokeJoin">getStrokeJoin</a>
2643
2644---
2645
2646### See Also
2647
2648<a href="bmh_SkPaint_Reference?cl=9919#Miter_Limit">Miter Limit</a>
2649
2650# <a name="Fill_Path"></a> Fill Path
2651<a href="bmh_SkPaint_Reference?cl=9919#Fill_Path">Fill Path</a> creates a <a href="bmh_SkPath_Reference?cl=9919#Path">Path</a> by applying the <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a>, followed by the <a href="bmh_SkPaint_Reference?cl=9919#Style_Stroke">Style Stroke</a>.
2652
2653If <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> contains <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a>, <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a> operates on the source <a href="bmh_SkPath_Reference?cl=9919#Path">Path</a>; the result
2654replaces the destination <a href="bmh_SkPath_Reference?cl=9919#Path">Path</a>. Otherwise, the source <a href="bmh_SkPath_Reference?cl=9919#Path">Path</a> is replaces the
2655destination <a href="bmh_SkPath_Reference?cl=9919#Path">Path</a>.
2656
2657Fill <a href="bmh_SkPath_Reference?cl=9919#Path">Path</a> can request the <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a> to restrict to a culling rectangle, but
2658the <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a> is not required to do so.
2659
2660If <a href="bmh_SkPaint_Reference?cl=9919#Style">Style</a> is <a href="bmh_SkPaint_Reference?cl=9919#kStroke_Style">kStroke Style</a> or <a href="bmh_SkPaint_Reference?cl=9919#kStrokeAndFill_Style">kStrokeAndFill Style</a>,
2661and <a href="bmh_SkPaint_Reference?cl=9919#Stroke_Width">Stroke Width</a> is greater than zero, the <a href="bmh_SkPaint_Reference?cl=9919#Stroke_Width">Stroke Width</a>, <a href="bmh_SkPaint_Reference?cl=9919#Stroke_Cap">Stroke Cap</a>, <a href="bmh_SkPaint_Reference?cl=9919#Stroke_Join">Stroke Join</a>,
2662and <a href="bmh_SkPaint_Reference?cl=9919#Miter_Limit">Miter Limit</a> operate on the destination <a href="bmh_SkPath_Reference?cl=9919#Path">Path</a>, replacing it.
2663
2664Fill <a href="bmh_SkPath_Reference?cl=9919#Path">Path</a> can specify the precision used by <a href="bmh_SkPaint_Reference?cl=9919#Stroke_Width">Stroke Width</a> to approximate the stroke geometry.
2665
2666If the <a href="bmh_SkPaint_Reference?cl=9919#Style">Style</a> is <a href="bmh_SkPaint_Reference?cl=9919#kStroke_Style">kStroke Style</a> and the <a href="bmh_SkPaint_Reference?cl=9919#Stroke_Width">Stroke Width</a> is zero, <a href="bmh_SkPaint_Reference?cl=9919#getFillPath">getFillPath</a>
2667returns false since <a href="bmh_SkPaint_Reference?cl=9919#Hairline">Hairline</a> has no filled equivalent.
2668
2669<a name="getFillPath"></a>
2670## getFillPath
2671
2672<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
2673bool getFillPath(const SkPath& src, SkPath* dst, const SkRect* cullRect,
2674 SkScalar resScale = 1) const
2675</pre>
2676
2677The filled equivalent of the stroked path.
2678
2679### Parameters
2680
2681<table> <tr> <td><code><strong>src </strong></code></td> <td>
2682<a href="bmh_SkPath_Reference?cl=9919#Path">Path</a> read to create a filled version</td>
2683 </tr> <tr> <td><code><strong>dst </strong></code></td> <td>
2684resulting <a href="bmh_SkPath_Reference?cl=9919#Path">Path</a>; may be the same as <a href="bmh_SkPaint_Reference?cl=9919#src">src</a>, but may not be nullptr</td>
2685 </tr> <tr> <td><code><strong>cullRect </strong></code></td> <td>
2686optional limit passed to <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a></td>
2687 </tr> <tr> <td><code><strong>resScale </strong></code></td> <td>
2688if > 1, increase precision, else if (0 < res < 1) reduce precision
2689to favor speed and size</td>
2690 </tr>
2691</table>
2692
2693### Return Value
2694
2695true if the path represents <a href="bmh_SkPaint_Reference?cl=9919#Style_Fill">Style Fill</a>, or false if it represents <a href="bmh_SkPaint_Reference?cl=9919#Hairline">Hairline</a>
2696
2697### Example
2698
2699<div><fiddle-embed name="cedd6233848198e1fca4d1e14816baaf"><div>A very small quad stroke is turned into a filled path with increasing levels of precision.
2700At the lowest precision, the quad stroke is approximated by a rectangle.
2701At the highest precision, the filled path has high fidelity compared to the original stroke.</div></fiddle-embed></div>
2702
2703---
2704
2705<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
2706bool getFillPath(const SkPath& src, SkPath* dst) const
2707</pre>
2708
2709The filled equivalent of the stroked path.
2710
2711Replaces <a href="bmh_SkPaint_Reference?cl=9919#dst">dst</a> with the <a href="bmh_SkPaint_Reference?cl=9919#src">src</a> path modified by <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a> and <a href="bmh_SkPaint_Reference?cl=9919#Style_Stroke">Style Stroke</a>.
2712<a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a>, if any, is not culled. <a href="bmh_SkPaint_Reference?cl=9919#Stroke_Width">Stroke Width</a> is created with default precision.
2713
2714### Parameters
2715
2716<table> <tr> <td><code><strong>src </strong></code></td> <td>
2717<a href="bmh_SkPath_Reference?cl=9919#Path">Path</a> read to create a filled version</td>
2718 </tr> <tr> <td><code><strong>dst </strong></code></td> <td>
2719resulting <a href="bmh_SkPath_Reference?cl=9919#Path">Path</a> <a href="bmh_SkPaint_Reference?cl=9919#dst">dst</a> may be the same as <a href="bmh_SkPaint_Reference?cl=9919#src">src</a>, but may not be nullptr</td>
2720 </tr>
2721</table>
2722
2723### Return Value
2724
2725true if the path represents <a href="bmh_SkPaint_Reference?cl=9919#Style_Fill">Style Fill</a>, or false if it represents <a href="bmh_SkPaint_Reference?cl=9919#Hairline">Hairline</a>
2726
2727### Example
2728
2729<div><fiddle-embed name="e6d8ca0cc17e0b475bd54dd995825468"></fiddle-embed></div>
2730
2731---
2732
2733### See Also
2734
2735<a href="bmh_SkPaint_Reference?cl=9919#Style_Stroke">Style Stroke</a> <a href="bmh_SkPaint_Reference?cl=9919#Stroke_Width">Stroke Width</a> <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a>
2736
2737# <a name="Shader_Methods"></a> Shader Methods
2738<a href="bmh_undocumented?cl=9919#Shader">Shader</a> defines the colors used when drawing a shape.
2739<a href="bmh_undocumented?cl=9919#Shader">Shader</a> may be an image, a gradient, or a computed fill.
2740If <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> has no <a href="bmh_undocumented?cl=9919#Shader">Shader</a>, then <a href="bmh_undocumented?cl=9919#Color">Color</a> fills the shape.
2741
2742<a href="bmh_undocumented?cl=9919#Shader">Shader</a> is modulated by <a href="bmh_undocumented?cl=9919#Alpha">Color Alpha</a> component of <a href="bmh_undocumented?cl=9919#Color">Color</a>.
2743If <a href="bmh_undocumented?cl=9919#Shader">Shader</a> object defines only <a href="bmh_undocumented?cl=9919#Alpha">Color Alpha</a>, then <a href="bmh_undocumented?cl=9919#Color">Color</a> modulated by <a href="bmh_undocumented?cl=9919#Alpha">Color Alpha</a> describes
2744the fill.
2745
2746The drawn transparency can be modified without altering <a href="bmh_undocumented?cl=9919#Shader">Shader</a>, by changing <a href="bmh_undocumented?cl=9919#Alpha">Color Alpha</a>.
2747
2748### Example
2749
2750<div><fiddle-embed name="c015dc2010c15e1c00b4f7330232b0f7"></fiddle-embed></div>
2751
2752If <a href="bmh_undocumented?cl=9919#Shader">Shader</a> generates only <a href="bmh_undocumented?cl=9919#Alpha">Color Alpha</a> then all components of <a href="bmh_undocumented?cl=9919#Color">Color</a> modulate the output.
2753
2754### Example
2755
2756<div><fiddle-embed name="9673be7720ba3adcdae42ddc1565b588"></fiddle-embed></div>
2757
2758<a name="getShader"></a>
2759## getShader
2760
2761<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
2762SkShader* getShader() const
2763</pre>
2764
2765Optional colors used when filling a path, such as a gradient.
2766
2767Does not alter <a href="bmh_undocumented?cl=9919#Shader">Shader</a> <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a>.
2768
2769### Return Value
2770
2771<a href="bmh_undocumented?cl=9919#Shader">Shader</a> if previously set, nullptr otherwise
2772
2773### Example
2774
2775<div><fiddle-embed name="09f15b9fd88882850da2d235eb86292f">
2776
2777#### Example Output
2778
2779~~~~
2780nullptr == shader
2781nullptr != shader
2782~~~~
2783
2784</fiddle-embed></div>
2785
2786---
2787
2788<a name="refShader"></a>
2789## refShader
2790
2791<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
2792sk_sp<SkShader> refShader() const
2793</pre>
2794
2795Optional colors used when filling a path, such as a gradient.
2796
2797Increases <a href="bmh_undocumented?cl=9919#Shader">Shader</a> <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a> by one.
2798
2799### Return Value
2800
2801<a href="bmh_undocumented?cl=9919#Shader">Shader</a> if previously set, nullptr otherwise
2802
2803### Example
2804
2805<div><fiddle-embed name="53da0295972a418cbc9607bbb17feaa8">
2806
2807#### Example Output
2808
2809~~~~
2810shader unique: true
2811shader unique: false
2812~~~~
2813
2814</fiddle-embed></div>
2815
2816---
2817
2818<a name="setShader"></a>
2819## setShader
2820
2821<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
2822void setShader(sk_sp<SkShader> shader)
2823</pre>
2824
2825Optional colors used when filling a path, such as a gradient.
2826
2827Sets <a href="bmh_undocumented?cl=9919#Shader">Shader</a> to <a href="bmh_SkPaint_Reference?cl=9919#shader">shader</a>, decrementing <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a> of the previous <a href="bmh_undocumented?cl=9919#Shader">Shader</a>.
2828Does not alter <a href="bmh_SkPaint_Reference?cl=9919#shader">shader</a> <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a>.
2829
2830### Parameters
2831
2832<table> <tr> <td><code><strong>shader </strong></code></td> <td>
2833how geometry is filled with color; if nullptr, <a href="bmh_undocumented?cl=9919#Color">Color</a> is used instead</td>
2834 </tr>
2835</table>
2836
2837### Example
2838
2839<div><fiddle-embed name="77e64d5bae9b1ba037fd99252bb4aa58"></fiddle-embed></div>
2840
2841---
2842
2843# <a name="Color_Filter_Methods"></a> Color Filter Methods
2844<a href="bmh_undocumented?cl=9919#Color_Filter">Color Filter</a> alters the color used when drawing a shape.
2845<a href="bmh_undocumented?cl=9919#Color_Filter">Color Filter</a> may apply <a href="bmh_undocumented?cl=9919#Blend_Mode">Blend Mode</a>, transform the color through a matrix, or composite multiple filters.
2846If <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> has no <a href="bmh_undocumented?cl=9919#Color_Filter">Color Filter</a>, the color is unaltered.
2847
2848The drawn transparency can be modified without altering <a href="bmh_undocumented?cl=9919#Color_Filter">Color Filter</a>, by changing <a href="bmh_undocumented?cl=9919#Alpha">Color Alpha</a>.
2849
2850### Example
2851
2852<div><fiddle-embed name="5abde56ca2f89a18b8e231abd1b57c56"></fiddle-embed></div>
2853
2854<a name="getColorFilter"></a>
2855## getColorFilter
2856
2857<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
2858SkColorFilter* getColorFilter() const
2859</pre>
2860
2861Returns <a href="bmh_undocumented?cl=9919#Color_Filter">Color Filter</a> if set, or nullptr.
2862Does not alter <a href="bmh_undocumented?cl=9919#Color_Filter">Color Filter</a> <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a>.
2863
2864### Return Value
2865
2866<a href="bmh_undocumented?cl=9919#Color_Filter">Color Filter</a> if previously set, nullptr otherwise
2867
2868### Example
2869
2870<div><fiddle-embed name="093bdc627d6b59002670fd290931f6c9">
2871
2872#### Example Output
2873
2874~~~~
2875nullptr == color filter
2876nullptr != color filter
2877~~~~
2878
2879</fiddle-embed></div>
2880
2881---
2882
2883<a name="refColorFilter"></a>
2884## refColorFilter
2885
2886<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
2887sk_sp<SkColorFilter> refColorFilter() const
2888</pre>
2889
2890Returns <a href="bmh_undocumented?cl=9919#Color_Filter">Color Filter</a> if set, or nullptr.
2891Increases <a href="bmh_undocumented?cl=9919#Color_Filter">Color Filter</a> <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a> by one.
2892
2893### Return Value
2894
2895<a href="bmh_undocumented?cl=9919#Color_Filter">Color Filter</a> if set, or nullptr
2896
2897### Example
2898
2899<div><fiddle-embed name="b588c95fa4c86ddbc4b0546762f08297">
2900
2901#### Example Output
2902
2903~~~~
2904color filter unique: true
2905color filter unique: false
2906~~~~
2907
2908</fiddle-embed></div>
2909
2910---
2911
2912<a name="setColorFilter"></a>
2913## setColorFilter
2914
2915<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
2916void setColorFilter(sk_sp<SkColorFilter> colorFilter)
2917</pre>
2918
2919Sets <a href="bmh_undocumented?cl=9919#Color_Filter">Color Filter</a> to filter, decrementing <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a> of the previous <a href="bmh_undocumented?cl=9919#Color_Filter">Color Filter</a>.
2920Pass nullptr to clear <a href="bmh_undocumented?cl=9919#Color_Filter">Color Filter</a>.
2921Does not alter filter <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a>.
2922
2923### Parameters
2924
2925<table> <tr> <td><code><strong>colorFilter </strong></code></td> <td>
2926<a href="bmh_undocumented?cl=9919#Color_Filter">Color Filter</a> to apply to subsequent draw</td>
2927 </tr>
2928</table>
2929
2930### Example
2931
2932<div><fiddle-embed name="c7b786dc9b3501cd0eaba47494b6fa31"></fiddle-embed></div>
2933
2934---
2935
2936# <a name="Blend_Mode_Methods"></a> Blend Mode Methods
2937<a href="bmh_undocumented?cl=9919#Blend_Mode">Blend Mode</a> describes how <a href="bmh_undocumented?cl=9919#Color">Color</a> combines with the destination color.
2938The default setting, <a href="bmh_undocumented?cl=9919#kSrcOver">SkBlendMode::kSrcOver</a>, draws the source color
2939over the destination color.
2940
2941### Example
2942
2943<div><fiddle-embed name="73092d4d06faecea3c204d852a4dd8a8"></fiddle-embed></div>
2944
2945### See Also
2946
2947<a href="bmh_undocumented?cl=9919#Blend_Mode">Blend Mode</a>
2948
2949<a name="getBlendMode"></a>
2950## getBlendMode
2951
2952<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
2953SkBlendMode getBlendMode() const
2954</pre>
2955
2956Returns <a href="bmh_undocumented?cl=9919#Blend_Mode">Blend Mode</a>.
2957By default, <a href="bmh_SkPaint_Reference?cl=9919#getBlendMode">getBlendMode</a> returns <a href="bmh_undocumented?cl=9919#kSrcOver">SkBlendMode::kSrcOver</a>.
2958
2959### Return Value
2960
2961mode used to combine source color with destination color
2962
2963### Example
2964
2965<div><fiddle-embed name="4ec1864b8203d52c0810e8605092f45c">
2966
2967#### Example Output
2968
2969~~~~
2970kSrcOver == getBlendMode
2971kSrcOver != getBlendMode
2972~~~~
2973
2974</fiddle-embed></div>
2975
2976---
2977
2978<a name="isSrcOver"></a>
2979## isSrcOver
2980
2981<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
2982bool isSrcOver() const
2983</pre>
2984
2985Returns true if <a href="bmh_undocumented?cl=9919#Blend_Mode">Blend Mode</a> is <a href="bmh_undocumented?cl=9919#kSrcOver">SkBlendMode::kSrcOver</a>, the default.
2986
2987### Return Value
2988
2989true if <a href="bmh_undocumented?cl=9919#Blend_Mode">Blend Mode</a> is <a href="bmh_undocumented?cl=9919#kSrcOver">SkBlendMode::kSrcOver</a>
2990
2991### Example
2992
2993<div><fiddle-embed name="257c9473db7a2b3a0fb2b9e2431e59a6">
2994
2995#### Example Output
2996
2997~~~~
2998isSrcOver == true
2999isSrcOver != true
3000~~~~
3001
3002</fiddle-embed></div>
3003
3004---
3005
3006<a name="setBlendMode"></a>
3007## setBlendMode
3008
3009<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
3010void setBlendMode(SkBlendMode mode)
3011</pre>
3012
3013Sets <a href="bmh_undocumented?cl=9919#Blend_Mode">Blend Mode</a> to <a href="bmh_SkPaint_Reference?cl=9919#mode">mode</a>.
3014Does not check for valid input.
3015
3016### Parameters
3017
3018<table> <tr> <td><code><strong>mode </strong></code></td> <td>
3019<a href="bmh_undocumented?cl=9919#SkBlendMode">SkBlendMode</a> used to combine source color and destination</td>
3020 </tr>
3021</table>
3022
3023### Example
3024
3025<div><fiddle-embed name="257c9473db7a2b3a0fb2b9e2431e59a6">
3026
3027#### Example Output
3028
3029~~~~
3030isSrcOver == true
3031isSrcOver != true
3032~~~~
3033
3034</fiddle-embed></div>
3035
3036---
3037
3038# <a name="Path_Effect_Methods"></a> Path Effect Methods
3039<a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a> modifies the path geometry before drawing it.
3040<a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a> may implement dashing, custom fill effects and custom stroke effects.
3041If <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> has no <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a>, the path geometry is unaltered when filled or stroked.
3042
3043### Example
3044
3045<div><fiddle-embed name="8cf5684b187d60f09e11c4a48993ea39"></fiddle-embed></div>
3046
3047### See Also
3048
3049<a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a>
3050
3051<a name="getPathEffect"></a>
3052## getPathEffect
3053
3054<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
3055SkPathEffect* getPathEffect() const
3056</pre>
3057
3058Returns <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a> if set, or nullptr.
3059Does not alter <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a> <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a>.
3060
3061### Return Value
3062
3063<a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a> if previously set, nullptr otherwise
3064
3065### Example
3066
3067<div><fiddle-embed name="211a1b14bfa6c4332082c8eab4fbc5fd">
3068
3069#### Example Output
3070
3071~~~~
3072nullptr == path effect
3073nullptr != path effect
3074~~~~
3075
3076</fiddle-embed></div>
3077
3078---
3079
3080<a name="refPathEffect"></a>
3081## refPathEffect
3082
3083<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
3084sk_sp<SkPathEffect> refPathEffect() const
3085</pre>
3086
3087Returns <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a> if set, or nullptr.
3088Increases <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a> <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a> by one.
3089
3090### Return Value
3091
3092<a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a> if previously set, nullptr otherwise
3093
3094### Example
3095
3096<div><fiddle-embed name="c55c74f8f581870bd2c18f2f99765579">
3097
3098#### Example Output
3099
3100~~~~
3101path effect unique: true
3102path effect unique: false
3103~~~~
3104
3105</fiddle-embed></div>
3106
3107---
3108
3109<a name="setPathEffect"></a>
3110## setPathEffect
3111
3112<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
3113void setPathEffect(sk_sp<SkPathEffect> pathEffect)
3114</pre>
3115
3116Sets <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a> to <a href="bmh_SkPaint_Reference?cl=9919#pathEffect">pathEffect</a>,
3117decrementing <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a> of the previous <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a>.
3118Pass nullptr to leave the path geometry unaltered.
3119Does not alter <a href="bmh_SkPaint_Reference?cl=9919#pathEffect">pathEffect</a> <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a>.
3120
3121### Parameters
3122
3123<table> <tr> <td><code><strong>pathEffect </strong></code></td> <td>
3124replace <a href="bmh_SkPath_Reference?cl=9919#Path">Path</a> with a modification when drawn</td>
3125 </tr>
3126</table>
3127
3128### Example
3129
3130<div><fiddle-embed name="52dd55074ca0b7d520d04e750ca2a0d7"></fiddle-embed></div>
3131
3132---
3133
3134# <a name="Mask_Filter_Methods"></a> Mask Filter Methods
3135<a href="bmh_undocumented?cl=9919#Mask_Filter">Mask Filter</a> uses <a href="bmh_undocumented?cl=9919#Alpha">Color Alpha</a> of the shape drawn to create <a href="bmh_undocumented?cl=9919#Mask_Alpha">Mask Alpha</a>.
3136<a href="bmh_undocumented?cl=9919#Mask_Filter">Mask Filter</a> operates at a lower level than <a href="bmh_undocumented?cl=9919#Rasterizer">Rasterizer</a>; <a href="bmh_undocumented?cl=9919#Mask_Filter">Mask Filter</a> takes a <a href="bmh_undocumented?cl=9919#Mask">Mask</a>,
3137and returns a <a href="bmh_undocumented?cl=9919#Mask">Mask</a>.
3138<a href="bmh_undocumented?cl=9919#Mask_Filter">Mask Filter</a> may change the geometry and transparency of the shape, such as creating a blur effect.
3139Set <a href="bmh_undocumented?cl=9919#Mask_Filter">Mask Filter</a> to nullptr to prevent <a href="bmh_undocumented?cl=9919#Mask_Filter">Mask Filter</a> from modifying the draw.
3140
3141### Example
3142
3143<div><fiddle-embed name="320b04ea1e1291d49f1e61994a0410fe"></fiddle-embed></div>
3144
3145<a name="getMaskFilter"></a>
3146## getMaskFilter
3147
3148<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
3149SkMaskFilter* getMaskFilter() const
3150</pre>
3151
3152Returns <a href="bmh_undocumented?cl=9919#Mask_Filter">Mask Filter</a> if set, or nullptr.
3153Does not alter <a href="bmh_undocumented?cl=9919#Mask_Filter">Mask Filter</a> <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a>.
3154
3155### Return Value
3156
3157<a href="bmh_undocumented?cl=9919#Mask_Filter">Mask Filter</a> if previously set, nullptr otherwise
3158
3159### Example
3160
3161<div><fiddle-embed name="8cd53ece8fc83e4560599ace094b0f16">
3162
3163#### Example Output
3164
3165~~~~
3166nullptr == mask filter
3167nullptr != mask filter
3168~~~~
3169
3170</fiddle-embed></div>
3171
3172---
3173
3174<a name="refMaskFilter"></a>
3175## refMaskFilter
3176
3177<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
3178sk_sp<SkMaskFilter> refMaskFilter() const
3179</pre>
3180
3181Returns <a href="bmh_undocumented?cl=9919#Mask_Filter">Mask Filter</a> if set, or nullptr.
3182Increases <a href="bmh_undocumented?cl=9919#Mask_Filter">Mask Filter</a> <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a> by one.
3183
3184### Return Value
3185
3186<a href="bmh_undocumented?cl=9919#Mask_Filter">Mask Filter</a> if previously set, nullptr otherwise
3187
3188### Example
3189
3190<div><fiddle-embed name="35a397dce5d44658ee4e9e9dfb9fee22">
3191
3192#### Example Output
3193
3194~~~~
3195mask filter unique: true
3196mask filter unique: false
3197~~~~
3198
3199</fiddle-embed></div>
3200
3201---
3202
3203<a name="setMaskFilter"></a>
3204## setMaskFilter
3205
3206<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
3207void setMaskFilter(sk_sp<SkMaskFilter> maskFilter)
3208</pre>
3209
3210Sets <a href="bmh_undocumented?cl=9919#Mask_Filter">Mask Filter</a> to <a href="bmh_SkPaint_Reference?cl=9919#maskFilter">maskFilter</a>,
3211decrementing <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a> of the previous <a href="bmh_undocumented?cl=9919#Mask_Filter">Mask Filter</a>.
3212Pass nullptr to clear <a href="bmh_undocumented?cl=9919#Mask_Filter">Mask Filter</a> and leave <a href="bmh_undocumented?cl=9919#Mask_Filter">Mask Filter</a> effect on <a href="bmh_undocumented?cl=9919#Mask_Alpha">Mask Alpha</a> unaltered.
3213Does not affect <a href="bmh_undocumented?cl=9919#Rasterizer">Rasterizer</a>.
3214Does not alter <a href="bmh_SkPaint_Reference?cl=9919#maskFilter">maskFilter</a> <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a>.
3215
3216### Parameters
3217
3218<table> <tr> <td><code><strong>maskFilter </strong></code></td> <td>
3219modifies clipping mask generated from drawn geometry</td>
3220 </tr>
3221</table>
3222
3223### Example
3224
3225<div><fiddle-embed name="62c5a826692f85c3de3bab65e9e97aa9"></fiddle-embed></div>
3226
3227---
3228
3229# <a name="Typeface_Methods"></a> Typeface Methods
3230<a href="bmh_undocumented?cl=9919#Typeface">Typeface</a> identifies the font used when drawing and measuring text.
3231<a href="bmh_undocumented?cl=9919#Typeface">Typeface</a> may be specified by name, from a file, or from a data stream.
3232The default <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a> defers to the platform-specific default font
3233implementation.
3234
3235### Example
3236
3237<div><fiddle-embed name="c18b1696b8c1649bebf7eb1f8b89e0b0"></fiddle-embed></div>
3238
3239<a name="getTypeface"></a>
3240## getTypeface
3241
3242<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
3243SkTypeface* getTypeface() const
3244</pre>
3245
3246Returns <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a> if set, or nullptr.
3247Does not alter <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a> <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a>.
3248
3249### Return Value
3250
3251<a href="bmh_undocumented?cl=9919#Typeface">Typeface</a> if previously set, nullptr otherwise
3252
3253### Example
3254
3255<div><fiddle-embed name="4d9ffb5761b62a9e3bc9b0bca8787bce">
3256
3257#### Example Output
3258
3259~~~~
3260nullptr == typeface
3261nullptr != typeface
3262~~~~
3263
3264</fiddle-embed></div>
3265
3266---
3267
3268<a name="refTypeface"></a>
3269## refTypeface
3270
3271<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
3272sk_sp<SkTypeface> refTypeface() const
3273</pre>
3274
3275Increases <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a> <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a> by one.
3276
3277### Return Value
3278
3279<a href="bmh_undocumented?cl=9919#Typeface">Typeface</a> if previously set, nullptr otherwise
3280
3281### Example
3282
3283<div><fiddle-embed name="c8edce7b36a3ffda8af4fe89d7187dbc">
3284
3285#### Example Output
3286
3287~~~~
3288typeface1 != typeface2
3289typeface1 == typeface2
3290~~~~
3291
3292</fiddle-embed></div>
3293
3294---
3295
3296<a name="setTypeface"></a>
3297## setTypeface
3298
3299<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
3300void setTypeface(sk_sp<SkTypeface> typeface)
3301</pre>
3302
3303Sets <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a> to <a href="bmh_SkPaint_Reference?cl=9919#typeface">typeface</a>,
3304decrementing <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a> of the previous <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a>.
3305Pass nullptr to clear <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a> and use the default <a href="bmh_SkPaint_Reference?cl=9919#typeface">typeface</a>.
3306Does not alter <a href="bmh_SkPaint_Reference?cl=9919#typeface">typeface</a> <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a>.
3307
3308### Parameters
3309
3310<table> <tr> <td><code><strong>typeface </strong></code></td> <td>
3311font and style used to draw text</td>
3312 </tr>
3313</table>
3314
3315### Example
3316
3317<div><fiddle-embed name="3d2656ec4c555ed2c7ec086720124a2a"></fiddle-embed></div>
3318
3319---
3320
3321# <a name="Rasterizer_Methods"></a> Rasterizer Methods
3322<a href="bmh_undocumented?cl=9919#Rasterizer">Rasterizer</a> controls how shapes are converted to <a href="bmh_undocumented?cl=9919#Mask_Alpha">Mask Alpha</a>.
3323<a href="bmh_undocumented?cl=9919#Rasterizer">Rasterizer</a> operates at a higher level than <a href="bmh_undocumented?cl=9919#Mask_Filter">Mask Filter</a>; <a href="bmh_undocumented?cl=9919#Rasterizer">Rasterizer</a> takes a <a href="bmh_SkPath_Reference?cl=9919#Path">Path</a>,
3324and returns a <a href="bmh_undocumented?cl=9919#Mask">Mask</a>.
3325<a href="bmh_undocumented?cl=9919#Rasterizer">Rasterizer</a> may change the geometry and transparency of the shape, such as
3326creating a shadow effect. <a href="bmh_undocumented?cl=9919#Rasterizer">Rasterizer</a> forms the base of <a href="bmh_undocumented?cl=9919#Layer">Rasterizer Layer</a>, which
3327creates effects like embossing and outlining.
3328<a href="bmh_undocumented?cl=9919#Rasterizer">Rasterizer</a> applies to <a href="bmh_undocumented?cl=9919#Rect">Rect</a>, <a href="bmh_undocumented?cl=9919#Region">Region</a>, <a href="bmh_undocumented?cl=9919#Round_Rect">Round Rect</a>, <a href="bmh_undocumented?cl=9919#Arc">Arc</a>, <a href="bmh_undocumented?cl=9919#Circle">Circle</a>, <a href="bmh_undocumented?cl=9919#Oval">Oval</a>,
3329<a href="bmh_SkPath_Reference?cl=9919#Path">Path</a>, and <a href="bmh_undocumented?cl=9919#Text">Text</a>.
3330
3331### Example
3332
3333<div><fiddle-embed name="e63f8a50996699342a14c6e54d684108"></fiddle-embed></div>
3334
3335<a name="getRasterizer"></a>
3336## getRasterizer
3337
3338<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
3339SkRasterizer* getRasterizer() const
3340</pre>
3341
3342Returns <a href="bmh_undocumented?cl=9919#Rasterizer">Rasterizer</a> if set, or nullptr.
3343Does not alter <a href="bmh_undocumented?cl=9919#Rasterizer">Rasterizer</a> <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a>.
3344
3345### Return Value
3346
3347<a href="bmh_undocumented?cl=9919#Rasterizer">Rasterizer</a> if previously set, nullptr otherwise
3348
3349### Example
3350
3351<div><fiddle-embed name="0707d407c3a14388b107af8ae5873e55">
3352
3353#### Example Output
3354
3355~~~~
3356nullptr == rasterizer
3357nullptr != rasterizer
3358~~~~
3359
3360</fiddle-embed></div>
3361
3362---
3363
3364<a name="refRasterizer"></a>
3365## refRasterizer
3366
3367<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
3368sk_sp<SkRasterizer> refRasterizer() const
3369</pre>
3370
3371Returns <a href="bmh_undocumented?cl=9919#Rasterizer">Rasterizer</a> if set, or nullptr.
3372Increases <a href="bmh_undocumented?cl=9919#Rasterizer">Rasterizer</a> <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a> by one.
3373
3374### Return Value
3375
3376<a href="bmh_undocumented?cl=9919#Rasterizer">Rasterizer</a> if previously set, nullptr otherwise
3377
3378### Example
3379
3380<div><fiddle-embed name="c0855ce19a33cb7e5747750ef341b7b3">
3381
3382#### Example Output
3383
3384~~~~
3385rasterizer unique: true
3386rasterizer unique: false
3387~~~~
3388
3389</fiddle-embed></div>
3390
3391---
3392
3393<a name="setRasterizer"></a>
3394## setRasterizer
3395
3396<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
3397void setRasterizer(sk_sp<SkRasterizer> rasterizer)
3398</pre>
3399
3400Sets <a href="bmh_undocumented?cl=9919#Rasterizer">Rasterizer</a> to <a href="bmh_SkPaint_Reference?cl=9919#rasterizer">rasterizer</a>,
3401decrementing <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a> of the previous <a href="bmh_undocumented?cl=9919#Rasterizer">Rasterizer</a>.
3402Pass nullptr to clear <a href="bmh_undocumented?cl=9919#Rasterizer">Rasterizer</a> and leave <a href="bmh_undocumented?cl=9919#Rasterizer">Rasterizer</a> effect on <a href="bmh_undocumented?cl=9919#Mask_Alpha">Mask Alpha</a> unaltered.
3403Does not affect <a href="bmh_undocumented?cl=9919#Mask_Filter">Mask Filter</a>.
3404Does not alter <a href="bmh_SkPaint_Reference?cl=9919#rasterizer">rasterizer</a> <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a>.
3405
3406### Parameters
3407
3408<table> <tr> <td><code><strong>rasterizer </strong></code></td> <td>
3409how geometry is converted to <a href="bmh_undocumented?cl=9919#Mask_Alpha">Mask Alpha</a></td>
3410 </tr>
3411</table>
3412
3413### Example
3414
3415<div><fiddle-embed name="aec8ed9296c1628073086a33039f62b7"></fiddle-embed></div>
3416
3417---
3418
3419# <a name="Image_Filter_Methods"></a> Image Filter Methods
3420<a href="bmh_undocumented?cl=9919#Image_Filter">Image Filter</a> operates on the pixel representation of the shape, as modified by <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a>
3421with <a href="bmh_undocumented?cl=9919#Blend_Mode">Blend Mode</a> set to <a href="bmh_undocumented?cl=9919#kSrcOver">SkBlendMode::kSrcOver</a>. <a href="bmh_undocumented?cl=9919#Image_Filter">Image Filter</a> creates a new bitmap,
3422which is drawn to the device using the set <a href="bmh_undocumented?cl=9919#Blend_Mode">Blend Mode</a>.
3423<a href="bmh_undocumented?cl=9919#Image_Filter">Image Filter</a> is higher level than <a href="bmh_undocumented?cl=9919#Mask_Filter">Mask Filter</a>; for instance, an <a href="bmh_undocumented?cl=9919#Image_Filter">Image Filter</a>
3424can operate on all channels of <a href="bmh_undocumented?cl=9919#Color">Color</a>, while <a href="bmh_undocumented?cl=9919#Mask_Filter">Mask Filter</a> generates <a href="bmh_undocumented?cl=9919#Alpha">Color Alpha</a> only.
3425<a href="bmh_undocumented?cl=9919#Image_Filter">Image Filter</a> operates independently of and can be used in combination with
3426<a href="bmh_undocumented?cl=9919#Mask_Filter">Mask Filter</a> and <a href="bmh_undocumented?cl=9919#Rasterizer">Rasterizer</a>.
3427
3428### Example
3429
3430<div><fiddle-embed name="88804938b49eb4f7c7f01ad52f4db0d8"></fiddle-embed></div>
3431
3432<a name="getImageFilter"></a>
3433## getImageFilter
3434
3435<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
3436SkImageFilter* getImageFilter() const
3437</pre>
3438
3439Returns <a href="bmh_undocumented?cl=9919#Image_Filter">Image Filter</a> if set, or nullptr.
3440Does not alter <a href="bmh_undocumented?cl=9919#Image_Filter">Image Filter</a> <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a>.
3441
3442### Return Value
3443
3444<a href="bmh_undocumented?cl=9919#Image_Filter">Image Filter</a> if previously set, nullptr otherwise
3445
3446### Example
3447
3448<div><fiddle-embed name="38788d42772641606e08c60d9dd418a2">
3449
3450#### Example Output
3451
3452~~~~
3453nullptr == image filter
3454nullptr != image filter
3455~~~~
3456
3457</fiddle-embed></div>
3458
3459---
3460
3461<a name="refImageFilter"></a>
3462## refImageFilter
3463
3464<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
3465sk_sp<SkImageFilter> refImageFilter() const
3466</pre>
3467
3468Returns <a href="bmh_undocumented?cl=9919#Image_Filter">Image Filter</a> if set, or nullptr.
3469Increases <a href="bmh_undocumented?cl=9919#Image_Filter">Image Filter</a> <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a> by one.
3470
3471### Return Value
3472
3473<a href="bmh_undocumented?cl=9919#Image_Filter">Image Filter</a> if previously set, nullptr otherwise
3474
3475### Example
3476
3477<div><fiddle-embed name="13f09088b569251547107d14ae989dc1">
3478
3479#### Example Output
3480
3481~~~~
3482image filter unique: true
3483image filter unique: false
3484~~~~
3485
3486</fiddle-embed></div>
3487
3488---
3489
3490<a name="setImageFilter"></a>
3491## setImageFilter
3492
3493<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
3494void setImageFilter(sk_sp<SkImageFilter> imageFilter)
3495</pre>
3496
3497Sets <a href="bmh_undocumented?cl=9919#Image_Filter">Image Filter</a> to <a href="bmh_SkPaint_Reference?cl=9919#imageFilter">imageFilter</a>,
3498decrementing <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a> of the previous <a href="bmh_undocumented?cl=9919#Image_Filter">Image Filter</a>.
3499Pass nullptr to clear <a href="bmh_undocumented?cl=9919#Image_Filter">Image Filter</a>, and remove <a href="bmh_undocumented?cl=9919#Image_Filter">Image Filter</a> effect
3500on drawing.
3501Does not affect <a href="bmh_undocumented?cl=9919#Rasterizer">Rasterizer</a> or <a href="bmh_undocumented?cl=9919#Mask_Filter">Mask Filter</a>.
3502Does not alter <a href="bmh_SkPaint_Reference?cl=9919#imageFilter">imageFilter</a> <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a>.
3503
3504### Parameters
3505
3506<table> <tr> <td><code><strong>imageFilter </strong></code></td> <td>
3507how <a href="bmh_undocumented?cl=9919#Image">Image</a> is sampled when transformed</td>
3508 </tr>
3509</table>
3510
3511### Example
3512
3513<div><fiddle-embed name="6679d6e4ec632715ee03e68391bd7f9a"></fiddle-embed></div>
3514
3515---
3516
3517# <a name="Draw_Looper_Methods"></a> Draw Looper Methods
3518<a href="bmh_undocumented?cl=9919#Draw_Looper">Draw Looper</a> sets a modifier that communicates state from one <a href="bmh_undocumented?cl=9919#Draw_Layer">Draw Layer</a>
3519to another to construct the draw.
3520<a href="bmh_undocumented?cl=9919#Draw_Looper">Draw Looper</a> draws one or more times, modifying the canvas and paint each time.
3521<a href="bmh_undocumented?cl=9919#Draw_Looper">Draw Looper</a> may be used to draw multiple colors or create a colored shadow.
3522Set <a href="bmh_undocumented?cl=9919#Draw_Looper">Draw Looper</a> to nullptr to prevent <a href="bmh_undocumented?cl=9919#Draw_Looper">Draw Looper</a> from modifying the draw.
3523
3524### Example
3525
3526<div><fiddle-embed name="84ec12a36e50df5ac565cc7a75ffbe9f"></fiddle-embed></div>
3527
3528<a name="getDrawLooper"></a>
3529## getDrawLooper
3530
3531<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
3532SkDrawLooper* getDrawLooper() const
3533</pre>
3534
3535Returns <a href="bmh_undocumented?cl=9919#Draw_Looper">Draw Looper</a> if set, or nullptr.
3536Does not alter <a href="bmh_undocumented?cl=9919#Draw_Looper">Draw Looper</a> <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a>.
3537
3538### Return Value
3539
3540<a href="bmh_undocumented?cl=9919#Draw_Looper">Draw Looper</a> if previously set, nullptr otherwise
3541
3542### Example
3543
3544<div><fiddle-embed name="af4c5acc7a91e7f23c2af48018903ad4">
3545
3546#### Example Output
3547
3548~~~~
3549nullptr == draw looper
3550nullptr != draw looper
3551~~~~
3552
3553</fiddle-embed></div>
3554
3555---
3556
3557<a name="refDrawLooper"></a>
3558## refDrawLooper
3559
3560<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
3561sk_sp<SkDrawLooper> refDrawLooper() const
3562</pre>
3563
3564Returns <a href="bmh_undocumented?cl=9919#Draw_Looper">Draw Looper</a> if set, or nullptr.
3565Increases <a href="bmh_undocumented?cl=9919#Draw_Looper">Draw Looper</a> <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a> by one.
3566
3567### Return Value
3568
3569<a href="bmh_undocumented?cl=9919#Draw_Looper">Draw Looper</a> if previously set, nullptr otherwise
3570
3571### Example
3572
3573<div><fiddle-embed name="2a3782c33f04ed17a725d0e449c6f7c3">
3574
3575#### Example Output
3576
3577~~~~
3578draw looper unique: true
3579draw looper unique: false
3580~~~~
3581
3582</fiddle-embed></div>
3583
3584---
3585
3586<a name="getLooper"></a>
3587## getLooper
3588
3589<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
3590SkDrawLooper* getLooper() const
3591</pre>
3592
3593Deprecated.
3594
3595(see bug.skia.org/6259)
3596
3597### Return Value
3598
3599<a href="bmh_undocumented?cl=9919#Draw_Looper">Draw Looper</a> if previously set, nullptr otherwise
3600
3601---
3602
3603<a name="setDrawLooper"></a>
3604## setDrawLooper
3605
3606<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
3607void setDrawLooper(sk_sp<SkDrawLooper> drawLooper)
3608</pre>
3609
3610Sets <a href="bmh_undocumented?cl=9919#Draw_Looper">Draw Looper</a> to <a href="bmh_SkPaint_Reference?cl=9919#drawLooper">drawLooper</a>,
3611decrementing <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a> of the previous <a href="bmh_SkPaint_Reference?cl=9919#drawLooper">drawLooper</a>.
3612Pass nullptr to clear <a href="bmh_undocumented?cl=9919#Draw_Looper">Draw Looper</a> and leave <a href="bmh_undocumented?cl=9919#Draw_Looper">Draw Looper</a> effect on drawing unaltered.
3613<a href="bmh_SkPaint_Reference?cl=9919#setDrawLooper">setDrawLooper</a> does not alter <a href="bmh_SkPaint_Reference?cl=9919#drawLooper">drawLooper</a> <a href="bmh_undocumented?cl=9919#Reference_Count">Reference Count</a>.
3614
3615### Parameters
3616
3617<table> <tr> <td><code><strong>drawLooper </strong></code></td> <td>
3618Iterates through drawing one or more time, altering <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a></td>
3619 </tr>
3620</table>
3621
3622### Example
3623
3624<div><fiddle-embed name="bf10f838b330f0a3a3266d42ea68a638"></fiddle-embed></div>
3625
3626---
3627
3628<a name="setLooper"></a>
3629## setLooper
3630
3631<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
3632void setLooper(sk_sp<SkDrawLooper> drawLooper)
3633</pre>
3634
3635Deprecated.
3636
3637(see bug.skia.org/6259)
3638
3639### Parameters
3640
3641<table> <tr> <td><code><strong>drawLooper </strong></code></td> <td>
3642sets <a href="bmh_undocumented?cl=9919#Draw_Looper">Draw Looper</a> to <a href="bmh_SkPaint_Reference?cl=9919#drawLooper">drawLooper</a></td>
3643 </tr>
3644
3645---
3646
3647</table>
3648
3649# <a name="Text_Align"></a> Text Align
3650
3651## <a name="SkPaint::Align"></a> Enum SkPaint::Align
3652
3653<pre style="padding: 1em 1em 1em 1em;width: 44em; background-color: #f0f0f0">
3654enum <a href="bmh_SkPaint_Reference?cl=9919#Align">Align</a> {
3655<a href="bmh_SkPaint_Reference?cl=9919#kLeft_Align">kLeft Align</a>,
3656<a href="bmh_SkPaint_Reference?cl=9919#kCenter_Align">kCenter Align</a>,
3657<a href="bmh_SkPaint_Reference?cl=9919#kRight_Align">kRight Align</a>,
3658};</pre>
3659
3660<a href="bmh_SkPaint_Reference?cl=9919#Align">Align</a> adjusts the text relative to the text position.
3661<a href="bmh_SkPaint_Reference?cl=9919#Align">Align</a> affects glyphs drawn with: <a href="bmh_SkCanvas_Reference?cl=9919#drawText">SkCanvas::drawText</a>, <a href="bmh_SkCanvas_Reference?cl=9919#drawPosText">SkCanvas::drawPosText</a>,
3662<a href="bmh_SkCanvas_Reference?cl=9919#drawPosTextH">SkCanvas::drawPosTextH</a>, <a href="bmh_SkCanvas_Reference?cl=9919#drawTextOnPath">SkCanvas::drawTextOnPath</a>,
3663<a href="bmh_SkCanvas_Reference?cl=9919#drawTextOnPathHV">SkCanvas::drawTextOnPathHV</a>, <a href="bmh_SkCanvas_Reference?cl=9919#drawTextRSXform">SkCanvas::drawTextRSXform</a>, <a href="bmh_SkCanvas_Reference?cl=9919#drawTextBlob">SkCanvas::drawTextBlob</a>,
3664and <a href="bmh_SkCanvas_Reference?cl=9919#drawString">SkCanvas::drawString</a>;
3665as well as calls that place text glyphs like <a href="bmh_SkPaint_Reference?cl=9919#getTextWidths">getTextWidths</a> and <a href="bmh_SkPaint_Reference?cl=9919#getTextPath">getTextPath</a>.
3666
3667The text position is set by the font for both horizontal and vertical text.
3668Typically, for horizontal text, the position is to the left side of the glyph on the
3669base line; and for vertical text, the position is the horizontal center of the glyph
3670at the caps height.
3671
3672<a href="bmh_SkPaint_Reference?cl=9919#Align">Align</a> adjusts the glyph position to center it or move it to abut the position
3673using the metrics returned by the font.
3674
3675<a href="bmh_SkPaint_Reference?cl=9919#Align">Align</a> defaults to <a href="bmh_SkPaint_Reference?cl=9919#kLeft_Align">kLeft Align</a>.
3676
3677### Constants
3678
3679<table>
3680 <tr>
3681 <td><a name="SkPaint::kLeft_Align"></a> <code><strong>SkPaint::kLeft_Align </strong></code></td><td>0</td><td>Leaves the glyph at the position computed by the font offset by the text position.</td>
3682 </tr>
3683 <tr>
3684 <td><a name="SkPaint::kCenter_Align"></a> <code><strong>SkPaint::kCenter_Align </strong></code></td><td>1</td><td>Moves the glyph half its width if <a href="bmh_SkPaint_Reference?cl=9919#Flags">Flags</a> has <a href="bmh_SkPaint_Reference?cl=9919#kVerticalText_Flag">kVerticalText Flag</a> clear, and
3685half its height if <a href="bmh_SkPaint_Reference?cl=9919#Flags">Flags</a> has <a href="bmh_SkPaint_Reference?cl=9919#kVerticalText_Flag">kVerticalText Flag</a> set.</td>
3686 </tr>
3687 <tr>
3688 <td><a name="SkPaint::kRight_Align"></a> <code><strong>SkPaint::kRight_Align </strong></code></td><td>2</td><td>Moves the glyph by its width if <a href="bmh_SkPaint_Reference?cl=9919#Flags">Flags</a> has <a href="bmh_SkPaint_Reference?cl=9919#kVerticalText_Flag">kVerticalText Flag</a> clear,
3689and by its height if <a href="bmh_SkPaint_Reference?cl=9919#Flags">Flags</a> has <a href="bmh_SkPaint_Reference?cl=9919#kVerticalText_Flag">kVerticalText Flag</a> set.</td>
3690 </tr>
3691
3692</table>
3693
3694## <a name="SkPaint::_anonymous_2"></a> Enum SkPaint::_anonymous_2
3695
3696<pre style="padding: 1em 1em 1em 1em;width: 44em; background-color: #f0f0f0">
3697enum {
3698<a href="bmh_SkPaint_Reference?cl=9919#kAlignCount">kAlignCount</a> = 3
3699};</pre>
3700
3701### Constants
3702
3703<table>
3704 <tr>
3705 <td><a name="SkPaint::kAlignCount"></a> <code><strong>SkPaint::kAlignCount </strong></code></td><td>3</td><td>The number of different <a href="bmh_SkPaint_Reference?cl=9919#Text_Align">Text Align</a> values defined.</td>
3706 </tr>
3707
3708</table>
3709
3710### Example
3711
3712<div><fiddle-embed name="702617fd9ebc3f12e30081b5db93e8a8"><div>Each position separately moves the glyph in drawPosText.</div></fiddle-embed></div>
3713
3714### Example
3715
3716<div><fiddle-embed name="f1cbbbafe6b3c52b81309cccbf96a308"><div><a href="bmh_SkPaint_Reference?cl=9919#Vertical_Text">Vertical Text</a> treats <a href="bmh_SkPaint_Reference?cl=9919#kLeft_Align">kLeft Align</a> as top align, and <a href="bmh_SkPaint_Reference?cl=9919#kRight_Align">kRight Align</a> as bottom align.</div></fiddle-embed></div>
3717
3718<a name="getTextAlign"></a>
3719## getTextAlign
3720
3721<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
3722Align getTextAlign() const
3723</pre>
3724
3725Returns <a href="bmh_SkPaint_Reference?cl=9919#Text_Align">Text Align</a>.
3726Returns <a href="bmh_SkPaint_Reference?cl=9919#kLeft_Align">kLeft Align</a> if <a href="bmh_SkPaint_Reference?cl=9919#Text_Align">Text Align</a> has not been set.
3727
3728### Return Value
3729
3730text placement relative to position
3731
3732### Example
3733
3734<div><fiddle-embed name="2df932f526e810f74c89d30ec3f4c947">
3735
3736#### Example Output
3737
3738~~~~
3739kLeft_Align == default
3740~~~~
3741
3742</fiddle-embed></div>
3743
3744---
3745
3746<a name="setTextAlign"></a>
3747## setTextAlign
3748
3749<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
3750void setTextAlign(Align align)
3751</pre>
3752
3753Sets <a href="bmh_SkPaint_Reference?cl=9919#Text_Align">Text Align</a> to <a href="bmh_SkPaint_Reference?cl=9919#align">align</a>.
3754Has no effect if <a href="bmh_SkPaint_Reference?cl=9919#align">align</a> is an invalid value.
3755
3756### Parameters
3757
3758<table> <tr> <td><code><strong>align </strong></code></td> <td>
3759text placement relative to position</td>
3760 </tr>
3761</table>
3762
3763### Example
3764
3765<div><fiddle-embed name="d37540afd918506ac2594665ca63979b"><div><a href="bmh_undocumented?cl=9919#Text">Text</a> is left-aligned by default, and then set to center. Setting the
3766alignment out of range has no effect.</div></fiddle-embed></div>
3767
3768---
3769
3770# <a name="Text_Size"></a> Text Size
3771<a href="bmh_SkPaint_Reference?cl=9919#Text_Size">Text Size</a> adjusts the overall text size in points.
3772<a href="bmh_SkPaint_Reference?cl=9919#Text_Size">Text Size</a> can be set to any positive value or zero.
3773<a href="bmh_SkPaint_Reference?cl=9919#Text_Size">Text Size</a> defaults to 12.
3774Set <a href="bmh_undocumented?cl=9919#SkPaintDefaults_TextSize">SkPaintDefaults TextSize</a> at compile time to change the default setting.
3775
3776### Example
3777
3778<div><fiddle-embed name="91c9a3e498bb9412e4522a95d076ed5f"></fiddle-embed></div>
3779
3780<a name="getTextSize"></a>
3781## getTextSize
3782
3783<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
3784SkScalar getTextSize() const
3785</pre>
3786
3787Returns <a href="bmh_SkPaint_Reference?cl=9919#Text_Size">Text Size</a> in points.
3788
3789### Return Value
3790
3791typographic height of text
3792
3793### Example
3794
3795<div><fiddle-embed name="983e2a71ba72d4ba8c945420040b8f1c"></fiddle-embed></div>
3796
3797---
3798
3799<a name="setTextSize"></a>
3800## setTextSize
3801
3802<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
3803void setTextSize(SkScalar textSize)
3804</pre>
3805
3806Sets <a href="bmh_SkPaint_Reference?cl=9919#Text_Size">Text Size</a> in points.
3807Has no effect if <a href="bmh_SkPaint_Reference?cl=9919#textSize">textSize</a> is not greater than or equal to zero.
3808
3809### Parameters
3810
3811<table> <tr> <td><code><strong>textSize </strong></code></td> <td>
3812typographic height of text</td>
3813 </tr>
3814</table>
3815
3816### Example
3817
3818<div><fiddle-embed name="6510c9e2f57b83c47e67829e7a68d493"></fiddle-embed></div>
3819
3820---
3821
3822# <a name="Text_Scale_X"></a> Text Scale X
3823<a href="bmh_SkPaint_Reference?cl=9919#Text_Scale_X">Text Scale X</a> adjusts the text horizontal scale.
3824<a href="bmh_undocumented?cl=9919#Text">Text</a> scaling approximates condensed and expanded type faces when the actual face
3825is not available.
3826<a href="bmh_SkPaint_Reference?cl=9919#Text_Scale_X">Text Scale X</a> can be set to any value.
3827<a href="bmh_SkPaint_Reference?cl=9919#Text_Scale_X">Text Scale X</a> defaults to 1.
3828
3829### Example
3830
3831<div><fiddle-embed name="d13d787c1e36f515319fc998411c1d91"></fiddle-embed></div>
3832
3833<a name="getTextScaleX"></a>
3834## getTextScaleX
3835
3836<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
3837SkScalar getTextScaleX() const
3838</pre>
3839
3840Returns <a href="bmh_SkPaint_Reference?cl=9919#Text_Scale_X">Text Scale X</a>.
3841Default value is 1.
3842
3843### Return Value
3844
3845text horizontal scale
3846
3847### Example
3848
3849<div><fiddle-embed name="5dc8e58f6910cb8e4de9ed60f888188b"></fiddle-embed></div>
3850
3851---
3852
3853<a name="setTextScaleX"></a>
3854## setTextScaleX
3855
3856<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
3857void setTextScaleX(SkScalar scaleX)
3858</pre>
3859
3860Sets <a href="bmh_SkPaint_Reference?cl=9919#Text_Scale_X">Text Scale X</a>.
3861Default value is 1.
3862
3863### Parameters
3864
3865<table> <tr> <td><code><strong>scaleX </strong></code></td> <td>
3866text horizontal scale</td>
3867 </tr>
3868</table>
3869
3870### Example
3871
3872<div><fiddle-embed name="a75bbdb8bb866b125c4c1dd5e967d470"></fiddle-embed></div>
3873
3874---
3875
3876# <a name="Text_Skew_X"></a> Text Skew X
3877<a href="bmh_SkPaint_Reference?cl=9919#Text_Skew_X">Text Skew X</a> adjusts the text horizontal slant.
3878<a href="bmh_undocumented?cl=9919#Text">Text</a> skewing approximates italic and oblique type faces when the actual face
3879is not available.
3880<a href="bmh_SkPaint_Reference?cl=9919#Text_Skew_X">Text Skew X</a> can be set to any value.
3881<a href="bmh_SkPaint_Reference?cl=9919#Text_Skew_X">Text Skew X</a> defaults to 0.
3882
3883### Example
3884
3885<div><fiddle-embed name="aff208b0aab265f273045b27e683c17c"></fiddle-embed></div>
3886
3887<a name="getTextSkewX"></a>
3888## getTextSkewX
3889
3890<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
3891SkScalar getTextSkewX() const
3892</pre>
3893
3894Returns <a href="bmh_SkPaint_Reference?cl=9919#Text_Skew_X">Text Skew X</a>.
3895Default value is zero.
3896
3897### Return Value
3898
3899additional shear in x-axis relative to y-axis
3900
3901### Example
3902
3903<div><fiddle-embed name="11c10f466dae0d1639dbb9f6a0040218"></fiddle-embed></div>
3904
3905---
3906
3907<a name="setTextSkewX"></a>
3908## setTextSkewX
3909
3910<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
3911void setTextSkewX(SkScalar skewX)
3912</pre>
3913
3914Sets <a href="bmh_SkPaint_Reference?cl=9919#Text_Skew_X">Text Skew X</a>.
3915Default value is zero.
3916
3917### Parameters
3918
3919<table> <tr> <td><code><strong>skewX </strong></code></td> <td>
3920additional shear in x-axis relative to y-axis</td>
3921 </tr>
3922</table>
3923
3924### Example
3925
3926<div><fiddle-embed name="6bd705a6e0c5f8ee24f302fe531bfabc"></fiddle-embed></div>
3927
3928---
3929
3930# <a name="Text_Encoding"></a> Text Encoding
3931
3932## <a name="SkPaint::TextEncoding"></a> Enum SkPaint::TextEncoding
3933
3934<pre style="padding: 1em 1em 1em 1em;width: 44em; background-color: #f0f0f0">
3935enum <a href="bmh_SkPaint_Reference?cl=9919#TextEncoding">TextEncoding</a> {
3936<a href="bmh_SkPaint_Reference?cl=9919#kUTF8_TextEncoding">kUTF8 TextEncoding</a>,
3937<a href="bmh_SkPaint_Reference?cl=9919#kUTF16_TextEncoding">kUTF16 TextEncoding</a>,
3938<a href="bmh_SkPaint_Reference?cl=9919#kUTF32_TextEncoding">kUTF32 TextEncoding</a>,
3939<a href="bmh_SkPaint_Reference?cl=9919#kGlyphID_TextEncoding">kGlyphID TextEncoding</a>
3940};</pre>
3941
3942<a href="bmh_SkPaint_Reference?cl=9919#TextEncoding">TextEncoding</a> determines whether text specifies character codes and their encoded size,
3943or glyph indices. Character codes use the encoding specified by the<a href="bmh_undocumented?cl=9919#Unicode">Unicode</a> standardhttp://unicode.org/standard/standard.html.
3944Character codes encoded size are specified by <a href="bmh_undocumented?cl=9919#UTF_8">UTF-8</a>, <a href="bmh_undocumented?cl=9919#UTF_16">UTF-16</a>, or <a href="bmh_undocumented?cl=9919#UTF_32">UTF-32</a>.
3945All character encoding are able to represent all of <a href="bmh_undocumented?cl=9919#Unicode">Unicode</a>, differing only
3946in the total storage required.
3947
3948<a href="bmh_undocumented?cl=9919#UTF_8">UTF-8</a> (<a href="bmh_undocumented?cl=9919#RFC">RFC</a> 3629)https://tools.ietf.org/html/rfc3629is made up of 8-bit bytes,
3949and is a superset of <a href="bmh_undocumented?cl=9919#ASCII">ASCII</a>.
3950<a href="bmh_undocumented?cl=9919#UTF_16">UTF-16</a> (<a href="bmh_undocumented?cl=9919#RFC">RFC</a> 2781)https://tools.ietf.org/html/rfc2781is made up of 16-bit words,
3951and is a superset of <a href="bmh_undocumented?cl=9919#Unicode">Unicode</a> ranges 0x0000 to 0xD7FF and 0xE000 to 0xFFFF.
3952<a href="bmh_undocumented?cl=9919#UTF_32">UTF-32</a>http://www.unicode.org/versions/<a href="bmh_undocumented?cl=9919#Unicode5">Unicode5</a>.0.0/ch03.pdfis
3953made up of 32-bit words, and is a superset of <a href="bmh_undocumented?cl=9919#Unicode">Unicode</a>.
3954
3955<a href="bmh_undocumented?cl=9919#Font_Manager">Font Manager</a> uses font data to convert character code points into glyph indices.
3956A glyph index is a 16-bit word.
3957
3958<a href="bmh_SkPaint_Reference?cl=9919#TextEncoding">TextEncoding</a> is set to <a href="bmh_SkPaint_Reference?cl=9919#kUTF8_TextEncoding">kUTF8 TextEncoding</a> by default.
3959
3960### Constants
3961
3962<table>
3963 <tr>
3964 <td><a name="SkPaint::kUTF8_TextEncoding"></a> <code><strong>SkPaint::kUTF8_TextEncoding </strong></code></td><td>0</td><td>Uses bytes to represent <a href="bmh_undocumented?cl=9919#UTF_8">UTF-8</a> or <a href="bmh_undocumented?cl=9919#ASCII">ASCII</a>.</td>
3965 </tr>
3966 <tr>
3967 <td><a name="SkPaint::kUTF16_TextEncoding"></a> <code><strong>SkPaint::kUTF16_TextEncoding </strong></code></td><td>1</td><td>Uses two byte words to represent most of <a href="bmh_undocumented?cl=9919#Unicode">Unicode</a>.</td>
3968 </tr>
3969 <tr>
3970 <td><a name="SkPaint::kUTF32_TextEncoding"></a> <code><strong>SkPaint::kUTF32_TextEncoding </strong></code></td><td>2</td><td>Uses four byte words to represent all of <a href="bmh_undocumented?cl=9919#Unicode">Unicode</a>.</td>
3971 </tr>
3972 <tr>
3973 <td><a name="SkPaint::kGlyphID_TextEncoding"></a> <code><strong>SkPaint::kGlyphID_TextEncoding </strong></code></td><td>3</td><td>Uses two byte words to represent glyph indices.</td>
3974 </tr>
3975
3976</table>
3977
3978### Example
3979
3980<div><fiddle-embed name="b29294e7f29d160a1b46abf2dcec9d2a"><div>First line has <a href="bmh_undocumented?cl=9919#UTF_8">UTF-8</a> encoding.
3981Second line has <a href="bmh_undocumented?cl=9919#UTF_16">UTF-16</a> encoding.
3982Third line has <a href="bmh_undocumented?cl=9919#UTF_32">UTF-32</a> encoding.
3983Fourth line has 16 bit glyph indices.</div></fiddle-embed></div>
3984
3985<a name="getTextEncoding"></a>
3986## getTextEncoding
3987
3988<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
3989TextEncoding getTextEncoding() const
3990</pre>
3991
3992Returns <a href="bmh_SkPaint_Reference?cl=9919#Text_Encoding">Text Encoding</a>.
3993<a href="bmh_SkPaint_Reference?cl=9919#Text_Encoding">Text Encoding</a> determines how character code points are mapped to font glyph indices.
3994
3995### Return Value
3996
3997one of: <a href="bmh_SkPaint_Reference?cl=9919#kUTF8_TextEncoding">kUTF8 TextEncoding</a>, <a href="bmh_SkPaint_Reference?cl=9919#kUTF16_TextEncoding">kUTF16 TextEncoding</a>, <a href="bmh_SkPaint_Reference?cl=9919#kUTF32_TextEncoding">kUTF32 TextEncoding</a>, or
3998<a href="bmh_SkPaint_Reference?cl=9919#kGlyphID_TextEncoding">kGlyphID TextEncoding</a>
3999
4000### Example
4001
4002<div><fiddle-embed name="70ad28bbf7668b38474d7f225e3540bc">
4003
4004#### Example Output
4005
4006~~~~
4007kUTF8_TextEncoding == text encoding
4008kGlyphID_TextEncoding == text encoding
4009~~~~
4010
4011</fiddle-embed></div>
4012
4013---
4014
4015<a name="setTextEncoding"></a>
4016## setTextEncoding
4017
4018<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
4019void setTextEncoding(TextEncoding encoding)
4020</pre>
4021
4022Sets <a href="bmh_SkPaint_Reference?cl=9919#Text_Encoding">Text Encoding</a> to <a href="bmh_SkPaint_Reference?cl=9919#setTextEncoding">encoding</a>.
4023<a href="bmh_SkPaint_Reference?cl=9919#Text_Encoding">Text Encoding</a> determines how character code points are mapped to font glyph indices.
4024Invalid values for <a href="bmh_SkPaint_Reference?cl=9919#setTextEncoding">encoding</a> are ignored.
4025
4026### Parameters
4027
4028<table> <tr> <td><code><strong>encoding </strong></code></td> <td>
4029one of: <a href="bmh_SkPaint_Reference?cl=9919#kUTF8_TextEncoding">kUTF8 TextEncoding</a>, <a href="bmh_SkPaint_Reference?cl=9919#kUTF16_TextEncoding">kUTF16 TextEncoding</a>, <a href="bmh_SkPaint_Reference?cl=9919#kUTF32_TextEncoding">kUTF32 TextEncoding</a>, or</td>
4030 </tr>
4031</table>
4032
4033### Example
4034
4035<div><fiddle-embed name="329b92fbc35151dee9aa0c0e70107665">
4036
4037#### Example Output
4038
4039~~~~
40404 != text encoding
4041~~~~
4042
4043</fiddle-embed></div>
4044
4045---
4046
4047# <a name="Font_Metrics"></a> Font Metrics
4048<a href="bmh_SkPaint_Reference?cl=9919#Font_Metrics">Font Metrics</a> describe dimensions common to the glyphs in <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a>.
4049The dimensions are computed by <a href="bmh_undocumented?cl=9919#Font_Manager">Font Manager</a> from font data and do not take
4050<a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> settings other than <a href="bmh_SkPaint_Reference?cl=9919#Text_Size">Text Size</a> into account.
4051
4052<a href="bmh_undocumented?cl=9919#Font">Font</a> dimensions specify the anchor to the left of the glyph at baseline as the origin.
4053X-axis values to the left of the glyph are negative, and to the right of the left glyph edge
4054are positive.
4055Y-axis values above the baseline are negative, and below the baseline are positive.
4056
4057### Example
4058
4059<div><fiddle-embed name="b5b76e0a15da0c3530071186a9006498"></fiddle-embed></div>
4060
4061# <a name="SkPaint::FontMetrics"></a> Struct SkPaint::FontMetrics
4062
4063<pre style="padding: 1em 1em 1em 1em;width: 44em; background-color: #f0f0f0">
4064struct <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics">FontMetrics</a> {
4065enum <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_FontMetricsFlags">FontMetricsFlags</a> {
4066<a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_kUnderlineThicknessIsValid_Flag">kUnderlineThicknessIsValid Flag</a> = 1 << 0,
4067<a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_kUnderlinePositionIsValid_Flag">kUnderlinePositionIsValid Flag</a> = 1 << 1,
4068<a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_kStrikeoutThicknessIsValid_Flag">kStrikeoutThicknessIsValid Flag</a> = 1 << 2,
4069<a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_kStrikeoutPositionIsValid_Flag">kStrikeoutPositionIsValid Flag</a> = 1 << 3,
4070};
4071
4072uint32_t <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fFlags">fFlags</a>;
4073<a href="bmh_undocumented?cl=9919#SkScalar">SkScalar</a> <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fTop">fTop</a>;
4074<a href="bmh_undocumented?cl=9919#SkScalar">SkScalar</a> <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fAscent">fAscent</a>;
4075<a href="bmh_undocumented?cl=9919#SkScalar">SkScalar</a> <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fDescent">fDescent</a>;
4076<a href="bmh_undocumented?cl=9919#SkScalar">SkScalar</a> <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fBottom">fBottom</a>;
4077<a href="bmh_undocumented?cl=9919#SkScalar">SkScalar</a> <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fLeading">fLeading</a>;
4078<a href="bmh_undocumented?cl=9919#SkScalar">SkScalar</a> <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fAvgCharWidth">fAvgCharWidth</a>;
4079<a href="bmh_undocumented?cl=9919#SkScalar">SkScalar</a> <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fMaxCharWidth">fMaxCharWidth</a>;
4080<a href="bmh_undocumented?cl=9919#SkScalar">SkScalar</a> <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fXMin">fXMin</a>;
4081<a href="bmh_undocumented?cl=9919#SkScalar">SkScalar</a> <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fXMax">fXMax</a>;
4082<a href="bmh_undocumented?cl=9919#SkScalar">SkScalar</a> <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fXHeight">fXHeight</a>;
4083<a href="bmh_undocumented?cl=9919#SkScalar">SkScalar</a> <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fCapHeight">fCapHeight</a>;
4084<a href="bmh_undocumented?cl=9919#SkScalar">SkScalar</a> <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fUnderlineThickness">fUnderlineThickness</a>;
4085<a href="bmh_undocumented?cl=9919#SkScalar">SkScalar</a> <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fUnderlinePosition">fUnderlinePosition</a>;
4086<a href="bmh_undocumented?cl=9919#SkScalar">SkScalar</a> <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fStrikeoutThickness">fStrikeoutThickness</a>;
4087<a href="bmh_undocumented?cl=9919#SkScalar">SkScalar</a> <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fStrikeoutPosition">fStrikeoutPosition</a>;
4088
4089bool <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_hasUnderlineThickness">hasUnderlineThickness(SkScalar* thickness)</a> const;
4090bool <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_hasUnderlinePosition">hasUnderlinePosition(SkScalar* position)</a> const;
4091bool <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_hasStrikeoutThickness">hasStrikeoutThickness(SkScalar* thickness)</a> const;
4092bool <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_hasStrikeoutPosition">hasStrikeoutPosition(SkScalar* position)</a> const;
4093};</pre>
4094
4095<a href="bmh_SkPaint_Reference?cl=9919#FontMetrics">FontMetrics</a> is filled out by <a href="bmh_SkPaint_Reference?cl=9919#getFontMetrics">getFontMetrics</a>. <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics">FontMetrics</a> contents reflect the values
4096computed by <a href="bmh_undocumented?cl=9919#Font_Manager">Font Manager</a> using <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a>. Values are set to zero if they are
4097not availble.
4098
4099<a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fUnderlineThickness">fUnderlineThickness</a> and <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fUnderlinePosition">fUnderlinePosition</a> have a bit set in <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fFlags">fFlags</a> if their values
4100are valid, since their value may be zero.
4101<a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fStrikeoutThickness">fStrikeoutThickness</a> and <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fStrikeoutPosition">fStrikeoutPosition</a> have a bit set in <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fFlags">fFlags</a> if their values
4102are valid, since their value may be zero.
4103
4104## <a name="SkPaint::FontMetrics::FontMetricsFlags"></a> Enum SkPaint::FontMetrics::FontMetricsFlags
4105
4106<pre style="padding: 1em 1em 1em 1em;width: 44em; background-color: #f0f0f0">
4107enum <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_FontMetricsFlags">FontMetricsFlags</a> {
4108<a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_kUnderlineThicknessIsValid_Flag">kUnderlineThicknessIsValid Flag</a> = 1 << 0,
4109<a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_kUnderlinePositionIsValid_Flag">kUnderlinePositionIsValid Flag</a> = 1 << 1,
4110<a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_kStrikeoutThicknessIsValid_Flag">kStrikeoutThicknessIsValid Flag</a> = 1 << 2,
4111<a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_kStrikeoutPositionIsValid_Flag">kStrikeoutPositionIsValid Flag</a> = 1 << 3,
4112};</pre>
4113
4114<a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_FontMetricsFlags">FontMetricsFlags</a> are set in <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fFlags">fFlags</a> when underline and strikeout metrics are valid;
4115the underline or strikeout metric may be valid and zero.
4116Fonts with embedded bitmaps may not have valid underline or strikeout metrics.
4117
4118### Constants
4119
4120<table>
4121 <tr>
4122 <td><a name="SkPaint::FontMetrics::kUnderlineThicknessIsValid_Flag"></a> <code><strong>SkPaint::FontMetrics::kUnderlineThicknessIsValid_Flag </strong></code></td><td>0x0001</td><td>Set if <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fUnderlineThickness">fUnderlineThickness</a> is valid.</td>
4123 </tr>
4124 <tr>
4125 <td><a name="SkPaint::FontMetrics::kUnderlinePositionIsValid_Flag"></a> <code><strong>SkPaint::FontMetrics::kUnderlinePositionIsValid_Flag </strong></code></td><td>0x0002</td><td>Set if <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fUnderlinePosition">fUnderlinePosition</a> is valid.</td>
4126 </tr>
4127 <tr>
4128 <td><a name="SkPaint::FontMetrics::kStrikeoutThicknessIsValid_Flag"></a> <code><strong>SkPaint::FontMetrics::kStrikeoutThicknessIsValid_Flag </strong></code></td><td>0x0004</td><td>Set if <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fStrikeoutThickness">fStrikeoutThickness</a> is valid.</td>
4129 </tr>
4130 <tr>
4131 <td><a name="SkPaint::FontMetrics::kStrikeoutPositionIsValid_Flag"></a> <code><strong>SkPaint::FontMetrics::kStrikeoutPositionIsValid_Flag </strong></code></td><td>0x0008</td><td>Set if <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fStrikeoutPosition">fStrikeoutPosition</a> is valid.</td>
4132 </tr>
4133
4134</table>
4135
4136<code><strong>uint32_t fFlags</strong></code>
4137
4138<a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fFlags">fFlags</a> is set when underline metrics are valid.
4139
4140<code><strong>SkScalar fTop</strong></code>
4141
4142Largest height for any glyph.
4143A measure from the baseline, and is less than or equal to zero.
4144
4145<code><strong>SkScalar fAscent</strong></code>
4146
4147Recommended distance above the baseline to reserve for a line of text.
4148A measure from the baseline, and is less than or equal to zero.
4149
4150<code><strong>SkScalar fDescent</strong></code>
4151
4152Recommended distance below the baseline to reserve for a line of text.
4153A measure from the baseline, and is greater than or equal to zero.
4154
4155<code><strong>SkScalar fBottom</strong></code>
4156
4157Greatest extent below the baseline for any glyph.
4158A measure from the baseline, and is greater than or equal to zero.
4159
4160<code><strong>SkScalar fLeading</strong></code>
4161
4162Recommended distance to add between lines of text.
4163Greater than or equal to zero.
4164
4165<code><strong>SkScalar fAvgCharWidth</strong></code>
4166
4167Average character width, if it is available.
4168Zero if no average width is stored in the font.
4169
4170<code><strong>SkScalar fMaxCharWidth</strong></code>
4171
4172Maximum character width.
4173
4174<code><strong>SkScalar fXMin</strong></code>
4175
4176Minimum bounding box x value for all glyphs.
4177Typically less than zero.
4178
4179<code><strong>SkScalar fXMax</strong></code>
4180
4181Maximum bounding box x value for all glyphs.
4182Typically greater than zero.
4183
4184<code><strong>SkScalar fXHeight</strong></code>
4185
4186Height of a lower-case 'x'.
4187May be zero if no lower-case height is stored in the font.
4188
4189<code><strong>SkScalar fCapHeight</strong></code>
4190
4191Height of an upper-case letter.
4192May be zero if no upper-case height is stored in the font.
4193
4194<code><strong>SkScalar fUnderlineThickness</strong></code>
4195
4196Underline thickness. If the metric
4197is valid, the <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_kUnderlineThicknessIsValid_Flag">kUnderlineThicknessIsValid Flag</a> is set in <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fFlags">fFlags</a>.
4198If <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_kUnderlineThicknessIsValid_Flag">kUnderlineThicknessIsValid Flag</a> is clear, <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fUnderlineThickness">fUnderlineThickness</a> is zero.
4199
4200<code><strong>SkScalar fUnderlinePosition</strong></code>
4201
4202Underline position relative to the baseline.
4203It may be negative, to draw the underline above the baseline, zero
4204to draw the underline on the baseline, or positive to draw the underline
4205below the baseline.
4206
4207If the metric is valid, the <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_kUnderlinePositionIsValid_Flag">kUnderlinePositionIsValid Flag</a> is set in <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fFlags">fFlags</a>.
4208If <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_kUnderlinePositionIsValid_Flag">kUnderlinePositionIsValid Flag</a> is clear, <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fUnderlinePosition">fUnderlinePosition</a> is zero.
4209
4210<code><strong>SkScalar fStrikeoutThickness</strong></code>
4211
4212Strikeout thickness. If the metric
4213is valid, the <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_kStrikeoutThicknessIsValid_Flag">kStrikeoutThicknessIsValid Flag</a> is set in <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fFlags">fFlags</a>.
4214If <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_kStrikeoutThicknessIsValid_Flag">kStrikeoutThicknessIsValid Flag</a> is clear, <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fStrikeoutThickness">fStrikeoutThickness</a> is zero.
4215
4216<code><strong>SkScalar fStrikeoutPosition</strong></code>
4217
4218Strikeout position relative to the baseline.
4219It may be negative, to draw the strikeout above the baseline, zero
4220to draw the strikeout on the baseline, or positive to draw the strikeout
4221below the baseline.
4222
4223If the metric is valid, the <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_kStrikeoutPositionIsValid_Flag">kStrikeoutPositionIsValid Flag</a> is set in <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fFlags">fFlags</a>.
4224If <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_kStrikeoutPositionIsValid_Flag">kStrikeoutPositionIsValid Flag</a> is clear, <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fStrikeoutPosition">fStrikeoutPosition</a> is zero.
4225
4226<a name="hasUnderlineThickness"></a>
4227## hasUnderlineThickness
4228
4229<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
4230bool hasUnderlineThickness(SkScalar* thickness) const
4231</pre>
4232
4233If <a href="bmh_SkPaint_Reference?cl=9919#Font_Metrics">Font Metrics</a> has a valid underline <a href="bmh_SkPaint_Reference?cl=9919#thickness">thickness</a>, return true, and set
4234<a href="bmh_SkPaint_Reference?cl=9919#thickness">thickness</a> to that value. If it doesn't, return false, and ignore
4235<a href="bmh_SkPaint_Reference?cl=9919#thickness">thickness</a>.
4236
4237### Parameters
4238
4239<table> <tr> <td><code><strong>thickness </strong></code></td> <td>
4240storage for underline width</td>
4241 </tr>
4242</table>
4243
4244### Return Value
4245
4246true if font specifies underline width
4247
4248---
4249
4250<a name="hasUnderlinePosition"></a>
4251## hasUnderlinePosition
4252
4253<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
4254bool hasUnderlinePosition(SkScalar* position) const
4255</pre>
4256
4257If <a href="bmh_SkPaint_Reference?cl=9919#Font_Metrics">Font Metrics</a> has a valid underline <a href="bmh_SkPaint_Reference?cl=9919#position">position</a>, return true, and set
4258<a href="bmh_SkPaint_Reference?cl=9919#position">position</a> to that value. If it doesn't, return false, and ignore
4259<a href="bmh_SkPaint_Reference?cl=9919#position">position</a>.
4260
4261### Parameters
4262
4263<table> <tr> <td><code><strong>position </strong></code></td> <td>
4264storage for underline <a href="bmh_SkPaint_Reference?cl=9919#position">position</a></td>
4265 </tr>
4266</table>
4267
4268### Return Value
4269
4270true if font specifies underline <a href="bmh_SkPaint_Reference?cl=9919#position">position</a>
4271
4272---
4273
4274<a name="hasStrikeoutThickness"></a>
4275## hasStrikeoutThickness
4276
4277<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
4278bool hasStrikeoutThickness(SkScalar* thickness) const
4279</pre>
4280
4281If <a href="bmh_SkPaint_Reference?cl=9919#Font_Metrics">Font Metrics</a> has a valid strikeout <a href="bmh_SkPaint_Reference?cl=9919#thickness">thickness</a>, return true, and set
4282<a href="bmh_SkPaint_Reference?cl=9919#thickness">thickness</a> to that value. If it doesn't, return false, and ignore
4283<a href="bmh_SkPaint_Reference?cl=9919#thickness">thickness</a>.
4284
4285### Parameters
4286
4287<table> <tr> <td><code><strong>thickness </strong></code></td> <td>
4288storage for strikeout width</td>
4289 </tr>
4290</table>
4291
4292### Return Value
4293
4294true if font specifies strikeout width
4295
4296---
4297
4298<a name="hasStrikeoutPosition"></a>
4299## hasStrikeoutPosition
4300
4301<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
4302bool hasStrikeoutPosition(SkScalar* position) const
4303</pre>
4304
4305If <a href="bmh_SkPaint_Reference?cl=9919#Font_Metrics">Font Metrics</a> has a valid strikeout <a href="bmh_SkPaint_Reference?cl=9919#position">position</a>, return true, and set
4306<a href="bmh_SkPaint_Reference?cl=9919#position">position</a> to that value. If it doesn't, return false, and ignore
4307<a href="bmh_SkPaint_Reference?cl=9919#position">position</a>.
4308
4309### Parameters
4310
4311<table> <tr> <td><code><strong>position </strong></code></td> <td>
4312storage for strikeout <a href="bmh_SkPaint_Reference?cl=9919#position">position</a></td>
4313 </tr>
4314</table>
4315
4316### Return Value
4317
4318true if font specifies strikeout <a href="bmh_SkPaint_Reference?cl=9919#position">position</a>
4319
4320---
4321
4322<a name="getFontMetrics"></a>
4323## getFontMetrics
4324
4325<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
4326SkScalar getFontMetrics(FontMetrics* metrics, SkScalar scale = 0) const
4327</pre>
4328
4329Returns <a href="bmh_SkPaint_Reference?cl=9919#Font_Metrics">Font Metrics</a> associated with <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a>.
4330The return value is the recommended spacing between lines: the sum of <a href="bmh_SkPaint_Reference?cl=9919#metrics">metrics</a>
4331descent, ascent, and leading.
4332If <a href="bmh_SkPaint_Reference?cl=9919#metrics">metrics</a> is not nullptr, <a href="bmh_SkPaint_Reference?cl=9919#Font_Metrics">Font Metrics</a> is copied to <a href="bmh_SkPaint_Reference?cl=9919#metrics">metrics</a>.
4333Results are scaled by <a href="bmh_SkPaint_Reference?cl=9919#Text_Size">Text Size</a> but does not take into account
4334dimensions required by <a href="bmh_SkPaint_Reference?cl=9919#Text_Scale_X">Text Scale X</a>, <a href="bmh_SkPaint_Reference?cl=9919#Text_Skew_X">Text Skew X</a>, <a href="bmh_SkPaint_Reference?cl=9919#Fake_Bold">Fake Bold</a>,
4335<a href="bmh_SkPaint_Reference?cl=9919#Style_Stroke">Style Stroke</a>, and <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a>.
4336Results can be additionally scaled by <a href="bmh_SkPaint_Reference?cl=9919#scale">scale</a>; a <a href="bmh_SkPaint_Reference?cl=9919#scale">scale</a> of zero
4337is ignored.
4338
4339### Parameters
4340
4341<table> <tr> <td><code><strong>metrics </strong></code></td> <td>
4342storage for <a href="bmh_SkPaint_Reference?cl=9919#Font_Metrics">Font Metrics</a> from <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a>; may be nullptr</td>
4343 </tr> <tr> <td><code><strong>scale </strong></code></td> <td>
4344additional multiplier for returned values</td>
4345 </tr>
4346</table>
4347
4348### Return Value
4349
4350recommended spacing between lines
4351
4352### Example
4353
4354<div><fiddle-embed name="b899d84caba6607340322d317992d070"></fiddle-embed></div>
4355
4356### See Also
4357
4358<a href="bmh_SkPaint_Reference?cl=9919#Text_Size">Text Size</a> <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a> <a href="bmh_SkPaint_Reference?cl=9919#Typeface_Methods">Typeface Methods</a>
4359
4360---
4361
4362<a name="getFontSpacing"></a>
4363## getFontSpacing
4364
4365<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
4366SkScalar getFontSpacing() const
4367</pre>
4368
4369Returns the recommended spacing between lines: the sum of metrics
4370descent, ascent, and leading.
4371Result is scaled by <a href="bmh_SkPaint_Reference?cl=9919#Text_Size">Text Size</a> but does not take into account
4372dimensions required by stroking and <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a>.
4373<a href="bmh_SkPaint_Reference?cl=9919#getFontSpacing">getFontSpacing</a> returns the same result as <a href="bmh_SkPaint_Reference?cl=9919#getFontMetrics">getFontMetrics</a>.
4374
4375### Return Value
4376
4377recommended spacing between lines
4378
4379### Example
4380
4381<div><fiddle-embed name="424741e26e1b174e43087d67422ce14f">
4382
4383#### Example Output
4384
4385~~~~
4386textSize: 12 fontSpacing: 13.9688
4387textSize: 18 fontSpacing: 20.9531
4388textSize: 24 fontSpacing: 27.9375
4389textSize: 32 fontSpacing: 37.25
4390~~~~
4391
4392</fiddle-embed></div>
4393
4394---
4395
4396<a name="getFontBounds"></a>
4397## getFontBounds
4398
4399<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
4400SkRect getFontBounds() const
4401</pre>
4402
4403Returns the union of bounds of all glyphs.
4404Returned dimensions are computed by <a href="bmh_undocumented?cl=9919#Font_Manager">Font Manager</a> from font data,
4405ignoring <a href="bmh_SkPaint_Reference?cl=9919#Hinting">Hinting</a>. <a href="bmh_SkPaint_Reference?cl=9919#getFontBounds">getFontBounds</a> includes <a href="bmh_SkPaint_Reference?cl=9919#Text_Size">Text Size</a>, <a href="bmh_SkPaint_Reference?cl=9919#Text_Scale_X">Text Scale X</a>,
4406and <a href="bmh_SkPaint_Reference?cl=9919#Text_Skew_X">Text Skew X</a>, but not <a href="bmh_SkPaint_Reference?cl=9919#Fake_Bold">Fake Bold</a> or <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a>.
4407
4408If <a href="bmh_SkPaint_Reference?cl=9919#Text_Size">Text Size</a> is large, <a href="bmh_SkPaint_Reference?cl=9919#Text_Scale_X">Text Scale X</a> is one, and <a href="bmh_SkPaint_Reference?cl=9919#Text_Skew_X">Text Skew X</a> is zero,
4409<a href="bmh_SkPaint_Reference?cl=9919#getFontBounds">getFontBounds</a> returns the same bounds as <a href="bmh_SkPaint_Reference?cl=9919#Font_Metrics">Font Metrics</a> { <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fXMin">FontMetrics::fXMin</a>,
4410<a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fTop">FontMetrics::fTop</a>, <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fXMax">FontMetrics::fXMax</a>, <a href="bmh_SkPaint_Reference?cl=9919#FontMetrics_fBottom">FontMetrics::fBottom</a> }.
4411
4412### Return Value
4413
4414union of bounds of all glyphs
4415
4416### Example
4417
4418<div><fiddle-embed name="facaddeec7943bc491988e345e27e65f">
4419
4420#### Example Output
4421
4422~~~~
4423metrics bounds = { -12.2461, -14.7891, 21.5215, 5.55469 }
4424font bounds = { -12.2461, -14.7891, 21.5215, 5.55469 }
4425~~~~
4426
4427</fiddle-embed></div>
4428
4429---
4430
4431<a name="textToGlyphs"></a>
4432## textToGlyphs
4433
4434<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
4435int textToGlyphs(const void* text, size_t byteLength, SkGlyphID glyphs[]) const
4436</pre>
4437
4438Converts <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> into glyph indices.
4439Returns the number of glyph indices represented by <a href="bmh_SkPaint_Reference?cl=9919#text">text</a>.
4440<a href="bmh_SkPaint_Reference?cl=9919#Text_Encoding">Text Encoding</a> specifies how <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> represents characters or <a href="bmh_SkPaint_Reference?cl=9919#glyphs">glyphs</a>.
4441<a href="bmh_SkPaint_Reference?cl=9919#glyphs">glyphs</a> may be nullptr, to compute the glyph count.
4442
4443Does not check <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> for valid character encoding or valid
4444glyph indices.
4445
4446If <a href="bmh_SkPaint_Reference?cl=9919#byteLength">byteLength</a> equals zero, <a href="bmh_SkPaint_Reference?cl=9919#textToGlyphs">textToGlyphs</a> returns zero.
4447If <a href="bmh_SkPaint_Reference?cl=9919#byteLength">byteLength</a> includes a partial character, the partial character is ignored.
4448
4449If <a href="bmh_SkPaint_Reference?cl=9919#Text_Encoding">Text Encoding</a> is <a href="bmh_SkPaint_Reference?cl=9919#kUTF8_TextEncoding">kUTF8 TextEncoding</a> and
4450<a href="bmh_SkPaint_Reference?cl=9919#text">text</a> contains an invalid <a href="bmh_undocumented?cl=9919#UTF_8">UTF-8</a> sequence, zero is returned.
4451
4452### Parameters
4453
4454<table> <tr> <td><code><strong>text </strong></code></td> <td>
4455character stroage encoded with <a href="bmh_SkPaint_Reference?cl=9919#Text_Encoding">Text Encoding</a></td>
4456 </tr> <tr> <td><code><strong>byteLength </strong></code></td> <td>
4457length of character storage in bytes</td>
4458 </tr> <tr> <td><code><strong>glyphs </strong></code></td> <td>
4459storage for glyph indices; may be nullptr</td>
4460 </tr>
4461</table>
4462
4463### Return Value
4464
4465number of <a href="bmh_SkPaint_Reference?cl=9919#glyphs">glyphs</a> represented by <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> of length <a href="bmh_SkPaint_Reference?cl=9919#byteLength">byteLength</a>
4466
4467### Example
4468
4469<div><fiddle-embed name="343e9471a7f7b5f09abdc3b44983433b"></fiddle-embed></div>
4470
4471---
4472
4473<a name="countText"></a>
4474## countText
4475
4476<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
4477int countText(const void* text, size_t byteLength) const
4478</pre>
4479
4480Returns the number of glyphs in <a href="bmh_SkPaint_Reference?cl=9919#text">text</a>.
4481Uses <a href="bmh_SkPaint_Reference?cl=9919#Text_Encoding">Text Encoding</a> to count the glyphs.
4482Returns the same result as <a href="bmh_SkPaint_Reference?cl=9919#textToGlyphs">textToGlyphs</a>.
4483
4484### Parameters
4485
4486<table> <tr> <td><code><strong>text </strong></code></td> <td>
4487character stroage encoded with <a href="bmh_SkPaint_Reference?cl=9919#Text_Encoding">Text Encoding</a></td>
4488 </tr> <tr> <td><code><strong>byteLength </strong></code></td> <td>
4489length of character storage in bytes</td>
4490 </tr>
4491</table>
4492
4493### Return Value
4494
4495number of glyphs represented by <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> of length <a href="bmh_SkPaint_Reference?cl=9919#byteLength">byteLength</a>
4496
4497### Example
4498
4499<div><fiddle-embed name="85436c71aab5410767fc688ab0573e09">
4500
4501#### Example Output
4502
4503~~~~
4504count = 5
4505~~~~
4506
4507</fiddle-embed></div>
4508
4509---
4510
4511<a name="containsText"></a>
4512## containsText
4513
4514<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
4515bool containsText(const void* text, size_t byteLength) const
4516</pre>
4517
4518Returns true if all <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> corresponds to a non-zero glyph index.
4519Returns false if any characters in <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> are not supported in
4520<a href="bmh_undocumented?cl=9919#Typeface">Typeface</a>.
4521
4522If <a href="bmh_SkPaint_Reference?cl=9919#Text_Encoding">Text Encoding</a> is <a href="bmh_SkPaint_Reference?cl=9919#kGlyphID_TextEncoding">kGlyphID TextEncoding</a>, <a href="bmh_SkPaint_Reference?cl=9919#containsText">containsText</a>
4523returns true if all glyph indices in <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> are non-zero; <a href="bmh_SkPaint_Reference?cl=9919#containsText">containsText</a>
4524does not check to see if <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> contains valid glyph indices for <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a>.
4525
4526Returns true if bytelength is zero.
4527
4528### Parameters
4529
4530<table> <tr> <td><code><strong>text </strong></code></td> <td>
4531array of characters or glyphs</td>
4532 </tr> <tr> <td><code><strong>byteLength </strong></code></td> <td>
4533number of bytes in <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> array</td>
4534 </tr>
4535</table>
4536
4537### Return Value
4538
4539true if all <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> corresponds to a non-zero glyph index
4540
4541### Example
4542
4543<div><fiddle-embed name="9202369019552f09cd4bec7f3046fee4"><div><a href="bmh_SkPaint_Reference?cl=9919#containsText">containsText</a> succeeds for degree symbol, but cannot find a glyph index
4544corresponding to the <a href="bmh_undocumented?cl=9919#Unicode">Unicode</a> surrogate code point.</div>
4545
4546#### Example Output
4547
4548~~~~
45490x00b0 == has char
45500xd800 != has char
4551~~~~
4552
4553</fiddle-embed></div>
4554
4555### Example
4556
4557<div><fiddle-embed name="904227febfd1c2e264955da0ef66da73"><div><a href="bmh_SkPaint_Reference?cl=9919#containsText">containsText</a> returns true that glyph index is greater than zero, not
4558that it corresponds to an entry in <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a>.</div>
4559
4560#### Example Output
4561
4562~~~~
45630x01ff == has glyph
45640x0000 != has glyph
45650xffff == has glyph
4566~~~~
4567
4568</fiddle-embed></div>
4569
4570### See Also
4571
4572<a href="bmh_SkPaint_Reference?cl=9919#setTextEncoding">setTextEncoding</a> <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a>
4573
4574---
4575
4576<a name="glyphsToUnichars"></a>
4577## glyphsToUnichars
4578
4579<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
4580void glyphsToUnichars(const SkGlyphID glyphs[], int count, SkUnichar text[]) const
4581</pre>
4582
4583Converts <a href="bmh_SkPaint_Reference?cl=9919#glyphs">glyphs</a> into <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> if possible.
4584<a href="bmh_undocumented?cl=9919#Glyph">Glyph</a> values without direct <a href="bmh_undocumented?cl=9919#Unicode">Unicode</a> equivalents are mapped to zero.
4585Uses the <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a>, but is unaffected
4586by <a href="bmh_SkPaint_Reference?cl=9919#Text_Encoding">Text Encoding</a>; the <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> values returned are equivalent to <a href="bmh_SkPaint_Reference?cl=9919#kUTF32_TextEncoding">kUTF32 TextEncoding</a>.
4587
4588Only supported on platforms that use <a href="bmh_undocumented?cl=9919#FreeType">FreeType</a> as the <a href="bmh_undocumented?cl=9919#Engine">Font Engine</a>.
4589
4590### Parameters
4591
4592<table> <tr> <td><code><strong>glyphs </strong></code></td> <td>
4593array of indices into font</td>
4594 </tr> <tr> <td><code><strong>count </strong></code></td> <td>
4595length of glyph array</td>
4596 </tr> <tr> <td><code><strong>text </strong></code></td> <td>
4597storage for character codes, one per glyph</td>
4598 </tr>
4599</table>
4600
4601### Example
4602
4603<div><fiddle-embed name="c12686b0b3e0a87d0a248bbfc57e9492"><div>Convert <a href="bmh_undocumented?cl=9919#UTF_8">UTF-8</a> <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> to <a href="bmh_SkPaint_Reference?cl=9919#glyphs">glyphs</a>; then convert <a href="bmh_SkPaint_Reference?cl=9919#glyphs">glyphs</a> to <a href="bmh_undocumented?cl=9919#Unichar">Unichar</a> code points.</div></fiddle-embed></div>
4604
4605---
4606
4607# <a name="Measure_Text"></a> Measure Text
4608
4609<a name="measureText"></a>
4610## measureText
4611
4612<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
4613SkScalar measureText(const void* text, size_t length, SkRect* bounds) const
4614</pre>
4615
4616Returns the advance width of <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> if <a href="bmh_SkPaint_Reference?cl=9919#kVerticalText_Flag">kVerticalText Flag</a> is clear,
4617and the height of <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> if <a href="bmh_SkPaint_Reference?cl=9919#kVerticalText_Flag">kVerticalText Flag</a> is set.
4618The advance is the normal distance to move before drawing additional <a href="bmh_SkPaint_Reference?cl=9919#text">text</a>.
4619Uses <a href="bmh_SkPaint_Reference?cl=9919#Text_Encoding">Text Encoding</a> to decode <a href="bmh_SkPaint_Reference?cl=9919#text">text</a>, <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a> to get the font metrics,
4620and <a href="bmh_SkPaint_Reference?cl=9919#Text_Size">Text Size</a>, <a href="bmh_SkPaint_Reference?cl=9919#Text_Scale_X">Text Scale X</a>, <a href="bmh_SkPaint_Reference?cl=9919#Text_Skew_X">Text Skew X</a>, <a href="bmh_SkPaint_Reference?cl=9919#Stroke_Width">Stroke Width</a>, and
4621<a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a> to scale the metrics and <a href="bmh_SkPaint_Reference?cl=9919#bounds">bounds</a>.
4622Returns the bounding box of <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> if <a href="bmh_SkPaint_Reference?cl=9919#bounds">bounds</a> is not nullptr.
4623The bounding box is computed as if the <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> was drawn at the origin.
4624
4625### Parameters
4626
4627<table> <tr> <td><code><strong>text </strong></code></td> <td>
4628character codes or glyph indices to be measured</td>
4629 </tr> <tr> <td><code><strong>length </strong></code></td> <td>
4630number of bytes of <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> to measure</td>
4631 </tr> <tr> <td><code><strong>bounds </strong></code></td> <td>
4632returns bounding box relative to (0, 0) if not nullptr</td>
4633 </tr>
4634</table>
4635
4636### Return Value
4637
4638advance width or height
4639
4640### Example
4641
4642<div><fiddle-embed name="06084f609184470135a9cd9ebc5af149"></fiddle-embed></div>
4643
4644---
4645
4646<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
4647SkScalar measureText(const void* text, size_t length) const
4648</pre>
4649
4650Returns the advance width of <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> if <a href="bmh_SkPaint_Reference?cl=9919#kVerticalText_Flag">kVerticalText Flag</a> is clear,
4651and the height of <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> if <a href="bmh_SkPaint_Reference?cl=9919#kVerticalText_Flag">kVerticalText Flag</a> is set.
4652The advance is the normal distance to move before drawing additional <a href="bmh_SkPaint_Reference?cl=9919#text">text</a>.
4653Uses <a href="bmh_SkPaint_Reference?cl=9919#Text_Encoding">Text Encoding</a> to decode <a href="bmh_SkPaint_Reference?cl=9919#text">text</a>, <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a> to get the font metrics,
4654and <a href="bmh_SkPaint_Reference?cl=9919#Text_Size">Text Size</a> to scale the metrics.
4655Does not scale the advance or bounds by <a href="bmh_SkPaint_Reference?cl=9919#Fake_Bold">Fake Bold</a> or <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a>.
4656
4657### Parameters
4658
4659<table> <tr> <td><code><strong>text </strong></code></td> <td>
4660character codes or glyph indices to be measured</td>
4661 </tr> <tr> <td><code><strong>length </strong></code></td> <td>
4662number of bytes of <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> to measure</td>
4663 </tr>
4664</table>
4665
4666### Return Value
4667
4668advance width or height
4669
4670### Example
4671
4672<div><fiddle-embed name="f1139a5ddd17fd47c2f45f6e642cac76">
4673
4674#### Example Output
4675
4676~~~~
4677default width = 5
4678double width = 10
4679~~~~
4680
4681</fiddle-embed></div>
4682
4683---
4684
4685<a name="breakText"></a>
4686## breakText
4687
4688<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
4689size_t breakText(const void* text, size_t length, SkScalar maxWidth,
4690 SkScalar* measuredWidth = NULL) const
4691</pre>
4692
4693Returns the bytes of <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> that fit within <a href="bmh_SkPaint_Reference?cl=9919#maxWidth">maxWidth</a>.
4694If <a href="bmh_SkPaint_Reference?cl=9919#kVerticalText_Flag">kVerticalText Flag</a> is clear, the <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> fragment fits if its advance width is less than or
4695equal to <a href="bmh_SkPaint_Reference?cl=9919#maxWidth">maxWidth</a>.
4696If <a href="bmh_SkPaint_Reference?cl=9919#kVerticalText_Flag">kVerticalText Flag</a> is set, the <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> fragment fits if its advance height is less than or
4697equal to <a href="bmh_SkPaint_Reference?cl=9919#maxWidth">maxWidth</a>.
4698Measures only while the advance is less than or equal to <a href="bmh_SkPaint_Reference?cl=9919#maxWidth">maxWidth</a>.
4699Returns the advance or the <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> fragment in <a href="bmh_SkPaint_Reference?cl=9919#measuredWidth">measuredWidth</a> if it not nullptr.
4700Uses <a href="bmh_SkPaint_Reference?cl=9919#Text_Encoding">Text Encoding</a> to decode <a href="bmh_SkPaint_Reference?cl=9919#text">text</a>, <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a> to get the font metrics,
4701and <a href="bmh_SkPaint_Reference?cl=9919#Text_Size">Text Size</a> to scale the metrics.
4702Does not scale the advance or bounds by <a href="bmh_SkPaint_Reference?cl=9919#Fake_Bold">Fake Bold</a> or <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a>.
4703
4704### Parameters
4705
4706<table> <tr> <td><code><strong>text </strong></code></td> <td>
4707character codes or glyph indices to be measured</td>
4708 </tr> <tr> <td><code><strong>length </strong></code></td> <td>
4709number of bytes of <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> to measure</td>
4710 </tr> <tr> <td><code><strong>maxWidth </strong></code></td> <td>
4711advance limit; <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> is measured while advance is less than <a href="bmh_SkPaint_Reference?cl=9919#maxWidth">maxWidth</a></td>
4712 </tr> <tr> <td><code><strong>measuredWidth </strong></code></td> <td>
4713returns the width of the <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> less than or equal to <a href="bmh_SkPaint_Reference?cl=9919#maxWidth">maxWidth</a></td>
4714 </tr>
4715</table>
4716
4717### Return Value
4718
4719bytes of <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> that fit, always less than or equal to <a href="bmh_SkPaint_Reference?cl=9919#length">length</a>
4720
4721### Example
4722
4723<div><fiddle-embed name="fd0033470ccbd5c7059670fdbf96cffc"><div><a href="bmh_undocumented?cl=9919#Line">Line</a> under "" shows desired width, shorter than available characters.
4724<a href="bmh_undocumented?cl=9919#Line">Line</a> under "" shows measured width after breaking <a href="bmh_SkPaint_Reference?cl=9919#text">text</a>.</div></fiddle-embed></div>
4725
4726---
4727
4728<a name="getTextWidths"></a>
4729## getTextWidths
4730
4731<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
4732int getTextWidths(const void* text, size_t byteLength, SkScalar widths[],
4733 SkRect bounds[] = NULL) const
4734</pre>
4735
4736Retrieves the advance and <a href="bmh_SkPaint_Reference?cl=9919#bounds">bounds</a> for each glyph in <a href="bmh_SkPaint_Reference?cl=9919#text">text</a>, and returns
4737the glyph count in <a href="bmh_SkPaint_Reference?cl=9919#text">text</a>.
4738Both <a href="bmh_SkPaint_Reference?cl=9919#widths">widths</a> and <a href="bmh_SkPaint_Reference?cl=9919#bounds">bounds</a> may be nullptr.
4739If <a href="bmh_SkPaint_Reference?cl=9919#widths">widths</a> is not nullptr, <a href="bmh_SkPaint_Reference?cl=9919#widths">widths</a> must be an array of glyph count entries.
4740if <a href="bmh_SkPaint_Reference?cl=9919#bounds">bounds</a> is not nullptr, <a href="bmh_SkPaint_Reference?cl=9919#bounds">bounds</a> must be an array of glyph count entries.
4741If <a href="bmh_SkPaint_Reference?cl=9919#kVerticalText_Flag">kVerticalText Flag</a> is clear, <a href="bmh_SkPaint_Reference?cl=9919#widths">widths</a> returns the horizontal advance.
4742If <a href="bmh_SkPaint_Reference?cl=9919#kVerticalText_Flag">kVerticalText Flag</a> is set, <a href="bmh_SkPaint_Reference?cl=9919#widths">widths</a> returns the vertical advance.
4743Uses <a href="bmh_SkPaint_Reference?cl=9919#Text_Encoding">Text Encoding</a> to decode <a href="bmh_SkPaint_Reference?cl=9919#text">text</a>, <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a> to get the font metrics,
4744and <a href="bmh_SkPaint_Reference?cl=9919#Text_Size">Text Size</a> to scale the <a href="bmh_SkPaint_Reference?cl=9919#widths">widths</a> and <a href="bmh_SkPaint_Reference?cl=9919#bounds">bounds</a>.
4745Does not scale the advance by <a href="bmh_SkPaint_Reference?cl=9919#Fake_Bold">Fake Bold</a> or <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a>.
4746Does include <a href="bmh_SkPaint_Reference?cl=9919#Fake_Bold">Fake Bold</a> and <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a> in the <a href="bmh_SkPaint_Reference?cl=9919#bounds">bounds</a>.
4747
4748### Parameters
4749
4750<table> <tr> <td><code><strong>text </strong></code></td> <td>
4751character codes or glyph indices to be measured</td>
4752 </tr> <tr> <td><code><strong>byteLength </strong></code></td> <td>
4753number of bytes of <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> to measure</td>
4754 </tr> <tr> <td><code><strong>widths </strong></code></td> <td>
4755returns <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> advances for each glyph; may be nullptr</td>
4756 </tr> <tr> <td><code><strong>bounds </strong></code></td> <td>
4757returns <a href="bmh_SkPaint_Reference?cl=9919#bounds">bounds</a> for each glyph relative to (0, 0); may be nullptr</td>
4758 </tr>
4759</table>
4760
4761### Return Value
4762
4763glyph count in <a href="bmh_SkPaint_Reference?cl=9919#text">text</a>
4764
4765### Example
4766
4767<div><fiddle-embed name="6b9e101f49e9c2c28755c5bdcef64dfb"><div>Bounds of glyphs increase for stroked <a href="bmh_SkPaint_Reference?cl=9919#text">text</a>, but <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> advance remains the same.
4768The underlines show the <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> advance, spaced to keep them distinct.</div></fiddle-embed></div>
4769
4770---
4771
4772# <a name="Text_Path"></a> Text Path
4773<a href="bmh_SkPaint_Reference?cl=9919#Text_Path">Text Path</a> describes the geometry of glyphs used to draw text.
4774
4775<a name="getTextPath"></a>
4776## getTextPath
4777
4778<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
4779void getTextPath(const void* text, size_t length, SkScalar x, SkScalar y,
4780 SkPath* path) const
4781</pre>
4782
4783Returns the geometry as <a href="bmh_SkPath_Reference?cl=9919#Path">Path</a> equivalent to the drawn <a href="bmh_SkPaint_Reference?cl=9919#text">text</a>.
4784Uses <a href="bmh_SkPaint_Reference?cl=9919#Text_Encoding">Text Encoding</a> to decode <a href="bmh_SkPaint_Reference?cl=9919#text">text</a>, <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a> to get the glyph paths,
4785and <a href="bmh_SkPaint_Reference?cl=9919#Text_Size">Text Size</a>, <a href="bmh_SkPaint_Reference?cl=9919#Fake_Bold">Fake Bold</a>, and <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a> to scale and modify the glyph paths.
4786All of the glyph paths are stored in <a href="bmh_SkPaint_Reference?cl=9919#path">path</a>.
4787<a href="bmh_SkPaint_Reference?cl=9919#getTextPath">getTextPath</a> uses <a href="bmh_SkPaint_Reference?cl=9919#x">x</a>, <a href="bmh_SkPaint_Reference?cl=9919#y">y</a>, and <a href="bmh_SkPaint_Reference?cl=9919#Text_Align">Text Align</a> to position <a href="bmh_SkPaint_Reference?cl=9919#path">path</a>.
4788
4789### Parameters
4790
4791<table> <tr> <td><code><strong>text </strong></code></td> <td>
4792character codes or glyph indices</td>
4793 </tr> <tr> <td><code><strong>length </strong></code></td> <td>
4794number of bytes of <a href="bmh_SkPaint_Reference?cl=9919#text">text</a></td>
4795 </tr> <tr> <td><code><strong>x </strong></code></td> <td>
4796x-coordinate of the origin of the <a href="bmh_SkPaint_Reference?cl=9919#text">text</a></td>
4797 </tr> <tr> <td><code><strong>y </strong></code></td> <td>
4798y-coordinate of the origin of the <a href="bmh_SkPaint_Reference?cl=9919#text">text</a></td>
4799 </tr> <tr> <td><code><strong>path </strong></code></td> <td>
4800geometry of the glyphs</td>
4801 </tr>
4802</table>
4803
4804### Example
4805
4806<div><fiddle-embed name="7c9e6a399f898d68026c1f0865e6f73e"><div><a href="bmh_undocumented?cl=9919#Text">Text</a> is added to <a href="bmh_SkPath_Reference?cl=9919#Path">Path</a>, offset, and subtracted from <a href="bmh_SkPath_Reference?cl=9919#Path">Path</a>, then added at
4807the offset location. The result is rendered with one draw call.</div></fiddle-embed></div>
4808
4809---
4810
4811<a name="getPosTextPath"></a>
4812## getPosTextPath
4813
4814<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
4815void getPosTextPath(const void* text, size_t length, const SkPoint pos[],
4816 SkPath* path) const
4817</pre>
4818
4819Returns the geometry as <a href="bmh_SkPath_Reference?cl=9919#Path">Path</a> equivalent to the drawn <a href="bmh_SkPaint_Reference?cl=9919#text">text</a>.
4820Uses <a href="bmh_SkPaint_Reference?cl=9919#Text_Encoding">Text Encoding</a> to decode <a href="bmh_SkPaint_Reference?cl=9919#text">text</a>, <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a> to get the glyph paths,
4821and <a href="bmh_SkPaint_Reference?cl=9919#Text_Size">Text Size</a>, <a href="bmh_SkPaint_Reference?cl=9919#Fake_Bold">Fake Bold</a>, and <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a> to scale and modify the glyph paths.
4822All of the glyph paths are stored in <a href="bmh_SkPaint_Reference?cl=9919#path">path</a>.
4823Uses <a href="bmh_SkPaint_Reference?cl=9919#pos">pos</a> array and <a href="bmh_SkPaint_Reference?cl=9919#Text_Align">Text Align</a> to position <a href="bmh_SkPaint_Reference?cl=9919#path">path</a>.
4824<a href="bmh_SkPaint_Reference?cl=9919#pos">pos</a> contains a position for each glyph.
4825
4826### Parameters
4827
4828<table> <tr> <td><code><strong>text </strong></code></td> <td>
4829character codes or glyph indices</td>
4830 </tr> <tr> <td><code><strong>length </strong></code></td> <td>
4831number of bytes of <a href="bmh_SkPaint_Reference?cl=9919#text">text</a></td>
4832 </tr> <tr> <td><code><strong>pos </strong></code></td> <td>
4833positions of each glyph</td>
4834 </tr> <tr> <td><code><strong>path </strong></code></td> <td>
4835geometry of the glyphs</td>
4836 </tr>
4837</table>
4838
4839### Example
4840
4841<div><fiddle-embed name="7f27c93472aa99a7542fb3493076f072"><div>Simplifies three glyphs to eliminate overlaps, and strokes the result.</div></fiddle-embed></div>
4842
4843---
4844
4845# <a name="Text_Intercepts"></a> Text Intercepts
4846<a href="bmh_SkPaint_Reference?cl=9919#Text_Intercepts">Text Intercepts</a> describe the intersection of drawn text glyphs with a pair
4847of lines parallel to the text advance. <a href="bmh_SkPaint_Reference?cl=9919#Text_Intercepts">Text Intercepts</a> permits creating a
4848underline that skips descenders.
4849
4850<a name="getTextIntercepts"></a>
4851## getTextIntercepts
4852
4853<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
4854int getTextIntercepts(const void* text, size_t length, SkScalar x, SkScalar y,
4855 const SkScalar bounds[2], SkScalar* intervals) const
4856</pre>
4857
4858Returns the number of <a href="bmh_SkPaint_Reference?cl=9919#intervals">intervals</a> that intersect <a href="bmh_SkPaint_Reference?cl=9919#bounds">bounds</a>.
4859<a href="bmh_SkPaint_Reference?cl=9919#bounds">bounds</a> describes a pair of lines parallel to the <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> advance.
4860The return count is zero or a multiple of two, and is at most twice the number of glyphs in
4861the string.
4862Uses <a href="bmh_SkPaint_Reference?cl=9919#Text_Encoding">Text Encoding</a> to decode <a href="bmh_SkPaint_Reference?cl=9919#text">text</a>, <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a> to get the glyph paths,
4863and <a href="bmh_SkPaint_Reference?cl=9919#Text_Size">Text Size</a>, <a href="bmh_SkPaint_Reference?cl=9919#Fake_Bold">Fake Bold</a>, and <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a> to scale and modify the glyph paths.
4864Uses <a href="bmh_SkPaint_Reference?cl=9919#x">x</a>, <a href="bmh_SkPaint_Reference?cl=9919#y">y</a>, and <a href="bmh_SkPaint_Reference?cl=9919#Text_Align">Text Align</a> to position <a href="bmh_SkPaint_Reference?cl=9919#intervals">intervals</a>.
4865Pass nullptr for <a href="bmh_SkPaint_Reference?cl=9919#intervals">intervals</a> to determine the size of the interval array.
4866<a href="bmh_SkPaint_Reference?cl=9919#intervals">intervals</a> are cached to improve performance for multiple calls.
4867
4868### Parameters
4869
4870<table> <tr> <td><code><strong>text </strong></code></td> <td>
4871character codes or glyph indices</td>
4872 </tr> <tr> <td><code><strong>length </strong></code></td> <td>
4873number of bytes of <a href="bmh_SkPaint_Reference?cl=9919#text">text</a></td>
4874 </tr> <tr> <td><code><strong>x </strong></code></td> <td>
4875x-coordinate of the origin of the <a href="bmh_SkPaint_Reference?cl=9919#text">text</a></td>
4876 </tr> <tr> <td><code><strong>y </strong></code></td> <td>
4877y-coordinate of the origin of the <a href="bmh_SkPaint_Reference?cl=9919#text">text</a></td>
4878 </tr> <tr> <td><code><strong>bounds </strong></code></td> <td>
4879lower and upper line parallel to the advance</td>
4880 </tr> <tr> <td><code><strong>intervals </strong></code></td> <td>
4881returned intersections; may be nullptr</td>
4882 </tr>
4883</table>
4884
4885### Return Value
4886
4887number of intersections; may be zero
4888
4889### Example
4890
4891<div><fiddle-embed name="2a0b80ed20d193c688085b79deb5bdc9"><div>Underline uses intercepts to draw on either side of the glyph descender.</div></fiddle-embed></div>
4892
4893---
4894
4895<a name="getPosTextIntercepts"></a>
4896## getPosTextIntercepts
4897
4898<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
4899int getPosTextIntercepts(const void* text, size_t length, const SkPoint pos[],
4900 const SkScalar bounds[2], SkScalar* intervals) const
4901</pre>
4902
4903Returns the number of <a href="bmh_SkPaint_Reference?cl=9919#intervals">intervals</a> that intersect <a href="bmh_SkPaint_Reference?cl=9919#bounds">bounds</a>.
4904<a href="bmh_SkPaint_Reference?cl=9919#bounds">bounds</a> describes a pair of lines parallel to the <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> advance.
4905The return count is zero or a multiple of two, and is at most twice the number of glyphs in
4906the string.
4907Uses <a href="bmh_SkPaint_Reference?cl=9919#Text_Encoding">Text Encoding</a> to decode <a href="bmh_SkPaint_Reference?cl=9919#text">text</a>, <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a> to get the glyph paths,
4908and <a href="bmh_SkPaint_Reference?cl=9919#Text_Size">Text Size</a>, <a href="bmh_SkPaint_Reference?cl=9919#Fake_Bold">Fake Bold</a>, and <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a> to scale and modify the glyph paths.
4909Uses <a href="bmh_SkPaint_Reference?cl=9919#pos">pos</a> array and <a href="bmh_SkPaint_Reference?cl=9919#Text_Align">Text Align</a> to position <a href="bmh_SkPaint_Reference?cl=9919#intervals">intervals</a>.
4910Pass nullptr for <a href="bmh_SkPaint_Reference?cl=9919#intervals">intervals</a> to determine the size of the interval array.
4911<a href="bmh_SkPaint_Reference?cl=9919#intervals">intervals</a> are cached to improve performance for multiple calls.
4912
4913### Parameters
4914
4915<table> <tr> <td><code><strong>text </strong></code></td> <td>
4916character codes or glyph indices</td>
4917 </tr> <tr> <td><code><strong>length </strong></code></td> <td>
4918number of bytes of <a href="bmh_SkPaint_Reference?cl=9919#text">text</a></td>
4919 </tr> <tr> <td><code><strong>pos </strong></code></td> <td>
4920positions of each glyph</td>
4921 </tr> <tr> <td><code><strong>bounds </strong></code></td> <td>
4922lower and upper line parallel to the advance</td>
4923 </tr> <tr> <td><code><strong>intervals </strong></code></td> <td>
4924returned intersections; may be nullptr</td>
4925 </tr>
4926</table>
4927
4928### Return Value
4929
4930The number of intersections; may be zero
4931
4932### Example
4933
4934<div><fiddle-embed name="98b2dfc552d0540a7c041fe7a2839bd7"><div><a href="bmh_undocumented?cl=9919#Text">Text</a> intercepts draw on either side of, but not inside, glyphs in a run.</div></fiddle-embed></div>
4935
4936---
4937
4938<a name="getPosTextHIntercepts"></a>
4939## getPosTextHIntercepts
4940
4941<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
4942int getPosTextHIntercepts(const void* text, size_t length, const SkScalar xpos[],
4943 SkScalar constY, const SkScalar bounds[2],
4944 SkScalar* intervals) const
4945</pre>
4946
4947Returns the number of <a href="bmh_SkPaint_Reference?cl=9919#intervals">intervals</a> that intersect <a href="bmh_SkPaint_Reference?cl=9919#bounds">bounds</a>.
4948<a href="bmh_SkPaint_Reference?cl=9919#bounds">bounds</a> describes a pair of lines parallel to the <a href="bmh_SkPaint_Reference?cl=9919#text">text</a> advance.
4949The return count is zero or a multiple of two, and is at most twice the number of glyphs in
4950the string.
4951Uses <a href="bmh_SkPaint_Reference?cl=9919#Text_Encoding">Text Encoding</a> to decode <a href="bmh_SkPaint_Reference?cl=9919#text">text</a>, <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a> to get the glyph paths,
4952and <a href="bmh_SkPaint_Reference?cl=9919#Text_Size">Text Size</a>, <a href="bmh_SkPaint_Reference?cl=9919#Fake_Bold">Fake Bold</a>, and <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a> to scale and modify the glyph paths.
4953Uses <a href="bmh_SkPaint_Reference?cl=9919#xpos">xpos</a> array, <a href="bmh_SkPaint_Reference?cl=9919#constY">constY</a>, and <a href="bmh_SkPaint_Reference?cl=9919#Text_Align">Text Align</a> to position <a href="bmh_SkPaint_Reference?cl=9919#intervals">intervals</a>.
4954Pass nullptr for <a href="bmh_SkPaint_Reference?cl=9919#intervals">intervals</a> to determine the size of the interval array.
4955<a href="bmh_SkPaint_Reference?cl=9919#intervals">intervals</a> are cached to improve performance for multiple calls.
4956
4957### Parameters
4958
4959<table> <tr> <td><code><strong>text </strong></code></td> <td>
4960character codes or glyph indices</td>
4961 </tr> <tr> <td><code><strong>length </strong></code></td> <td>
4962number of bytes of <a href="bmh_SkPaint_Reference?cl=9919#text">text</a></td>
4963 </tr> <tr> <td><code><strong>xpos </strong></code></td> <td>
4964positions of each glyph in x</td>
4965 </tr> <tr> <td><code><strong>constY </strong></code></td> <td>
4966position of each glyph in y</td>
4967 </tr> <tr> <td><code><strong>bounds </strong></code></td> <td>
4968lower and upper line parallel to the advance</td>
4969 </tr> <tr> <td><code><strong>intervals </strong></code></td> <td>
4970returned intersections; may be nullptr</td>
4971 </tr>
4972</table>
4973
4974### Return Value
4975
4976number of intersections; may be zero
4977
4978### Example
4979
4980<div><fiddle-embed name="dc9851c43acc3716aca8c9a4d40d452d"><div><a href="bmh_undocumented?cl=9919#Text">Text</a> intercepts do not take stroke thickness into consideration.</div></fiddle-embed></div>
4981
4982---
4983
4984<a name="getTextBlobIntercepts"></a>
4985## getTextBlobIntercepts
4986
4987<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
4988int getTextBlobIntercepts(const SkTextBlob* blob, const SkScalar bounds[2],
4989 SkScalar* intervals) const
4990</pre>
4991
4992Returns the number of <a href="bmh_SkPaint_Reference?cl=9919#intervals">intervals</a> that intersect <a href="bmh_SkPaint_Reference?cl=9919#bounds">bounds</a>.
4993<a href="bmh_SkPaint_Reference?cl=9919#bounds">bounds</a> describes a pair of lines parallel to the text advance.
4994The return count is zero or a multiple of two, and is at most twice the number of glyphs in
4995the string.
4996Uses <a href="bmh_SkPaint_Reference?cl=9919#Text_Encoding">Text Encoding</a> to decode text, <a href="bmh_undocumented?cl=9919#Typeface">Typeface</a> to get the glyph paths,
4997and <a href="bmh_SkPaint_Reference?cl=9919#Text_Size">Text Size</a>, <a href="bmh_SkPaint_Reference?cl=9919#Fake_Bold">Fake Bold</a>, and <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a> to scale and modify the glyph paths.
4998Uses pos array and <a href="bmh_SkPaint_Reference?cl=9919#Text_Align">Text Align</a> to position <a href="bmh_SkPaint_Reference?cl=9919#intervals">intervals</a>.
4999Pass nullptr for <a href="bmh_SkPaint_Reference?cl=9919#intervals">intervals</a> to determine the size of the interval array.
5000<a href="bmh_SkPaint_Reference?cl=9919#intervals">intervals</a> are cached to improve performance for multiple calls.
5001
5002### Parameters
5003
5004<table> <tr> <td><code><strong>blob </strong></code></td> <td>
5005glyphs, positions, and text paint attributes</td>
5006 </tr> <tr> <td><code><strong>bounds </strong></code></td> <td>
5007lower and upper line parallel to the advance</td>
5008 </tr> <tr> <td><code><strong>intervals </strong></code></td> <td>
5009returned intersections; may be nullptr</td>
5010 </tr>
5011</table>
5012
5013### Return Value
5014
5015number of intersections; may be zero
5016
5017### Example
5018
5019<div><fiddle-embed name="4961b05f4f26cf270ab4948a57876341"></fiddle-embed></div>
5020
5021---
5022
5023<a name="nothingToDraw"></a>
5024## nothingToDraw
5025
5026<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
5027bool nothingToDraw() const
5028</pre>
5029
5030Returns true if <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> prevents all drawing.
5031If <a href="bmh_SkPaint_Reference?cl=9919#nothingToDraw">nothingToDraw</a> returns false, the <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> may or may not allow drawing.
5032
5033Returns true if <a href="bmh_undocumented?cl=9919#Blend_Mode">Blend Mode</a> and <a href="bmh_undocumented?cl=9919#Alpha">Color Alpha</a> are enabled,
5034and computed <a href="bmh_undocumented?cl=9919#Alpha">Color Alpha</a> is zero.
5035
5036### Return Value
5037
5038true if <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> prevents all drawing
5039
5040### Example
5041
5042<div><fiddle-embed name="fc5a771b915ac341f56554f01d282831">
5043
5044#### Example Output
5045
5046~~~~
5047initial nothing to draw: false
5048blend dst nothing to draw: true
5049blend src over nothing to draw: false
5050alpha 0 nothing to draw: true
5051~~~~
5052
5053</fiddle-embed></div>
5054
5055---
5056
5057# <a name="Fast_Bounds"></a> Fast Bounds
5058<a href="bmh_SkPaint_Reference?cl=9919#Fast_Bounds">Fast Bounds</a> methods conservatively outset a drawing bounds by additional area
5059<a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> may draw to.
5060
5061<a name="canComputeFastBounds"></a>
5062## canComputeFastBounds
5063
5064<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
5065bool canComputeFastBounds() const
5066</pre>
5067
5068Returns true if <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> does not include elements requiring extensive computation
5069to compute <a href="bmh_undocumented?cl=9919#Device">Device</a> bounds of drawn geometry. For instance, <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> with <a href="bmh_undocumented?cl=9919#Path_Effect">Path Effect</a>
5070always returns false.
5071
5072### Return Value
5073
5074true if <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> allows for fast computation of bounds
5075
5076---
5077
5078<a name="computeFastBounds"></a>
5079## computeFastBounds
5080
5081<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
5082const SkRect& computeFastBounds(const SkRect& orig, SkRect* storage) const
5083</pre>
5084
5085Only call this if <a href="bmh_SkPaint_Reference?cl=9919#canComputeFastBounds">canComputeFastBounds</a> returned true. This takes a
5086raw rectangle (the raw bounds of a shape), and adjusts it for stylistic
5087effects in the paint (e.g. stroking). If needed, it uses the <a href="bmh_SkPaint_Reference?cl=9919#storage">storage</a>
5088rect parameter. It returns the adjusted bounds that can then be used
5089for <a href="bmh_SkCanvas_Reference?cl=9919#quickReject">SkCanvas::quickReject</a> tests.
5090
5091The returned rect will either be <a href="bmh_SkPaint_Reference?cl=9919#orig">orig</a> or <a href="bmh_SkPaint_Reference?cl=9919#storage">storage</a>, thus the caller
5092should not rely on <a href="bmh_SkPaint_Reference?cl=9919#storage">storage</a> being set to the result, but should always
5093use the retured value. It is legal for <a href="bmh_SkPaint_Reference?cl=9919#orig">orig</a> and <a href="bmh_SkPaint_Reference?cl=9919#storage">storage</a> to be the same
5094rect.
5095
5096### Parameters
5097
5098<table> <tr> <td><code><strong>orig </strong></code></td> <td>
5099geometry modified by <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> when drawn</td>
5100 </tr> <tr> <td><code><strong>storage </strong></code></td> <td>
5101computed bounds of geometry; may not be nullptr</td>
5102 </tr>
5103</table>
5104
5105### Return Value
5106
5107fast computed bounds
5108
5109---
5110
5111<a name="computeFastStrokeBounds"></a>
5112## computeFastStrokeBounds
5113
5114<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
5115const SkRect& computeFastStrokeBounds(const SkRect& orig, SkRect* storage) const
5116</pre>
5117
5118### Parameters
5119
5120<table> <tr> <td><code><strong>orig </strong></code></td> <td>
5121geometry modified by <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> when drawn</td>
5122 </tr> <tr> <td><code><strong>storage </strong></code></td> <td>
5123computed bounds of geometry</td>
5124 </tr>
5125</table>
5126
5127### Return Value
5128
5129fast computed bounds
5130
5131---
5132
5133<a name="doComputeFastBounds"></a>
5134## doComputeFastBounds
5135
5136<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
5137const SkRect& doComputeFastBounds(const SkRect& orig, SkRect* storage,
5138 Style style) const
5139</pre>
5140
5141Take the <a href="bmh_SkPaint_Reference?cl=9919#style">style</a> explicitly, so the caller can force us to be stroked
5142without having to make a copy of the paint just to change that field.
5143
5144### Parameters
5145
5146<table> <tr> <td><code><strong>orig </strong></code></td> <td>
5147geometry modified by <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> when drawn</td>
5148 </tr> <tr> <td><code><strong>storage </strong></code></td> <td>
5149computed bounds of geometry</td>
5150 </tr> <tr> <td><code><strong>style </strong></code></td> <td>
5151overrides <a href="bmh_SkPaint_Reference?cl=9919#Style">Style</a></td>
5152 </tr>
5153</table>
5154
5155### Return Value
5156
5157fast computed bounds
5158
5159---
5160
5161<a name="toString"></a>
5162## toString
5163
5164<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
5165void toString(SkString* str) const;
5166</pre>
5167
5168Converts <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a> to machine parsable form in developer mode.
5169
5170### Parameters
5171
5172<table> <tr> <td><code><strong>str </strong></code></td> <td>
5173storage for string containing parsable <a href="bmh_SkPaint_Reference?cl=9919#Paint">Paint</a></td>
5174 </tr>
5175</table>
5176
5177### Example
5178
5179<div><fiddle-embed name="5670c04b4562908169a776c48c92d104">
5180
5181#### Example Output
5182
5183~~~~
5184text size = 12
5185~~~~
5186
5187</fiddle-embed></div>
5188
5189---
5190