Remove pixel config fallback - failing is a better option.
This produces surprising results in some cases. For example: Attempt to make an F16 SkSurface on ANGLE. We can't render to F16, but this succeeds and gives you back an N32 surface instead. Ran all tests and GMs in DM on ANGLE (where this is most likely to be an issue). No problems. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2272423004 Review-Url: https://codereview.chromium.org/2272423004
This commit is contained in:
parent
f419781d37
commit
464a7d6f95
@ -171,13 +171,10 @@ sk_sp<GrDrawContext> SkGpuDevice::MakeDrawContext(GrContext* context,
|
||||
at = kPremul_SkAlphaType; // force this setting
|
||||
}
|
||||
|
||||
GrPixelConfig origConfig = SkImageInfo2GrPixelConfig(ct, at, cs, *context->caps());
|
||||
if (!context->caps()->isConfigRenderable(origConfig, sampleCount > 0)) {
|
||||
// Fall back from whatever ct was to default of kRGBA or kBGRA which is aliased as kN32
|
||||
ct = kN32_SkColorType;
|
||||
}
|
||||
|
||||
GrPixelConfig config = SkImageInfo2GrPixelConfig(ct, at, cs, *context->caps());
|
||||
if (!context->caps()->isConfigRenderable(config, sampleCount > 0)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return context->makeDrawContext(SkBackingFit::kExact, // Why exact?
|
||||
origInfo.width(), origInfo.height(),
|
||||
|
Loading…
Reference in New Issue
Block a user