Make ProcessorCloneTest more robust, fix matrix conv. onIsEqual

Change-Id: Iddf860b462dcac36f6a7f5b90d4ce4dceed0dd31
Reviewed-on: https://skia-review.googlesource.com/29604
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This commit is contained in:
Brian Salomon 2017-08-01 16:23:40 -04:00 committed by Skia Commit-Bot
parent 369e8b70ee
commit ce06e261e6
2 changed files with 10 additions and 1 deletions

View File

@ -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();
}

View File

@ -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);