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

Unified Diff: src/gpu/GrBlurUtils.cpp

Issue 2296193005: Add a makeDrawContextWithFallback that handles config fallback (Closed)
Patch Set: update Created 4 years, 3 months 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/SkBlurMaskFilter.cpp ('k') | src/gpu/GrClipStackClip.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrBlurUtils.cpp
diff --git a/src/gpu/GrBlurUtils.cpp b/src/gpu/GrBlurUtils.cpp
index 2b7540da0abc6d40829aa3ee7890995022527d3e..383652dcb7f610d14d19bdde34146a711af64f87 100644
--- a/src/gpu/GrBlurUtils.cpp
+++ b/src/gpu/GrBlurUtils.cpp
@@ -104,19 +104,12 @@ static sk_sp<GrTexture> create_mask_GPU(GrContext* context,
sampleCnt = 0;
}
- // We actually only need A8, but it often isn't supported as a
- // render target so default to RGBA_8888
- GrPixelConfig config = kRGBA_8888_GrPixelConfig;
- if (context->caps()->isConfigRenderable(kAlpha_8_GrPixelConfig, sampleCnt > 0)) {
- config = kAlpha_8_GrPixelConfig;
- }
-
- sk_sp<GrDrawContext> drawContext(context->makeDrawContext(SkBackingFit::kApprox,
- maskRect.width(),
- maskRect.height(),
- config,
- nullptr,
- sampleCnt));
+ sk_sp<GrDrawContext> drawContext(context->makeDrawContextWithFallback(SkBackingFit::kApprox,
+ maskRect.width(),
+ maskRect.height(),
+ kAlpha_8_GrPixelConfig,
+ nullptr,
+ sampleCnt));
if (!drawContext) {
return nullptr;
}
« no previous file with comments | « src/effects/SkBlurMaskFilter.cpp ('k') | src/gpu/GrClipStackClip.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698