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

Unified Diff: src/core/SkBlitter.cpp

Issue 1697863002: blitters for sRGB and float16 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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 | « src/core/SkBitmapDevice.cpp ('k') | src/core/SkBlitter_PM4f.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « src/core/SkBitmapDevice.cpp ('k') | src/core/SkBlitter_PM4f.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698