aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/SkGpuDevice.cpp
diff options
context:
space:
mode:
authorGravatar Ruiqi Mao <ruiqimao@google.com>2018-07-03 11:38:15 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-03 16:07:44 +0000
commitb6307340e8a6a9d3a7517def7f5eaaadffd07d14 (patch)
tree7337790911d8e791d495f37f637382f3fb5acad3 /src/gpu/SkGpuDevice.cpp
parentb7b73f5bbec55020c873cab6f4e11444b4011c34 (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/SkGpuDevice.cpp')
-rw-r--r--src/gpu/SkGpuDevice.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index a665517d4f..f1e527036b 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -365,7 +365,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);
}
///////////////////////////////////////////////////////////////////////////////
@@ -1480,7 +1480,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
@@ -1538,12 +1540,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());
@@ -1554,7 +1557,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,
@@ -1562,7 +1566,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);
}
///////////////////////////////////////////////////////////////////////////////