aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-07-24 10:16:19 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-24 15:43:09 +0000
commit1c053644a844db6b6ef454db10b058072e5c4249 (patch)
tree3c1734a6b4a35b8d575057127793b6ad00e2c0b0 /tests
parent8e5be413c10bc5fa816f56a8b69f9962c4565eac (diff)
Make GrProcessorTestFactory be templated on smart ptr class rather than processor class.
This is part of setting the stage for moving GrFragmentProcessor to unique_ptr ownership. Change-Id: I2dfb4977319605d56c4debe05ff0b3dc970bb4c5 Reviewed-on: https://skia-review.googlesource.com/26141 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/GLProgramsTest.cpp9
-rw-r--r--tests/ProcessorTest.cpp2
2 files changed, 5 insertions, 6 deletions
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp
index f8cb6efb67..dd98a6e00e 100644
--- a/tests/GLProgramsTest.cpp
+++ b/tests/GLProgramsTest.cpp
@@ -177,7 +177,7 @@ static sk_sp<GrFragmentProcessor> create_random_proc_tree(GrProcessorTestData* d
if (terminate) {
sk_sp<GrFragmentProcessor> fp;
while (true) {
- fp = GrProcessorTestFactory<GrFragmentProcessor>::Make(d);
+ fp = GrFragmentProcessorTestFactory::Make(d);
SkASSERT(fp);
if (0 == fp->numChildProcessors()) {
break;
@@ -225,7 +225,7 @@ static void set_random_color_coverage_stages(GrPaint* paint,
int numColorProcs = d->fRandom->nextULessThan(numProcs + 1);
for (int s = 0; s < numProcs;) {
- sk_sp<GrFragmentProcessor> fp(GrProcessorTestFactory<GrFragmentProcessor>::Make(d));
+ sk_sp<GrFragmentProcessor> fp(GrFragmentProcessorTestFactory::Make(d));
SkASSERT(fp);
// finally add the stage to the correct pipeline in the drawstate
@@ -316,7 +316,7 @@ bool GrDrawingManager::ProgramUnitTest(GrContext* context, int maxStages, int ma
return false;
}
- int fpFactoryCnt = GrProcessorTestFactory<GrFragmentProcessor>::Count();
+ int fpFactoryCnt = GrFragmentProcessorTestFactory::Count();
for (int i = 0; i < fpFactoryCnt; ++i) {
// Since FP factories internally randomize, call each 10 times.
for (int j = 0; j < 10; ++j) {
@@ -324,8 +324,7 @@ bool GrDrawingManager::ProgramUnitTest(GrContext* context, int maxStages, int ma
GrPaint paint;
paint.setXPFactory(GrPorterDuffXPFactory::Get(SkBlendMode::kSrc));
- sk_sp<GrFragmentProcessor> fp(
- GrProcessorTestFactory<GrFragmentProcessor>::MakeIdx(i, &ptd));
+ sk_sp<GrFragmentProcessor> fp(GrFragmentProcessorTestFactory::MakeIdx(i, &ptd));
sk_sp<GrFragmentProcessor> blockFP(
BlockInputFragmentProcessor::Make(std::move(fp)));
paint.addColorFragmentProcessor(std::move(blockFP));
diff --git a/tests/ProcessorTest.cpp b/tests/ProcessorTest.cpp
index eac6aab274..c9eb1f38a0 100644
--- a/tests/ProcessorTest.cpp
+++ b/tests/ProcessorTest.cpp
@@ -288,7 +288,7 @@ DEFINE_bool(randomProcessorTest, false, "Use non-deterministic seed for random p
#if GR_TEST_UTILS
DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ProcessorOptimizationValidationTest, reporter, ctxInfo) {
GrContext* context = ctxInfo.grContext();
- using FPFactory = GrProcessorTestFactory<GrFragmentProcessor>;
+ using FPFactory = GrFragmentProcessorTestFactory;
uint32_t seed = 0;
if (FLAGS_randomProcessorTest) {