Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(202)

Unified Diff: src/effects/SkBlurMaskFilter.cpp

Issue 2514543002: Defer more renderTargetContexts in the GPU image filter paths - take 2 (Closed)
Patch Set: Add more bullet proofing Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/effects/SkAlphaThresholdFilter.cpp ('k') | src/gpu/GrBlurUtils.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkBlurMaskFilter.cpp
diff --git a/src/effects/SkBlurMaskFilter.cpp b/src/effects/SkBlurMaskFilter.cpp
index e5d521a3581c3b7dacfe8d8d5528c453cd44c2bf..c4a6b2979849bfc0376fc86ef93094e90ebbfbb8 100644
--- a/src/effects/SkBlurMaskFilter.cpp
+++ b/src/effects/SkBlurMaskFilter.cpp
@@ -1122,7 +1122,7 @@ static sk_sp<GrTexture> find_or_create_rrect_blur_mask(GrContext* context,
sk_sp<GrTexture> mask(context->textureProvider()->findAndRefTextureByUniqueKey(key));
if (!mask) {
// TODO: this could be approx but the texture coords will need to be updated
- sk_sp<GrRenderTargetContext> rtc(context->makeRenderTargetContextWithFallback(
+ sk_sp<GrRenderTargetContext> rtc(context->makeDeferredRenderTargetContextWithFallback(
SkBackingFit::kExact, size.fWidth, size.fHeight, kAlpha_8_GrPixelConfig, nullptr));
if (!rtc) {
return nullptr;
@@ -1142,8 +1142,8 @@ static sk_sp<GrTexture> find_or_create_rrect_blur_mask(GrContext* context,
srcTexture.get(),
nullptr,
SkIRect::MakeWH(
- size.fWidth,
- size.fHeight),
+ size.fWidth,
+ size.fHeight),
nullptr,
xformedSigma, xformedSigma,
SkBackingFit::kExact));
@@ -1152,7 +1152,9 @@ static sk_sp<GrTexture> find_or_create_rrect_blur_mask(GrContext* context,
}
mask = rtc2->asTexture();
- SkASSERT(mask);
+ if (!mask) {
+ return nullptr;
+ }
context->textureProvider()->assignUniqueKeyToTexture(key, mask.get());
}
@@ -1540,7 +1542,7 @@ bool SkBlurMaskFilterImpl::filterMaskGPU(GrTexture* src,
}
*result = renderTargetContext->asTexture().release();
- return true;
+ return SkToBool(*result);
}
#endif // SK_SUPPORT_GPU
« no previous file with comments | « src/effects/SkAlphaThresholdFilter.cpp ('k') | src/gpu/GrBlurUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698