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

Unified Diff: src/core/SkBlitter.cpp

Issue 1634273002: float components in xfermodes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: disable blitter for official checkin Created 4 years, 11 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
Index: src/core/SkBlitter.cpp
diff --git a/src/core/SkBlitter.cpp b/src/core/SkBlitter.cpp
index b73be40a4576da10338cfcb4017b2c6e320bd44c..eec31525a63548abfb3bf377d7c541c8275de09f 100644
--- a/src/core/SkBlitter.cpp
+++ b/src/core/SkBlitter.cpp
@@ -19,6 +19,15 @@
#include "SkXfermode.h"
#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
+
SkBlitter::~SkBlitter() {}
bool SkBlitter::isNullBlitter() const { return false; }
@@ -905,8 +914,13 @@ SkBlitter* SkBlitter::Choose(const SkPixmap& device,
case kN32_SkColorType:
if (shader) {
- blitter = allocator->createT<SkARGB32_Shader_Blitter>(
- device, *paint, shaderContext);
+ if (shaderContext->supports4f() && ALLOW_SRGB) {
+ blitter = allocator->createT<SkARGB32_Shader4f_Blitter>(
+ device, *paint, shaderContext);
+ } else {
+ 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) {

Powered by Google App Engine
This is Rietveld 408576698