diff options
author | Brian Osman <brianosman@google.com> | 2016-10-19 11:12:09 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-10-19 16:01:07 +0000 |
commit | 9f532a3598891a74375a4659e0dc498b704e3cf1 (patch) | |
tree | eed5fe2329eb3a24dec22cc062bfebf8a6f3c9a1 /include | |
parent | 5e3d9c2e31b61edcfac4fd7b31e98f826d42d9f0 (diff) |
Add helper to create random AsFPArgs for Ganesh unit tests
Reduces copy-paste and eases maintenance. I'll be adding another field to
AsFPArgs soon, and this is going to streamline that change.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3639
Change-Id: I6372ed5dce50a5ba9d73039bd4714e34502a1f75
Reviewed-on: https://skia-review.googlesource.com/3639
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkShader.h | 1 | ||||
-rw-r--r-- | include/gpu/GrTestUtils.h | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/include/core/SkShader.h b/include/core/SkShader.h index efd9aa0759..f9796d6c1a 100644 --- a/include/core/SkShader.h +++ b/include/core/SkShader.h @@ -327,6 +327,7 @@ public: #if SK_SUPPORT_GPU struct AsFPArgs { + AsFPArgs() {} AsFPArgs(GrContext* context, const SkMatrix* viewMatrix, const SkMatrix* localMatrix, diff --git a/include/gpu/GrTestUtils.h b/include/gpu/GrTestUtils.h index 17bf12af30..373847dfe9 100644 --- a/include/gpu/GrTestUtils.h +++ b/include/gpu/GrTestUtils.h @@ -16,9 +16,11 @@ #include "GrColorSpaceXform.h" #include "SkPathEffect.h" #include "SkRandom.h" +#include "SkShader.h" #include "SkStrokeRec.h" #include "../private/SkTemplates.h" +struct GrProcessorTestData; class GrStyle; class SkMatrix; class SkPath; @@ -45,6 +47,17 @@ void TestStyle(SkRandom*, GrStyle*); sk_sp<SkColorSpace> TestColorSpace(SkRandom*); sk_sp<GrColorSpaceXform> TestColorXform(SkRandom*); +class TestAsFPArgs { +public: + TestAsFPArgs(GrProcessorTestData*); + const SkShader::AsFPArgs& args() const { return fArgs; } + +private: + SkShader::AsFPArgs fArgs; + SkMatrix fViewMatrixStorage; + sk_sp<SkColorSpace> fColorSpaceStorage; +}; + // We have a simplified dash path effect here to avoid relying on SkDashPathEffect which // is in the optional build target effects. class TestDashPathEffect : public SkPathEffect { |