diff options
-rw-r--r-- | docs/SkCanvas_Reference.bmh | 100 | ||||
-rw-r--r-- | docs/SkPaint_Reference.bmh | 2 | ||||
-rw-r--r-- | docs/usingBookmaker.bmh | 2 | ||||
-rw-r--r-- | include/core/SkCanvas.h | 28 | ||||
-rw-r--r-- | site/user/api/SkBlendMode_Reference.md | 2 | ||||
-rw-r--r-- | site/user/api/SkCanvas_Reference.md | 102 | ||||
-rw-r--r-- | site/user/api/SkPaint_Reference.md | 6 | ||||
-rw-r--r-- | site/user/api/catalog.htm | 29 | ||||
-rw-r--r-- | site/user/api/usingBookmaker.md | 2 | ||||
-rw-r--r-- | src/core/SkCanvas.cpp | 2 | ||||
-rw-r--r-- | tools/bookmaker/parserCommon.cpp | 2 |
11 files changed, 239 insertions, 38 deletions
diff --git a/docs/SkCanvas_Reference.bmh b/docs/SkCanvas_Reference.bmh index fc6093cf7a..cfeef6331b 100644 --- a/docs/SkCanvas_Reference.bmh +++ b/docs/SkCanvas_Reference.bmh @@ -5752,7 +5752,105 @@ void draw(SkCanvas* canvas) { SkShader::kClamp_TileMode)); auto vertices = SkVertices::MakeCopy(SkVertices::kTriangleFan_VertexMode, SK_ARRAY_COUNT(points), points, texs, colors); - canvas->drawVertices(vertices.get(), SkBlendMode::kDarken, paint); + canvas->drawVertices(vertices, SkBlendMode::kDarken, paint); +} +## + +#SeeAlso drawPatch drawPicture + +## + +# ------------------------------------------------------------------------------ + +#Method void drawVertices(const SkVertices* vertices, const SkMatrix* bones, int boneCount, + SkBlendMode mode, const SkPaint& paint) + +Draw Vertices vertices, a triangle mesh, using Clip and Matrix. Bone data is used to +deform vertices with bone weights. +If Vertices_Texs and Vertices_Colors are defined in vertices, and Paint paint +contains Shader, Blend_Mode mode combines Vertices_Colors with Shader. +The first element of bones should be an object to world space transformation matrix that +will be applied before performing mesh deformations. If no such transformation is needed, +it should be the identity matrix. + +#Param vertices triangle mesh to draw ## +#Param bones bone matrix data ## +#Param boneCount number of bone matrices ## +#Param mode combines Vertices_Colors with Shader, if both are present ## +#Param paint specifies the Shader, used as Vertices texture, may be nullptr ## + +#Example +void draw(SkCanvas* canvas) { + SkPaint paint; + SkPoint points[] = { { 0, 0 }, { 250, 0 }, { 100, 100 }, { 0, 250 } }; + SkPoint texs[] = { { 0, 0 }, { 0, 250 }, { 250, 250 }, { 250, 0 } }; + SkColor colors[] = { SK_ColorRED, SK_ColorBLUE, SK_ColorYELLOW, SK_ColorCYAN }; + SkVertices::BoneIndices boneIndices[] = { { 0, 0, 0, 0 }, + { 1, 0, 0, 0 }, + { 2, 0, 0, 0 }, + { 3, 0, 0, 0 } }; + SkVertices::BoneWeights boneWeights[] = { { 0.0f, 0.0f, 0.0f, 0.0f }, + { 1.0f, 0.0f, 0.0f, 0.0f }, + { 1.0f, 0.0f, 0.0f, 0.0f }, + { 1.0f, 0.0f, 0.0f, 0.0f } }; + SkMatrix bones[] = { SkMatrix::I(), + SkMatrix::MakeTrans(0, 20), + SkMatrix::MakeTrans(50, 50), + SkMatrix::MakeTrans(20, 0) }; + paint.setShader(SkGradientShader::MakeLinear(points, colors, nullptr, 4, + SkShader::kClamp_TileMode)); + auto vertices = SkVertices::MakeCopy(SkVertices::kTriangleFan_VertexMode, + SK_ARRAY_COUNT(points), points, texs, colors, boneIndices, boneWeights); + canvas->drawVertices(vertices.get(), bones, SK_ARRAY_COUNT(bones), SkBlendMode::kDarken, paint); +} +## + +#SeeAlso drawPatch drawPicture + +## + +# ------------------------------------------------------------------------------ + +#Method void drawVertices(const sk_sp<SkVertices>& vertices, const SkMatrix* bones, int boneCount, + SkBlendMode mode, const SkPaint& paint) + +Draw Vertices vertices, a triangle mesh, using Clip and Matrix. Bone data is used to +deform vertices with bone weights. +If Vertices_Texs and Vertices_Colors are defined in vertices, and Paint paint +contains Shader, Blend_Mode mode combines Vertices_Colors with Shader. +The first element of bones should be an object to world space transformation matrix that +will be applied before performing mesh deformations. If no such transformation is needed, +it should be the identity matrix. + +#Param vertices triangle mesh to draw ## +#Param bones bone matrix data ## +#Param boneCount number of bone matrices ## +#Param mode combines Vertices_Colors with Shader, if both are present ## +#Param paint specifies the Shader, used as Vertices texture, may be nullptr ## + +#Example +void draw(SkCanvas* canvas) { + SkPaint paint; + SkPoint points[] = { { 0, 0 }, { 250, 0 }, { 100, 100 }, { 0, 250 } }; + SkPoint texs[] = { { 0, 0 }, { 0, 250 }, { 250, 250 }, { 250, 0 } }; + SkColor colors[] = { SK_ColorRED, SK_ColorBLUE, SK_ColorYELLOW, SK_ColorCYAN }; + SkVertices::BoneIndices boneIndices[] = { { 0, 0, 0, 0 }, + { 1, 0, 0, 0 }, + { 2, 0, 0, 0 }, + { 3, 0, 0, 0 } }; + SkVertices::BoneWeights boneWeights[] = { { 0.0f, 0.0f, 0.0f, 0.0f }, + { 1.0f, 0.0f, 0.0f, 0.0f }, + { 1.0f, 0.0f, 0.0f, 0.0f }, + { 1.0f, 0.0f, 0.0f, 0.0f } }; + SkMatrix bones[] = { SkMatrix::I(), + SkMatrix::MakeTrans(0, 20), + SkMatrix::MakeTrans(50, 50), + SkMatrix::MakeTrans(20, 0) }; + paint.setShader(SkGradientShader::MakeLinear(points, colors, nullptr, 4, + SkShader::kClamp_TileMode)); + auto vertices = SkVertices::MakeCopy(SkVertices::kTriangleFan_VertexMode, + SK_ARRAY_COUNT(points), points, texs, colors, boneIndices, boneWeights); + canvas->drawVertices(vertices, bones, SK_ARRAY_COUNT(bones), SkBlendMode::kDarken, paint); } ## diff --git a/docs/SkPaint_Reference.bmh b/docs/SkPaint_Reference.bmh index 21521af798..2b844fc9eb 100644 --- a/docs/SkPaint_Reference.bmh +++ b/docs/SkPaint_Reference.bmh @@ -4394,7 +4394,7 @@ text contains an invalid UTF-8 sequence, zero is returned. #Return true if all text corresponds to a non-zero glyph index ## - #Example + #NoExample #Description containsText succeeds for degree symbol, but cannot find a glyph index corresponding to the Unicode surrogate code point. diff --git a/docs/usingBookmaker.bmh b/docs/usingBookmaker.bmh index d804a3e37f..236c16d7c5 100644 --- a/docs/usingBookmaker.bmh +++ b/docs/usingBookmaker.bmh @@ -122,7 +122,7 @@ Get the fiddle command line interface tool. By default this will appear in your home directory. #Code -$ go get go.skia.org/infra/fiddle/go/fiddlecli +$ go get go.skia.org/infra/fiddlek/go/fiddlecli ## Build Bookmaker. diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h index 15ed034db6..90e51e9b0e 100644 --- a/include/core/SkCanvas.h +++ b/include/core/SkCanvas.h @@ -6,7 +6,7 @@ */ /* Generated by tools/bookmaker from include/core/SkCanvas.h and docs/SkCanvas_Reference.bmh - on 2018-06-14 13:13:33. Additional documentation and examples can be found at: + on 2018-07-02 10:27:08. Additional documentation and examples can be found at: https://skia.org/user/api/SkCanvas_Reference You may edit either file directly. Structural changes to public interfaces require @@ -2157,11 +2157,11 @@ public: will be applied before performing mesh deformations. If no such transformation is needed, it should be the identity matrix. - @param vertices triangle mesh to draw - @param bones bone matrix data - @param boneCount number of bone matrices - @param mode combines vertices colors with SkShader, if both are present - @param paint specifies the SkShader, used as SkVertices texture, may be nullptr + @param vertices triangle mesh to draw + @param bones bone matrix data + @param boneCount number of bone matrices + @param mode combines vertices colors with SkShader, if both are present + @param paint specifies the SkShader, used as SkVertices texture, may be nullptr */ void drawVertices(const SkVertices* vertices, const SkMatrix* bones, int boneCount, SkBlendMode mode, const SkPaint& paint); @@ -2174,13 +2174,13 @@ public: will be applied before performing mesh deformations. If no such transformation is needed, it should be the identity matrix. - @param vertices triangle mesh to draw - @param bones bone matrix data - @param boneCount number of bone matrices - @param mode combines vertices colors with SkShader, if both are present - @param paint specifies the SkShader, used as SkVertices texture, may be nullptr + @param vertices triangle mesh to draw + @param bones bone matrix data + @param boneCount number of bone matrices + @param mode combines vertices colors with SkShader, if both are present + @param paint specifies the SkShader, used as SkVertices texture, may be nullptr */ - void drawVertices(const sk_sp<SkVertices> vertices, const SkMatrix* bones, int boneCount, + void drawVertices(const sk_sp<SkVertices>& vertices, const SkMatrix* bones, int boneCount, SkBlendMode mode, const SkPaint& paint); /** Draws a Coons patch: the interpolation of four cubics with shared corners, @@ -2246,7 +2246,8 @@ public: atlas, and SkRSXform xform transforms it into destination space. xform, text, and colors if present, must contain count entries. - Optional colors are applied for each sprite using SkBlendMode. + Optional colors are applied for each sprite using SkBlendMode mode, treating + sprite as source and colors as destination. Optional cullRect is a conservative bounds of all transformed sprites. If cullRect is outside of clip, canvas can skip drawing. @@ -2782,6 +2783,7 @@ private: */ class SkAutoCanvasRestore { public: + /** Preserves SkCanvas save count. Optionally saves SkCanvas clip and SkCanvas matrix. @param canvas SkCanvas to guard diff --git a/site/user/api/SkBlendMode_Reference.md b/site/user/api/SkBlendMode_Reference.md index d860b27e55..80e98b474f 100644 --- a/site/user/api/SkBlendMode_Reference.md +++ b/site/user/api/SkBlendMode_Reference.md @@ -559,7 +559,7 @@ Used by tests to iterate through all valid values. ### See Also -<a href='SkCanvas_Reference#SkCanvas_drawColor'>SkCanvas::drawColor</a> <a href='SkCanvas_Reference#SkCanvas_drawVertices'>SkCanvas::drawVertices</a><sup><a href='SkCanvas_Reference#SkCanvas_drawVertices_2'>[2]</a></sup> <a href='SkPaint_Reference#SkPaint'>SkPaint</a> <a href='undocumented#SkShader_MakeCompose'>SkShader::MakeCompose</a> <a href='undocumented#SkXfermodeImageFilter'>SkXfermodeImageFilter</a> +<a href='SkCanvas_Reference#SkCanvas_drawColor'>SkCanvas::drawColor</a> <a href='SkCanvas_Reference#SkCanvas_drawVertices'>SkCanvas::drawVertices</a><sup><a href='SkCanvas_Reference#SkCanvas_drawVertices_2'>[2]</a></sup><sup><a href='SkCanvas_Reference#SkCanvas_drawVertices_3'>[3]</a></sup><sup><a href='SkCanvas_Reference#SkCanvas_drawVertices_4'>[4]</a></sup> <a href='SkPaint_Reference#SkPaint'>SkPaint</a> <a href='undocumented#SkShader_MakeCompose'>SkShader::MakeCompose</a> <a href='undocumented#SkXfermodeImageFilter'>SkXfermodeImageFilter</a> ## <a name='Clear'>Clear</a> diff --git a/site/user/api/SkCanvas_Reference.md b/site/user/api/SkCanvas_Reference.md index bbf12ba281..1656128411 100644 --- a/site/user/api/SkCanvas_Reference.md +++ b/site/user/api/SkCanvas_Reference.md @@ -3799,6 +3799,14 @@ device bounds empty = true <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawVertices_2'>drawVertices(const sk sp<SkVertices>& vertices, SkBlendMode mode, const SkPaint& paint)</a></td> </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawVertices_3'>drawVertices(const SkVertices* vertices, const SkMatrix* bones, int boneCount, SkBlendMode mode, const SkPaint& paint)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawVertices_4'>drawVertices(const sk sp<SkVertices>& vertices, const SkMatrix* bones, int boneCount, SkBlendMode mode, const SkPaint& paint)</a></td> + </tr> </table> <a name='SkCanvas_drawColor'></a> @@ -6507,7 +6515,95 @@ contains <a href='undocumented#Shader'>Shader</a>, <a href='SkBlendMode_Referenc ### Example -<div><fiddle-embed name="94e32538646d5f1299c427e473f9ec87"></fiddle-embed></div> +<div><fiddle-embed name="e8bdae9bea3227758989028424fcac3d"></fiddle-embed></div> + +### See Also + +<a href='#SkCanvas_drawPatch'>drawPatch</a><sup><a href='#SkCanvas_drawPatch_2'>[2]</a></sup> <a href='#SkCanvas_drawPicture'>drawPicture</a><sup><a href='#SkCanvas_drawPicture_2'>[2]</a></sup><sup><a href='#SkCanvas_drawPicture_3'>[3]</a></sup><sup><a href='#SkCanvas_drawPicture_4'>[4]</a></sup> + +--- + +<a name='SkCanvas_drawVertices_3'></a> + +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawVertices'>drawVertices</a>(const <a href='undocumented#SkVertices'>SkVertices</a>* vertices, const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>* bones, int boneCount, <a href='SkBlendMode_Reference#SkBlendMode'>SkBlendMode</a> mode, + const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& paint) +</pre> + +<a href='#Draw'>Draw</a> <a href='undocumented#Vertices'>Vertices</a> <a href='#SkCanvas_drawVertices_3_vertices'>vertices</a>, a triangle mesh, using <a href='#Clip'>Clip</a> and <a href='#Matrix'>Matrix</a>. Bone data is used to +deform <a href='#SkCanvas_drawVertices_3_vertices'>vertices</a> with bone weights. +If <a href='undocumented#Texs'>Vertices Texs</a> and <a href='undocumented#Colors'>Vertices Colors</a> are defined in <a href='#SkCanvas_drawVertices_3_vertices'>vertices</a>, and <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawVertices_3_paint'>paint</a> +contains <a href='undocumented#Shader'>Shader</a>, <a href='SkBlendMode_Reference#Blend_Mode'>Blend Mode</a> <a href='#SkCanvas_drawVertices_3_mode'>mode</a> combines <a href='undocumented#Colors'>Vertices Colors</a> with <a href='undocumented#Shader'>Shader</a>. +The first element of <a href='#SkCanvas_drawVertices_3_bones'>bones</a> should be an object to world space transformation matrix that +will be applied before performing mesh deformations. If no such transformation is needed, +it should be the identity matrix. + +### Parameters + +<table> <tr> <td><a name='SkCanvas_drawVertices_3_vertices'><code><strong>vertices</strong></code></a></td> + <td>triangle mesh to draw</td> + </tr> + <tr> <td><a name='SkCanvas_drawVertices_3_bones'><code><strong>bones</strong></code></a></td> + <td>bone matrix data</td> + </tr> + <tr> <td><a name='SkCanvas_drawVertices_3_boneCount'><code><strong>boneCount</strong></code></a></td> + <td>number of bone matrices</td> + </tr> + <tr> <td><a name='SkCanvas_drawVertices_3_mode'><code><strong>mode</strong></code></a></td> + <td>combines <a href='undocumented#Colors'>Vertices Colors</a> with <a href='undocumented#Shader'>Shader</a>, if both are present</td> + </tr> + <tr> <td><a name='SkCanvas_drawVertices_3_paint'><code><strong>paint</strong></code></a></td> + <td>specifies the <a href='undocumented#Shader'>Shader</a>, used as <a href='undocumented#Vertices'>Vertices</a> texture, may be nullptr</td> + </tr> +</table> + +### Example + +<div><fiddle-embed name="7db6ad6b01931d713d7390736239001b"></fiddle-embed></div> + +### See Also + +<a href='#SkCanvas_drawPatch'>drawPatch</a><sup><a href='#SkCanvas_drawPatch_2'>[2]</a></sup> <a href='#SkCanvas_drawPicture'>drawPicture</a><sup><a href='#SkCanvas_drawPicture_2'>[2]</a></sup><sup><a href='#SkCanvas_drawPicture_3'>[3]</a></sup><sup><a href='#SkCanvas_drawPicture_4'>[4]</a></sup> + +--- + +<a name='SkCanvas_drawVertices_4'></a> + +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawVertices'>drawVertices</a>(const <a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkVertices'>SkVertices</a>>& vertices, const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>* bones, int boneCount, + <a href='SkBlendMode_Reference#SkBlendMode'>SkBlendMode</a> mode, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& paint) +</pre> + +<a href='#Draw'>Draw</a> <a href='undocumented#Vertices'>Vertices</a> <a href='#SkCanvas_drawVertices_4_vertices'>vertices</a>, a triangle mesh, using <a href='#Clip'>Clip</a> and <a href='#Matrix'>Matrix</a>. Bone data is used to +deform <a href='#SkCanvas_drawVertices_4_vertices'>vertices</a> with bone weights. +If <a href='undocumented#Texs'>Vertices Texs</a> and <a href='undocumented#Colors'>Vertices Colors</a> are defined in <a href='#SkCanvas_drawVertices_4_vertices'>vertices</a>, and <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawVertices_4_paint'>paint</a> +contains <a href='undocumented#Shader'>Shader</a>, <a href='SkBlendMode_Reference#Blend_Mode'>Blend Mode</a> <a href='#SkCanvas_drawVertices_4_mode'>mode</a> combines <a href='undocumented#Colors'>Vertices Colors</a> with <a href='undocumented#Shader'>Shader</a>. +The first element of <a href='#SkCanvas_drawVertices_4_bones'>bones</a> should be an object to world space transformation matrix that +will be applied before performing mesh deformations. If no such transformation is needed, +it should be the identity matrix. + +### Parameters + +<table> <tr> <td><a name='SkCanvas_drawVertices_4_vertices'><code><strong>vertices</strong></code></a></td> + <td>triangle mesh to draw</td> + </tr> + <tr> <td><a name='SkCanvas_drawVertices_4_bones'><code><strong>bones</strong></code></a></td> + <td>bone matrix data</td> + </tr> + <tr> <td><a name='SkCanvas_drawVertices_4_boneCount'><code><strong>boneCount</strong></code></a></td> + <td>number of bone matrices</td> + </tr> + <tr> <td><a name='SkCanvas_drawVertices_4_mode'><code><strong>mode</strong></code></a></td> + <td>combines <a href='undocumented#Colors'>Vertices Colors</a> with <a href='undocumented#Shader'>Shader</a>, if both are present</td> + </tr> + <tr> <td><a name='SkCanvas_drawVertices_4_paint'><code><strong>paint</strong></code></a></td> + <td>specifies the <a href='undocumented#Shader'>Shader</a>, used as <a href='undocumented#Vertices'>Vertices</a> texture, may be nullptr</td> + </tr> +</table> + +### Example + +<div><fiddle-embed name="cc1fc7f3462abc79ec6dec3405e2812d"></fiddle-embed></div> ### See Also @@ -6567,7 +6663,7 @@ may be nullptr</td> ### See Also -SeeAlso <a href='#SkCanvas_drawVertices'>drawVertices</a><sup><a href='#SkCanvas_drawVertices_2'>[2]</a></sup> <a href='#SkCanvas_drawPicture'>drawPicture</a><sup><a href='#SkCanvas_drawPicture_2'>[2]</a></sup><sup><a href='#SkCanvas_drawPicture_3'>[3]</a></sup><sup><a href='#SkCanvas_drawPicture_4'>[4]</a></sup> +SeeAlso <a href='#SkCanvas_drawVertices'>drawVertices</a><sup><a href='#SkCanvas_drawVertices_2'>[2]</a></sup><sup><a href='#SkCanvas_drawVertices_3'>[3]</a></sup><sup><a href='#SkCanvas_drawVertices_4'>[4]</a></sup> <a href='#SkCanvas_drawPicture'>drawPicture</a><sup><a href='#SkCanvas_drawPicture_2'>[2]</a></sup><sup><a href='#SkCanvas_drawPicture_3'>[3]</a></sup><sup><a href='#SkCanvas_drawPicture_4'>[4]</a></sup> --- @@ -6623,7 +6719,7 @@ may be nullptr</td> ### See Also -SeeAlso <a href='#SkCanvas_drawVertices'>drawVertices</a><sup><a href='#SkCanvas_drawVertices_2'>[2]</a></sup> <a href='#SkCanvas_drawPicture'>drawPicture</a><sup><a href='#SkCanvas_drawPicture_2'>[2]</a></sup><sup><a href='#SkCanvas_drawPicture_3'>[3]</a></sup><sup><a href='#SkCanvas_drawPicture_4'>[4]</a></sup> +SeeAlso <a href='#SkCanvas_drawVertices'>drawVertices</a><sup><a href='#SkCanvas_drawVertices_2'>[2]</a></sup><sup><a href='#SkCanvas_drawVertices_3'>[3]</a></sup><sup><a href='#SkCanvas_drawVertices_4'>[4]</a></sup> <a href='#SkCanvas_drawPicture'>drawPicture</a><sup><a href='#SkCanvas_drawPicture_2'>[2]</a></sup><sup><a href='#SkCanvas_drawPicture_3'>[3]</a></sup><sup><a href='#SkCanvas_drawPicture_4'>[4]</a></sup> --- diff --git a/site/user/api/SkPaint_Reference.md b/site/user/api/SkPaint_Reference.md index ae834cb097..3a5a9320b0 100644 --- a/site/user/api/SkPaint_Reference.md +++ b/site/user/api/SkPaint_Reference.md @@ -5443,9 +5443,7 @@ Returns true if <a href='#SkPaint_containsText_byteLength'>byteLength</a> is zer true if all <a href='#SkPaint_containsText_text'>text</a> corresponds to a non-zero glyph index -### Example - -<div><fiddle-embed name="71b417d6651cbcecae1a05067c94ab3e"><div><a href='#SkPaint_containsText'>containsText</a> succeeds for degree symbol, but cannot find a glyph index +<div><a href='#SkPaint_containsText'>containsText</a> succeeds for degree symbol, but cannot find a glyph index corresponding to the Unicode surrogate code point. </div> @@ -5456,8 +5454,6 @@ corresponding to the Unicode surrogate code point. 0xd800 != has char ~~~~ -</fiddle-embed></div> - ### Example <div><fiddle-embed name="083557b6f653d6fc00a34e01f87b74ff"><div><a href='#SkPaint_containsText'>containsText</a> returns true that glyph index is greater than zero, not diff --git a/site/user/api/catalog.htm b/site/user/api/catalog.htm index db6e59418c..e1fe83ea30 100644 --- a/site/user/api/catalog.htm +++ b/site/user/api/catalog.htm @@ -1443,17 +1443,10 @@ "stdout": "[ 1.0000 0.0000 3.0000][ 0.0000 2.0000 4.0000][ 0.0000 0.0000 1.0000]\\n" }, "SkPaint_containsText": { - "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n const uint16_t goodChar = 0x00B0; // degree symbol\n const uint16_t badChar = 0xD800; // Unicode surrogate\n paint.setTextEncoding(SkPaint::kUTF16_TextEncoding);\n SkDebugf(\"0x%04x %c= has char\\n\", goodChar,\n paint.containsText(&goodChar, 2) ? '=' : '!');\n SkDebugf(\"0x%04x %c= has char\\n\", badChar,\n paint.containsText(&badChar, 2) ? '=' : '!');\n}", - "hash": "71b417d6651cbcecae1a05067c94ab3e", - "file": "SkPaint_Reference", - "name": "SkPaint::containsText", - "stdout": "0x00b0 == has char\\n0xd800 != has char\\n" - }, - "SkPaint_containsText_a": { "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n const uint16_t goodGlyph = 511;\n const uint16_t zeroGlyph = 0;\n const uint16_t badGlyph = 65535; // larger than glyph count in font\n paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);\n SkDebugf(\"0x%04x %c= has glyph\\n\", goodGlyph,\n paint.containsText(&goodGlyph, 2) ? '=' : '!');\n SkDebugf(\"0x%04x %c= has glyph\\n\", zeroGlyph,\n paint.containsText(&zeroGlyph, 2) ? '=' : '!');\n SkDebugf(\"0x%04x %c= has glyph\\n\", badGlyph,\n paint.containsText(&badGlyph, 2) ? '=' : '!');\n}", "hash": "083557b6f653d6fc00a34e01f87b74ff", "file": "SkPaint_Reference", - "name": "SkPaint::containsText_2", + "name": "SkPaint::containsText", "stdout": "0x01ff == has glyph\\n0x0000 != has glyph\\n0xffff == has glyph\\n" }, "SkPaint_copy_const_SkPaint": { @@ -5097,13 +5090,29 @@ "name": "SkCanvas::drawVertices" }, "SkCanvas_drawVertices_2": { - "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n SkPoint points[] = { { 0, 0 }, { 250, 0 }, { 100, 100 }, { 0, 250 } };\n SkPoint texs[] = { { 0, 0 }, { 0, 250 }, { 250, 250 }, { 250, 0 } };\n SkColor colors[] = { SK_ColorRED, SK_ColorBLUE, SK_ColorYELLOW, SK_ColorCYAN };\n paint.setShader(SkGradientShader::MakeLinear(points, colors, nullptr, 4,\n SkShader::kClamp_TileMode));\n auto vertices = SkVertices::MakeCopy(SkVertices::kTriangleFan_VertexMode,\n SK_ARRAY_COUNT(points), points, texs, colors);\n canvas->drawVertices(vertices.get(), SkBlendMode::kDarken, paint);\n}\n", + "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n SkPoint points[] = { { 0, 0 }, { 250, 0 }, { 100, 100 }, { 0, 250 } };\n SkPoint texs[] = { { 0, 0 }, { 0, 250 }, { 250, 250 }, { 250, 0 } };\n SkColor colors[] = { SK_ColorRED, SK_ColorBLUE, SK_ColorYELLOW, SK_ColorCYAN };\n paint.setShader(SkGradientShader::MakeLinear(points, colors, nullptr, 4,\n SkShader::kClamp_TileMode));\n auto vertices = SkVertices::MakeCopy(SkVertices::kTriangleFan_VertexMode,\n SK_ARRAY_COUNT(points), points, texs, colors);\n canvas->drawVertices(vertices, SkBlendMode::kDarken, paint);\n}\n", "width": 256, "height": 256, - "hash": "94e32538646d5f1299c427e473f9ec87", + "hash": "e8bdae9bea3227758989028424fcac3d", "file": "SkCanvas_Reference", "name": "SkCanvas::drawVertices_2" }, + "SkCanvas_drawVertices_3": { + "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n SkPoint points[] = { { 0, 0 }, { 250, 0 }, { 100, 100 }, { 0, 250 } };\n SkPoint texs[] = { { 0, 0 }, { 0, 250 }, { 250, 250 }, { 250, 0 } };\n SkColor colors[] = { SK_ColorRED, SK_ColorBLUE, SK_ColorYELLOW, SK_ColorCYAN };\n SkVertices::BoneIndices boneIndices[] = { { 0, 0, 0, 0 },\n { 1, 0, 0, 0 },\n { 2, 0, 0, 0 },\n { 3, 0, 0, 0 } };\n SkVertices::BoneWeights boneWeights[] = { { 0.0f, 0.0f, 0.0f, 0.0f },\n { 1.0f, 0.0f, 0.0f, 0.0f },\n { 1.0f, 0.0f, 0.0f, 0.0f },\n { 1.0f, 0.0f, 0.0f, 0.0f } };\n SkMatrix bones[] = { SkMatrix::I(),\n SkMatrix::MakeTrans(0, 20),\n SkMatrix::MakeTrans(50, 50),\n SkMatrix::MakeTrans(20, 0) };\n paint.setShader(SkGradientShader::MakeLinear(points, colors, nullptr, 4,\n SkShader::kClamp_TileMode));\n auto vertices = SkVertices::MakeCopy(SkVertices::kTriangleFan_VertexMode,\n SK_ARRAY_COUNT(points), points, texs, colors, boneIndices, boneWeights);\n canvas->drawVertices(vertices.get(), bones, SK_ARRAY_COUNT(bones), SkBlendMode::kDarken, paint);\n}\n", + "width": 256, + "height": 256, + "hash": "7db6ad6b01931d713d7390736239001b", + "file": "SkCanvas_Reference", + "name": "SkCanvas::drawVertices_3" +}, + "SkCanvas_drawVertices_4": { + "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n SkPoint points[] = { { 0, 0 }, { 250, 0 }, { 100, 100 }, { 0, 250 } };\n SkPoint texs[] = { { 0, 0 }, { 0, 250 }, { 250, 250 }, { 250, 0 } };\n SkColor colors[] = { SK_ColorRED, SK_ColorBLUE, SK_ColorYELLOW, SK_ColorCYAN };\n SkVertices::BoneIndices boneIndices[] = { { 0, 0, 0, 0 },\n { 1, 0, 0, 0 },\n { 2, 0, 0, 0 },\n { 3, 0, 0, 0 } };\n SkVertices::BoneWeights boneWeights[] = { { 0.0f, 0.0f, 0.0f, 0.0f },\n { 1.0f, 0.0f, 0.0f, 0.0f },\n { 1.0f, 0.0f, 0.0f, 0.0f },\n { 1.0f, 0.0f, 0.0f, 0.0f } };\n SkMatrix bones[] = { SkMatrix::I(),\n SkMatrix::MakeTrans(0, 20),\n SkMatrix::MakeTrans(50, 50),\n SkMatrix::MakeTrans(20, 0) };\n paint.setShader(SkGradientShader::MakeLinear(points, colors, nullptr, 4,\n SkShader::kClamp_TileMode));\n auto vertices = SkVertices::MakeCopy(SkVertices::kTriangleFan_VertexMode,\n SK_ARRAY_COUNT(points), points, texs, colors, boneIndices, boneWeights);\n canvas->drawVertices(vertices, bones, SK_ARRAY_COUNT(bones), SkBlendMode::kDarken, paint);\n}\n", + "width": 256, + "height": 256, + "hash": "cc1fc7f3462abc79ec6dec3405e2812d", + "file": "SkCanvas_Reference", + "name": "SkCanvas::drawVertices_4" +}, "SkCanvas_getGrContext": { "code": "void draw(SkCanvas* canvas) {\n if (canvas->getGrContext()) {\n canvas->clear(SK_ColorRED);\n } else {\n canvas->clear(SK_ColorBLUE);\n }\n}\n", "width": 256, diff --git a/site/user/api/usingBookmaker.md b/site/user/api/usingBookmaker.md index 004361a2dc..348d1c6704 100644 --- a/site/user/api/usingBookmaker.md +++ b/site/user/api/usingBookmaker.md @@ -104,7 +104,7 @@ Get the fiddle command line interface tool. By default this will appear in your home directory. <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -$ go get go.skia.org/infra/fiddle/go/fiddlecli +$ go get go.skia.org/infra/fiddlek/go/fiddlecli </pre> Build <a href='#Bookmaker'>Bookmaker</a>. diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index bf32aafae9..8314f803f0 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -1711,7 +1711,7 @@ void SkCanvas::drawVertices(const SkVertices* vertices, SkBlendMode mode, const this->onDrawVerticesObject(vertices, nullptr, 0, mode, paint); } -void SkCanvas::drawVertices(const sk_sp<SkVertices> vertices, const SkMatrix* bones, int boneCount, +void SkCanvas::drawVertices(const sk_sp<SkVertices>& vertices, const SkMatrix* bones, int boneCount, SkBlendMode mode, const SkPaint& paint) { TRACE_EVENT0("skia", TRACE_FUNC); RETURN_ON_NULL(vertices); diff --git a/tools/bookmaker/parserCommon.cpp b/tools/bookmaker/parserCommon.cpp index 35769b6e4a..33bf14918e 100644 --- a/tools/bookmaker/parserCommon.cpp +++ b/tools/bookmaker/parserCommon.cpp @@ -161,7 +161,7 @@ bool ParserCommon::writeBlockTrim(int size, const char* data) { if (fReturnOnWrite) { return true; } - SkASSERT(size < 16000); + SkASSERT(size < 20000); if (size > 3 && !strncmp("#end", data, 4)) { fMaxLF = 1; } |