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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 2272423004: Remove pixel config fallback - failing is a better option. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index a6c8a1fc74fceb34ff86038324c78d25368c2fa0..c91331f4b9873f3381f3cf995fd92165b528f041 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(),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698