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

Unified Diff: Source/platform/graphics/ColorSpace.cpp

Issue 1083213004: Move createColorSpaceFilter from ImageBuffer to ColorSpaceUtilities (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 | « Source/platform/graphics/ColorSpace.h ('k') | Source/platform/graphics/GraphicsContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/ColorSpace.cpp
diff --git a/Source/platform/graphics/ColorSpace.cpp b/Source/platform/graphics/ColorSpace.cpp
index 50553ecd71ec1744594929de66b20c510b80a708..fd2a85eb0b16baafe4df1c12894ac5e707358ec9 100644
--- a/Source/platform/graphics/ColorSpace.cpp
+++ b/Source/platform/graphics/ColorSpace.cpp
@@ -33,6 +33,7 @@
#include "config.h"
#include "platform/graphics/ColorSpace.h"
+#include "third_party/skia/include/effects/SkTableColorFilter.h"
#include "wtf/MathExtras.h"
namespace blink {
@@ -102,6 +103,15 @@ Color convertColor(const Color& srcColor, ColorSpace dstColorSpace, ColorSpace s
return Color(lookupTable[srcColor.red()], lookupTable[srcColor.green()], lookupTable[srcColor.blue()], srcColor.alpha());
}
+PassRefPtr<SkColorFilter> createColorSpaceFilter(ColorSpace srcColorSpace, ColorSpace dstColorSpace)
+{
+ const uint8_t* lookupTable = getConversionLUT(dstColorSpace, srcColorSpace);
+ if (!lookupTable)
+ return nullptr;
+
+ return adoptRef(SkTableColorFilter::CreateARGB(0, lookupTable, lookupTable, lookupTable));
+}
+
} // namespace ColorSpaceUtilities
} // namespace blink
« no previous file with comments | « Source/platform/graphics/ColorSpace.h ('k') | Source/platform/graphics/GraphicsContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698