diff options
author | Ruiqi Mao <ruiqimao@google.com> | 2018-08-15 10:44:19 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-08-15 15:52:29 +0000 |
commit | c97a339cd60116451f626da92c88a8c02cb48fbf (patch) | |
tree | ae0741c1e636fbb7f01847bb4a1bd2b94ff57d5d /docs | |
parent | 137ca523a36ea6fb8ba8b8c91b19e69f63a90dde (diff) | |
download | skqp-c97a339cd60116451f626da92c88a8c02cb48fbf.tar.gz |
added optimizations to speed up skinning
Docs-Preview: https://skia.org/?cl=145148
Bug: skia:
Change-Id: If27722105a1e8999f6440b6fd4044cc1f327827e
Reviewed-on: https://skia-review.googlesource.com/145148
Commit-Queue: Ruiqi Mao <ruiqimao@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/SkCanvas_Reference.bmh | 32 | ||||
-rw-r--r-- | docs/undocumented.bmh | 36 | ||||
-rw-r--r-- | docs/usingBookmaker.bmh | 1 |
3 files changed, 36 insertions, 33 deletions
diff --git a/docs/SkCanvas_Reference.bmh b/docs/SkCanvas_Reference.bmh index c310b11b55..8ec893dfab 100644 --- a/docs/SkCanvas_Reference.bmh +++ b/docs/SkCanvas_Reference.bmh @@ -5749,8 +5749,8 @@ void draw(SkCanvas* canvas) { # ------------------------------------------------------------------------------ -#Method void drawVertices(const SkVertices* vertices, const SkMatrix* bones, int boneCount, - SkBlendMode mode, const SkPaint& paint) +#Method void drawVertices(const SkVertices* vertices, const SkVertices::Bone bones[], + int boneCount, SkBlendMode mode, const SkPaint& paint) Draws Vertices vertices, a triangle mesh, using Clip and Matrix. Bone data is used to deform vertices with bone weights. @@ -5759,7 +5759,7 @@ 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. -boneCount must be at most 100, and thus the size of bones should be at most 100. +boneCount must be at most 80, and thus the size of bones should be at most 80. #Param vertices triangle mesh to draw ## #Param bones bone matrix data ## @@ -5767,7 +5767,7 @@ boneCount must be at most 100, and thus the size of bones should be at most 100. #Param mode combines Vertices_Colors with Shader, if both are present ## #Param paint specifies the Shader, used as Vertices texture, may be nullptr ## -#Example +#NoExample void draw(SkCanvas* canvas) { SkPaint paint; SkPoint points[] = { { 0, 0 }, { 250, 0 }, { 100, 100 }, { 0, 250 } }; @@ -5781,10 +5781,10 @@ void draw(SkCanvas* canvas) { { 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) }; + SkVertices::Bone bones[] = { {{ 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f }}, + {{ 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 20.0f }}, + {{ 1.0f, 0.0f, 0.0f, 1.0f, 50.0f, 50.0f }}, + {{ 1.0f, 0.0f, 0.0f, 1.0f, 20.0f, 0.0f }} }; paint.setShader(SkGradientShader::MakeLinear(points, colors, nullptr, 4, SkShader::kClamp_TileMode)); auto vertices = SkVertices::MakeCopy(SkVertices::kTriangleFan_VertexMode, @@ -5799,8 +5799,8 @@ void draw(SkCanvas* canvas) { # ------------------------------------------------------------------------------ -#Method void drawVertices(const sk_sp<SkVertices>& vertices, const SkMatrix* bones, int boneCount, - SkBlendMode mode, const SkPaint& paint) +#Method void drawVertices(const sk_sp<SkVertices>& vertices, const SkVertices::Bone bones[], + int boneCount, SkBlendMode mode, const SkPaint& paint) Draws Vertices vertices, a triangle mesh, using Clip and Matrix. Bone data is used to deform vertices with bone weights. @@ -5809,7 +5809,7 @@ 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. -boneCount must be at most 100, and thus the size of bones should be at most 100. +boneCount must be at most 80, and thus the size of bones should be at most 80. #Param vertices triangle mesh to draw ## #Param bones bone matrix data ## @@ -5817,7 +5817,7 @@ boneCount must be at most 100, and thus the size of bones should be at most 100. #Param mode combines Vertices_Colors with Shader, if both are present ## #Param paint specifies the Shader, used as Vertices texture, may be nullptr ## -#Example +#NoExample void draw(SkCanvas* canvas) { SkPaint paint; SkPoint points[] = { { 0, 0 }, { 250, 0 }, { 100, 100 }, { 0, 250 } }; @@ -5831,10 +5831,10 @@ void draw(SkCanvas* canvas) { { 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) }; + SkVertices::Bone bones[] = { {{ 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f }}, + {{ 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 20.0f }}, + {{ 1.0f, 0.0f, 0.0f, 1.0f, 50.0f, 50.0f }}, + {{ 1.0f, 0.0f, 0.0f, 1.0f, 20.0f, 0.0f }} }; paint.setShader(SkGradientShader::MakeLinear(points, colors, nullptr, 4, SkShader::kClamp_TileMode)); auto vertices = SkVertices::MakeCopy(SkVertices::kTriangleFan_VertexMode, diff --git a/docs/undocumented.bmh b/docs/undocumented.bmh index 6161398a1a..30c06576a4 100644 --- a/docs/undocumented.bmh +++ b/docs/undocumented.bmh @@ -7,7 +7,7 @@ API BMP GIF HEIF ICO JPEG PNG WBMP WebP CPU - GPU GPU-backed OpenGL Vulkan I/O MSAA + GPU GPU-backed OpenGL Vulkan I/O MSAA PDF XPS RFC NaN NaNs @@ -81,8 +81,8 @@ FT_Load_Glyph #Substitute unhinted ## -# this jargon requires a substitute to space the phrase. -#Topic Little_Endian +# this jargon requires a substitute to space the phrase. +#Topic Little_Endian #Substitute little endian ## @@ -90,11 +90,11 @@ FT_Load_Glyph #Substitute big endian ## -#Topic YUV_Component_Y +#Topic YUV_Component_Y #Substitute YUV component y ## -#Topic YUV_Component_U +#Topic YUV_Component_U #Substitute YUV component u ## @@ -106,7 +106,7 @@ FT_Load_Glyph #Substitute UV mapping ## -#Topic Multi_Sample_Anti_Aliasing +#Topic Multi_Sample_Anti_Aliasing #Substitute multi-sample anti-aliasing ## @@ -114,43 +114,43 @@ FT_Load_Glyph #Substitute GPU share group ## -#Topic Bezier_Curve +#Topic Bezier_Curve #Substitute Bezier cruve ## -#Topic Coons_Patch +#Topic Coons_Patch #Substitute Coons patch ## -#Topic Cartesian_Coordinate +#Topic Cartesian_Coordinate #Substitute Cartesian coordinate ## -#Topic Euclidean_Distance +#Topic Euclidean_Distance #Substitute Euclidean distance ## -#Topic Euclidean_Space +#Topic Euclidean_Space #Substitute Euclidean space ## -#Topic HTML_Gray +#Topic HTML_Gray #Substitute HTML gray ## -#Topic HTML_Silver +#Topic HTML_Silver #Substitute HTML silver ## -#Topic HTML_Lime +#Topic HTML_Lime #Substitute HTML lime ## -#Topic HTML_Green +#Topic HTML_Green #Substitute HTML green ## -#Topic HTML_Aqua +#Topic HTML_Aqua #Substitute HTML aqua ## @@ -158,7 +158,7 @@ FT_Load_Glyph #Substitute HTML fuchsia ## -#Topic SVG_lightgray +#Topic SVG_lightgray #Substitute SVG light gray ## @@ -787,6 +787,8 @@ FT_Load_Glyph #Topic Vertices #Class SkVertices +#Class Bone +## ## #Subtopic Colors ## diff --git a/docs/usingBookmaker.bmh b/docs/usingBookmaker.bmh index f74db8f77f..4e952e2b50 100644 --- a/docs/usingBookmaker.bmh +++ b/docs/usingBookmaker.bmh @@ -147,6 +147,7 @@ Complete rebuilding of all bookmaker output looks like: $ ./out/skia/bookmaker -a docs/status.json -e fiddle.json $ ~/go/bin/fiddlecli --input fiddle.json --output fiddleout.json $ ./out/skia/bookmaker -a docs/status.json -f fiddleout.json -r site/user/api -c +$ ./out/skia/bookmaker -a docs/status.json -f fiddleout.json -r site/user/api $ ./out/skia/bookmaker -a docs/status.json -x $ ./out/skia/bookmaker -a docs/status.json -p ## |