diff options
author | Ruiqi Mao <ruiqimao@google.com> | 2018-07-18 10:53:44 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-07-18 18:26:32 +0000 |
commit | 363402d3af6298ea58195687c02a6bb4cd95bcc0 (patch) | |
tree | 61b5103d469e993909b5fd631ac9cac5634e23a7 /gm | |
parent | ce3c28f1022fdb2fa93e750c9de7980d57e49731 (diff) |
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 <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Ruiqi Mao <ruiqimao@google.com>
Diffstat (limited to 'gm')
-rw-r--r-- | gm/skinning.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
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<SkVertices> 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);) |