From ce06e261e68848ae21cac1052abc16bc07b961bf Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Tue, 1 Aug 2017 16:23:40 -0400 Subject: [PATCH] Make ProcessorCloneTest more robust, fix matrix conv. onIsEqual Change-Id: Iddf860b462dcac36f6a7f5b90d4ce4dceed0dd31 Reviewed-on: https://skia-review.googlesource.com/29604 Reviewed-by: Robert Phillips Commit-Queue: Brian Salomon --- src/gpu/effects/GrMatrixConvolutionEffect.cpp | 2 +- tests/ProcessorTest.cpp | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/gpu/effects/GrMatrixConvolutionEffect.cpp b/src/gpu/effects/GrMatrixConvolutionEffect.cpp index 9d8e793c13..030a926845 100644 --- a/src/gpu/effects/GrMatrixConvolutionEffect.cpp +++ b/src/gpu/effects/GrMatrixConvolutionEffect.cpp @@ -214,7 +214,7 @@ bool GrMatrixConvolutionEffect::onIsEqual(const GrFragmentProcessor& sBase) cons fKernelSize.width() * fKernelSize.height() * sizeof(float)) && fGain == s.gain() && fBias == s.bias() && - fKernelOffset == s.kernelOffset() && + !memcmp(fKernelOffset, s.kernelOffset(), sizeof(fKernelOffset)) && fConvolveAlpha == s.convolveAlpha() && fDomain == s.domain(); } diff --git a/tests/ProcessorTest.cpp b/tests/ProcessorTest.cpp index e2625a7e31..8354225ce7 100644 --- a/tests/ProcessorTest.cpp +++ b/tests/ProcessorTest.cpp @@ -554,6 +554,15 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ProcessorCloneTest, reporter, ctxInfo) { !clone->instantiate(context->resourceProvider())) { continue; } + REPORTER_ASSERT(reporter, !strcmp(fp->name(), clone->name())); + REPORTER_ASSERT(reporter, fp->compatibleWithCoverageAsAlpha() == + clone->compatibleWithCoverageAsAlpha()); + REPORTER_ASSERT(reporter, fp->isEqual(*clone)); + REPORTER_ASSERT(reporter, fp->preservesOpaqueInput() == clone->preservesOpaqueInput()); + REPORTER_ASSERT(reporter, fp->hasConstantOutputForConstantInput() == + clone->hasConstantOutputForConstantInput()); + REPORTER_ASSERT(reporter, fp->numChildProcessors() == clone->numChildProcessors()); + REPORTER_ASSERT(reporter, fp->usesLocalCoords() == clone->usesLocalCoords()); // Draw with original and read back the results. test_draw_op(rtc.get(), fp, inputTexture); memset(readData1.get(), 0x0, sizeof(GrColor) * kRenderSize * kRenderSize);