aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar brianosman <brianosman@google.com>2016-08-25 08:55:24 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-25 08:55:24 -0700
commit464a7d6f95c9acef829606b7e29ed8d1bef8842c (patch)
treeeda09d1d39a8a67fe99a23febf6c2e1bb1740c1e
parentf419781d378fd78a332fdf9dd5dda0ff65d3c07d (diff)
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
-rw-r--r--src/gpu/SkGpuDevice.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index a6c8a1fc74..c91331f4b9 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -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(),