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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 1890923003: Several fixes for fp 16 rendering: (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Nicer looking clamp Created 4 years, 8 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 | « samplecode/SampleApp.cpp ('k') | 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 4d82b201e74374db6a3ac9f2683e448fe4ecde11..08eab55d26e0008cf5fbf53fd135489f1713e6c8 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -191,15 +191,19 @@ GrRenderTarget* SkGpuDevice::CreateRenderTarget(GrContext* context, SkBudgeted b
SkColorType ct = origInfo.colorType();
SkAlphaType at = origInfo.alphaType();
SkColorProfileType pt = origInfo.profileType();
- if (kRGB_565_SkColorType == ct) {
+ if (kRGB_565_SkColorType == ct || kGray_8_SkColorType == ct) {
at = kOpaque_SkAlphaType; // force this setting
- } else if (ct != kBGRA_8888_SkColorType && ct != kRGBA_8888_SkColorType) {
- // Fall back from whatever ct was to default of kRGBA or kBGRA which is aliased as kN32
- ct = kN32_SkColorType;
}
if (kOpaque_SkAlphaType != at) {
at = kPremul_SkAlphaType; // force this setting
}
+
+ GrPixelConfig origConfig = SkImageInfo2GrPixelConfig(ct, at, pt, *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;
+ }
+
const SkImageInfo info = SkImageInfo::Make(origInfo.width(), origInfo.height(), ct, at, pt);
GrSurfaceDesc desc;
« no previous file with comments | « samplecode/SampleApp.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698