From 363402d3af6298ea58195687c02a6bb4cd95bcc0 Mon Sep 17 00:00:00 2001 From: Ruiqi Mao Date: Wed, 18 Jul 2018 10:53:44 -0400 Subject: added GMs that use the vertex caching pipeline Bug: skia: Change-Id: I6b3a4b3405662c89464aef7c2f106ec906992241 Reviewed-on: https://skia-review.googlesource.com/142161 Reviewed-by: Brian Osman Reviewed-by: Robert Phillips Commit-Queue: Ruiqi Mao --- gm/skinning.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'gm') diff --git a/gm/skinning.cpp b/gm/skinning.cpp index 101522fa48..9b59594dc4 100644 --- a/gm/skinning.cpp +++ b/gm/skinning.cpp @@ -70,10 +70,11 @@ static void swap(const SkMatrix** x, const SkMatrix** y) { class SkinningGM : public GM { public: - SkinningGM(bool deformUsingCPU) + SkinningGM(bool deformUsingCPU, bool cache) : fPaint() , fVertices(nullptr) , fDeformUsingCPU(deformUsingCPU) + , fCache(cache) {} protected: @@ -86,6 +87,9 @@ protected: if (fDeformUsingCPU) { name.append("_cpu"); } + if (fCache) { + name.append("_cached"); + } return name; } @@ -103,7 +107,7 @@ protected: kBoneWeights, kIndexCount, kIndices, - false); // Keep the vertices non-volatile. + !fCache); } void onDraw(SkCanvas* canvas) override { @@ -176,7 +180,8 @@ private: nullptr, kColors, kIndexCount, - kIndices); + kIndices, + !fCache); canvas->drawVertices(vertices.get(), SkBlendMode::kSrc, fPaint); @@ -218,11 +223,14 @@ private: SkPaint fPaint; sk_sp fVertices; bool fDeformUsingCPU; + bool fCache; typedef GM INHERITED; }; ///////////////////////////////////////////////////////////////////////////////////// -DEF_GM(return new SkinningGM(true);) -DEF_GM(return new SkinningGM(false);) +DEF_GM(return new SkinningGM(true, true);) +DEF_GM(return new SkinningGM(false, true);) +DEF_GM(return new SkinningGM(true, false);) +DEF_GM(return new SkinningGM(false, false);) -- cgit v1.2.3