Revert "Migrate SkImage::makeWithFilter to GrRecordingContext"
This reverts commit 7f0129d424a45f87653f6d0d83141e10fa96cba3.
Reason for revert: Broke Chrome roll
Original change's description:
> Migrate SkImage::makeWithFilter to GrRecordingContext
>
> The staging flag landed in Chrome CL 2307531.
>
> Bug: skia:104662
> Change-Id: I8a483bfb83e890bb0566cd252a464a6add89df4f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304003
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Adlai Holler <adlai@google.com>
TBR=bsalomon@google.com,robertphillips@google.com,adlai@google.com
Change-Id: I280dbffa26da71d53872266e62fa3bcaa3c00989
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:104662
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304802
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
diff --git a/tests/RepeatedClippedBlurTest.cpp b/tests/RepeatedClippedBlurTest.cpp
index 1161ce7..1db63be 100644
--- a/tests/RepeatedClippedBlurTest.cpp
+++ b/tests/RepeatedClippedBlurTest.cpp
@@ -23,13 +23,13 @@
// 2D canvas and compositor image filtering. In this case Chrome doesn't regularly purge
// the cache. This would result in Ganesh quickly running up to its max cache limit.
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(RepeatedClippedBlurTest, reporter, ctxInfo) {
- auto dContext = ctxInfo.directContext();
- GrResourceCache* cache = dContext->priv().getResourceCache();
+ auto context = ctxInfo.directContext();
+ GrResourceCache* cache = context->priv().getResourceCache();
const SkImageInfo ii = SkImageInfo::Make(1024, 600, kRGBA_8888_SkColorType,
kPremul_SkAlphaType);
- sk_sp<SkSurface> dst(SkSurface::MakeRenderTarget(dContext, SkBudgeted::kNo, ii));
+ sk_sp<SkSurface> dst(SkSurface::MakeRenderTarget(context, SkBudgeted::kNo, ii));
if (!dst) {
ERRORF(reporter, "Could not create surfaces for repeated clipped blur test.");
return;
@@ -53,7 +53,7 @@
bm.eraseArea(SkIRect::MakeXYWH(1, 2, 1277, 1274), SK_ColorGREEN);
sk_sp<SkImage> rasterImg = SkImage::MakeFromBitmap(bm);
- bigImg = rasterImg->makeTextureImage(dContext);
+ bigImg = rasterImg->makeTextureImage(context);
}
sk_sp<SkImage> smImg;
@@ -63,7 +63,7 @@
SkImageInfo screenII = SkImageInfo::Make(1024, 600, kRGBA_8888_SkColorType,
kPremul_SkAlphaType);
- sk_sp<SkSurface> s = SkSurface::MakeRenderTarget(dContext, SkBudgeted::kYes,
+ sk_sp<SkSurface> s = SkSurface::MakeRenderTarget(context, SkBudgeted::kYes,
screenII, 1, kTopLeft_GrSurfaceOrigin,
nullptr);
SkCanvas* c = s->getCanvas();
@@ -74,7 +74,7 @@
}
// flush here just to clear the playing field
- dContext->flushAndSubmit();
+ context->flushAndSubmit();
size_t beforeBytes = cache->getResourceBytes();
@@ -93,7 +93,7 @@
SkIRect outSubset;
SkIPoint offset;
- sk_sp<SkImage> filteredImg = smImg->makeWithFilter(dContext, blur.get(), subset, clip,
+ sk_sp<SkImage> filteredImg = smImg->makeWithFilter(context, blur.get(), subset, clip,
&outSubset, &offset);
SkRect dstRect = SkRect::MakeXYWH(offset.fX, offset.fY,
@@ -101,7 +101,7 @@
dstCanvas->drawImageRect(filteredImg, outSubset, dstRect, nullptr);
// Flush here to mimic Chrome's SkiaHelper::ApplyImageFilter
- dContext->flushAndSubmit();
+ context->flushAndSubmit();
clip.fRight -= 16;
}