diff options
author | Ruiqi Mao <ruiqimao@google.com> | 2018-07-03 11:38:15 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-07-03 16:07:44 +0000 |
commit | b6307340e8a6a9d3a7517def7f5eaaadffd07d14 (patch) | |
tree | 7337790911d8e791d495f37f637382f3fb5acad3 /src/gpu/GrDefaultGeoProcFactory.h | |
parent | b7b73f5bbec55020c873cab6f4e11444b4011c34 (diff) |
added skeletal animation support to GPU backend
added caching of SkVertices
Docs-Preview: https://skia.org/?cl=138596
Bug: skia:
Change-Id: Ia750f55f5f6d0de250d9e9c5619f4d1ac856f9f5
Reviewed-on: https://skia-review.googlesource.com/138596
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Ruiqi Mao <ruiqimao@google.com>
Diffstat (limited to 'src/gpu/GrDefaultGeoProcFactory.h')
-rw-r--r-- | src/gpu/GrDefaultGeoProcFactory.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/gpu/GrDefaultGeoProcFactory.h b/src/gpu/GrDefaultGeoProcFactory.h index 314c1bb963..c22cefbd73 100644 --- a/src/gpu/GrDefaultGeoProcFactory.h +++ b/src/gpu/GrDefaultGeoProcFactory.h @@ -54,7 +54,7 @@ namespace GrDefaultGeoProcFactory { SkPoint fLocalCoord; }; - struct PositionColorLocalCoordCoverage { + struct PositionColorLocalCoordCoverageAttr { SkPoint fPosition; GrColor fColor; SkPoint fLocalCoord; @@ -118,6 +118,15 @@ namespace GrDefaultGeoProcFactory { const SkMatrix* fMatrix; }; + struct Bones { + Bones(const SkMatrix bones[], int boneCount) + : fBones(bones) + , fBoneCount(boneCount) {} + + const SkMatrix* fBones; + int fBoneCount; + }; + sk_sp<GrGeometryProcessor> Make(const Color&, const Coverage&, const LocalCoords&, @@ -132,6 +141,17 @@ namespace GrDefaultGeoProcFactory { const Coverage&, const LocalCoords&, const SkMatrix& viewMatrix); + + /* + * Use this factory to create a GrGeometryProcessor that supports skeletal animation through + * deformation of vertices using matrices that are passed in. This should only be called from + * GrDrawVerticesOp. + */ + sk_sp<GrGeometryProcessor> MakeWithBones(const Color&, + const Coverage&, + const LocalCoords&, + const Bones&, + const SkMatrix& viewMatrix); }; #endif |