diff options
author | Ruiqi Mao <ruiqimao@google.com> | 2018-07-10 13:08:32 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-07-10 20:25:55 +0000 |
commit | d275ef501c8e6ea6444912e22c29e2d13a3dfb53 (patch) | |
tree | 8171fef3aef275e20e87963d85f50ec8711b683d /src/gpu/SkGpuDevice.cpp | |
parent | c69c4410be7def8fa129496de994d83c497f06db (diff) |
added skeletal animation support to GPU backend
Pulled from reverted CL: https://skia-review.googlesource.com/c/skia/+/138596
Bug: skia:
Change-Id: Ie07f1c76bae65c219ebe93d071bb19f1a30100c2
Reviewed-on: https://skia-review.googlesource.com/139282
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/SkGpuDevice.cpp')
-rw-r--r-- | src/gpu/SkGpuDevice.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index f031e5edf1..c9cda0de7d 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -369,7 +369,7 @@ void SkGpuDevice::drawPoints(SkCanvas::PointMode mode, nullptr); fRenderTargetContext->drawVertices(this->clip(), std::move(grPaint), *viewMatrix, - std::move(vertices), &primitiveType); + std::move(vertices), nullptr, 0, &primitiveType); } /////////////////////////////////////////////////////////////////////////////// @@ -1486,7 +1486,9 @@ static bool init_vertices_paint(GrContext* context, const GrColorSpaceInfo& colo } void SkGpuDevice::wireframeVertices(SkVertices::VertexMode vmode, int vertexCount, - const SkPoint vertices[], SkBlendMode bmode, + const SkPoint vertices[], + const SkMatrix bones[], int boneCount, + SkBlendMode bmode, const uint16_t indices[], int indexCount, const SkPaint& paint) { ASSERT_SINGLE_OWNER @@ -1544,12 +1546,13 @@ void SkGpuDevice::wireframeVertices(SkVertices::VertexMode vmode, int vertexCoun std::move(grPaint), this->ctm(), builder.detach(), + bones, + boneCount, &primitiveType); } -void SkGpuDevice::drawVertices(const SkVertices* vertices, const SkMatrix* bones, int boneCount, +void SkGpuDevice::drawVertices(const SkVertices* vertices, const SkMatrix bones[], int boneCount, SkBlendMode mode, const SkPaint& paint) { - // TODO: GPU ANIMATION ASSERT_SINGLE_OWNER GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawVertices", fContext.get()); @@ -1560,7 +1563,8 @@ void SkGpuDevice::drawVertices(const SkVertices* vertices, const SkMatrix* bones if ((!hasTexs || !paint.getShader()) && !hasColors) { // The dreaded wireframe mode. Fallback to drawVertices and go so slooooooow. this->wireframeVertices(vertices->mode(), vertices->vertexCount(), vertices->positions(), - mode, vertices->indices(), vertices->indexCount(), paint); + bones, boneCount, mode, vertices->indices(), vertices->indexCount(), + paint); return; } if (!init_vertices_paint(fContext.get(), fRenderTargetContext->colorSpaceInfo(), paint, @@ -1568,7 +1572,8 @@ void SkGpuDevice::drawVertices(const SkVertices* vertices, const SkMatrix* bones return; } fRenderTargetContext->drawVertices(this->clip(), std::move(grPaint), this->ctm(), - sk_ref_sp(const_cast<SkVertices*>(vertices))); + sk_ref_sp(const_cast<SkVertices*>(vertices)), + bones, boneCount); } /////////////////////////////////////////////////////////////////////////////// |