Index: src/core/SkBlitter.cpp |
diff --git a/src/core/SkBlitter.cpp b/src/core/SkBlitter.cpp |
index eec31525a63548abfb3bf377d7c541c8275de09f..45219c50cb1ad0a3ded7263d01c905f196033df4 100644 |
--- a/src/core/SkBlitter.cpp |
+++ b/src/core/SkBlitter.cpp |
@@ -20,13 +20,7 @@ |
#include "SkXfermodeInterpretation.h" |
// define this for testing srgb blits |
-//#define SK_SUPPORT_SRGB_RASTER |
- |
-#ifdef SK_SUPPORT_SRGB_RASTER |
- #define ALLOW_SRGB true |
-#else |
- #define ALLOW_SRGB false |
-#endif |
+//#define SK_FORCE_PM4f_FOR_L32_BLITS |
SkBlitter::~SkBlitter() {} |
@@ -913,23 +907,32 @@ SkBlitter* SkBlitter::Choose(const SkPixmap& device, |
break; |
case kN32_SkColorType: |
- if (shader) { |
- if (shaderContext->supports4f() && ALLOW_SRGB) { |
- blitter = allocator->createT<SkARGB32_Shader4f_Blitter>( |
- device, *paint, shaderContext); |
+#ifdef SK_FORCE_PM4f_FOR_L32_BLITS |
+ if (true) |
+#else |
+ if (device.info().isSRGB()) |
+#endif |
+ { |
+ blitter = SkBlitter_ARGB32_Create(device, *paint, shaderContext, allocator); |
+ } else { |
+ if (shader) { |
+ blitter = allocator->createT<SkARGB32_Shader_Blitter>( |
+ device, *paint, shaderContext); |
+ } else if (paint->getColor() == SK_ColorBLACK) { |
+ blitter = allocator->createT<SkARGB32_Black_Blitter>(device, *paint); |
+ } else if (paint->getAlpha() == 0xFF) { |
+ blitter = allocator->createT<SkARGB32_Opaque_Blitter>(device, *paint); |
} else { |
- blitter = allocator->createT<SkARGB32_Shader_Blitter>( |
- device, *paint, shaderContext); |
+ blitter = allocator->createT<SkARGB32_Blitter>(device, *paint); |
} |
- } else if (paint->getColor() == SK_ColorBLACK) { |
- blitter = allocator->createT<SkARGB32_Black_Blitter>(device, *paint); |
- } else if (paint->getAlpha() == 0xFF) { |
- blitter = allocator->createT<SkARGB32_Opaque_Blitter>(device, *paint); |
- } else { |
- blitter = allocator->createT<SkARGB32_Blitter>(device, *paint); |
} |
break; |
+ case kRGBA_F16_SkColorType: |
+ // kU16_SkColorType: |
+ blitter = SkBlitter_ARGB64_Create(device, *paint, shaderContext, allocator); |
+ break; |
+ |
default: |
SkDEBUGFAIL("unsupported device config"); |
blitter = allocator->createT<SkNullBlitter>(); |
@@ -972,6 +975,7 @@ SkShaderBlitter::SkShaderBlitter(const SkPixmap& device, const SkPaint& paint, |
fShader->ref(); |
fShaderFlags = fShaderContext->getFlags(); |
+ fConstInY = SkToBool(fShaderFlags & SkShader::kConstInY32_Flag); |
} |
SkShaderBlitter::~SkShaderBlitter() { |