From 94d57c477fe122c146a034c625cebb6c44ef21b0 Mon Sep 17 00:00:00 2001 From: Ruiqi Mao Date: Mon, 2 Jul 2018 15:20:10 -0400 Subject: updated SkCanvas documentation for animation overloads of drawVertices changed bookmaker ParserCommon::writeBlockTrim limit to 20000 disabled broken SkPaint::containsText example Docs-Preview: https://skia.org/?cl=138862 Bug: skia:8123 Change-Id: Ib4003bf7b9603bf652f86cd56e0975cd09bcbf71 Reviewed-on: https://skia-review.googlesource.com/138862 Reviewed-by: Brian Osman Commit-Queue: Brian Osman --- site/user/api/SkBlendMode_Reference.md | 2 +- site/user/api/SkCanvas_Reference.md | 102 ++++++++++++++++++++++++++++++++- site/user/api/SkPaint_Reference.md | 6 +- site/user/api/catalog.htm | 29 ++++++---- site/user/api/usingBookmaker.md | 2 +- 5 files changed, 121 insertions(+), 20 deletions(-) (limited to 'site') 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 -SkCanvas::drawColor SkCanvas::drawVertices[2] SkPaint SkShader::MakeCompose SkXfermodeImageFilter +SkCanvas::drawColor SkCanvas::drawVertices[2][3][4] SkPaint SkShader::MakeCompose SkXfermodeImageFilter ## Clear 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 drawVertices(const sk sp<SkVertices>& vertices, SkBlendMode mode, const SkPaint& paint) + + + drawVertices(const SkVertices* vertices, const SkMatrix* bones, int boneCount, SkBlendMode mode, const SkPaint& paint) + + + + drawVertices(const sk sp<SkVertices>& vertices, const SkMatrix* bones, int boneCount, SkBlendMode mode, const SkPaint& paint) + @@ -6507,7 +6515,95 @@ contains Shader, drawPatch[2] drawPicture[2][3][4] + +--- + + + +
+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. + +### Parameters + + + + + + + + + + + + + + + + +
verticestriangle mesh to draw
bonesbone matrix data
boneCountnumber of bone matrices
modecombines Vertices Colors with Shader, if both are present
paintspecifies the Shader, used as Vertices texture, may be nullptr
+ +### Example + +
+ +### See Also + +drawPatch[2] drawPicture[2][3][4] + +--- + + + +
+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. + +### Parameters + + + + + + + + + + + + + + + + +
verticestriangle mesh to draw
bonesbone matrix data
boneCountnumber of bone matrices
modecombines Vertices Colors with Shader, if both are present
paintspecifies the Shader, used as Vertices texture, may be nullptr
+ +### Example + +
### See Also @@ -6567,7 +6663,7 @@ may be nullptr ### See Also -SeeAlso drawVertices[2] drawPicture[2][3][4] +SeeAlso drawVertices[2][3][4] drawPicture[2][3][4] --- @@ -6623,7 +6719,7 @@ may be nullptr ### See Also -SeeAlso drawVertices[2] drawPicture[2][3][4] +SeeAlso drawVertices[2][3][4] drawPicture[2][3][4] --- 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 byteLength is zer true if all text corresponds to a non-zero glyph index -### Example - -
containsText succeeds for degree symbol, but cannot find a glyph index +
containsText succeeds for degree symbol, but cannot find a glyph index corresponding to the Unicode surrogate code point.
@@ -5456,8 +5454,6 @@ corresponding to the Unicode surrogate code point. 0xd800 != has char ~~~~ -
- ### Example
containsText 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,12 +5090,28 @@ "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", 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.
-$ go get go.skia.org/infra/fiddle/go/fiddlecli
+$ go get go.skia.org/infra/fiddlek/go/fiddlecli
 
Build Bookmaker. -- cgit v1.2.3