Have GrProcessorTestData hold views instead of proxies.
Bug: skia:9556
Change-Id: I2e51331eaca74a6c355872cd19b725f7b3ab551e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270199
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/effects/GrMatrixConvolutionEffect.cpp b/src/gpu/effects/GrMatrixConvolutionEffect.cpp
index fafd35e..236c5d3 100644
--- a/src/gpu/effects/GrMatrixConvolutionEffect.cpp
+++ b/src/gpu/effects/GrMatrixConvolutionEffect.cpp
@@ -324,7 +324,7 @@
#if GR_TEST_UTILS
std::unique_ptr<GrFragmentProcessor> GrMatrixConvolutionEffect::TestCreate(GrProcessorTestData* d) {
- auto [proxy, ct, at] = d->randomProxy();
+ auto [view, ct, at] = d->randomView();
int width = d->fRandom->nextRangeU(1, MAX_KERNEL_SIZE);
int height = d->fRandom->nextRangeU(1, MAX_KERNEL_SIZE / width);
@@ -335,20 +335,21 @@
}
SkScalar gain = d->fRandom->nextSScalar1();
SkScalar bias = d->fRandom->nextSScalar1();
- SkIPoint kernelOffset = SkIPoint::Make(d->fRandom->nextRangeU(0, kernelSize.width()),
- d->fRandom->nextRangeU(0, kernelSize.height()));
- SkIRect bounds = SkIRect::MakeXYWH(d->fRandom->nextRangeU(0, proxy->width()),
- d->fRandom->nextRangeU(0, proxy->height()),
- d->fRandom->nextRangeU(0, proxy->width()),
- d->fRandom->nextRangeU(0, proxy->height()));
+
+ uint32_t kernalOffsetX = d->fRandom->nextRangeU(0, kernelSize.width());
+ uint32_t kernalOffsetY = d->fRandom->nextRangeU(0, kernelSize.height());
+ SkIPoint kernelOffset = SkIPoint::Make(kernalOffsetX, kernalOffsetY);
+
+ uint32_t boundsX = d->fRandom->nextRangeU(0, view.width());
+ uint32_t boundsY = d->fRandom->nextRangeU(0, view.height());
+ uint32_t boundsW = d->fRandom->nextRangeU(0, view.width());
+ uint32_t boundsH = d->fRandom->nextRangeU(0, view.height());
+ SkIRect bounds = SkIRect::MakeXYWH(boundsX, boundsY, boundsW, boundsH);
+
GrTextureDomain::Mode tileMode =
static_cast<GrTextureDomain::Mode>(d->fRandom->nextRangeU(0, 2));
bool convolveAlpha = d->fRandom->nextBool();
- GrSurfaceOrigin origin = proxy->origin();
- GrSwizzle swizzle = proxy->textureSwizzle();
- GrSurfaceProxyView view(std::move(proxy), origin, swizzle);
-
return GrMatrixConvolutionEffect::Make(std::move(view),
bounds,
kernelSize,