Reland "Migrate SkImage::makeWithFilter to GrRecordingContext"
This reverts commit d13b97f94c9f86081bb99dc505632f8e43ca610e.
Reason for revert: Fixed chromium canary
Original change's description:
> 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>
TBR=bsalomon@google.com,robertphillips@google.com,adlai@google.com
Bug: skia:104662
Change-Id: I815677659f776966b1c7e362ce3df444834dd482
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304803
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
diff --git a/tests/RepeatedClippedBlurTest.cpp b/tests/RepeatedClippedBlurTest.cpp
index 1db63be..1161ce7 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 context = ctxInfo.directContext();
- GrResourceCache* cache = context->priv().getResourceCache();
+ auto dContext = ctxInfo.directContext();
+ GrResourceCache* cache = dContext->priv().getResourceCache();
const SkImageInfo ii = SkImageInfo::Make(1024, 600, kRGBA_8888_SkColorType,
kPremul_SkAlphaType);
- sk_sp<SkSurface> dst(SkSurface::MakeRenderTarget(context, SkBudgeted::kNo, ii));
+ sk_sp<SkSurface> dst(SkSurface::MakeRenderTarget(dContext, 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(context);
+ bigImg = rasterImg->makeTextureImage(dContext);
}
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(context, SkBudgeted::kYes,
+ sk_sp<SkSurface> s = SkSurface::MakeRenderTarget(dContext, SkBudgeted::kYes,
screenII, 1, kTopLeft_GrSurfaceOrigin,
nullptr);
SkCanvas* c = s->getCanvas();
@@ -74,7 +74,7 @@
}
// flush here just to clear the playing field
- context->flushAndSubmit();
+ dContext->flushAndSubmit();
size_t beforeBytes = cache->getResourceBytes();
@@ -93,7 +93,7 @@
SkIRect outSubset;
SkIPoint offset;
- sk_sp<SkImage> filteredImg = smImg->makeWithFilter(context, blur.get(), subset, clip,
+ sk_sp<SkImage> filteredImg = smImg->makeWithFilter(dContext, 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
- context->flushAndSubmit();
+ dContext->flushAndSubmit();
clip.fRight -= 16;
}