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

Unified Diff: src/core/SkColorSpaceXform.cpp

Issue 2174493002: Add color space xform support to SkJpegCodec (includes F16!) (Closed) Base URL: https://skia.googlesource.com/skia.git@drop
Patch Set: Fix MSAN suppression Created 4 years, 5 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/SkColorSpaceXform.h ('k') | src/core/SkOpts.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkColorSpaceXform.cpp
diff --git a/src/core/SkColorSpaceXform.cpp b/src/core/SkColorSpaceXform.cpp
index 924f24f6fc1d7768049cf7635efd5f499988ba22..4fbfa6cd9e26973348fbfed05542bcb70df94cff 100644
--- a/src/core/SkColorSpaceXform.cpp
+++ b/src/core/SkColorSpaceXform.cpp
@@ -629,7 +629,7 @@ SkColorSpaceXform_Base<Dst>::SkColorSpaceXform_Base(const sk_sp<SkColorSpace>& s
template <>
void SkColorSpaceXform_Base<SkColorSpace::kSRGB_GammaNamed>
-::applyTo8888(SkPMColor* dst, const RGBA32* src, int len) const
+::applyToRGBA(RGBA32* dst, const RGBA32* src, int len) const
{
if (fColorLUT) {
handle_color_lut(dst, src, len, fColorLUT.get());
@@ -641,7 +641,7 @@ void SkColorSpaceXform_Base<SkColorSpace::kSRGB_GammaNamed>
template <>
void SkColorSpaceXform_Base<SkColorSpace::k2Dot2Curve_GammaNamed>
-::applyTo8888(SkPMColor* dst, const RGBA32* src, int len) const
+::applyToRGBA(RGBA32* dst, const RGBA32* src, int len) const
{
if (fColorLUT) {
handle_color_lut(dst, src, len, fColorLUT.get());
@@ -653,7 +653,7 @@ void SkColorSpaceXform_Base<SkColorSpace::k2Dot2Curve_GammaNamed>
template <>
void SkColorSpaceXform_Base<SkColorSpace::kNonStandard_GammaNamed>
-::applyTo8888(SkPMColor* dst, const RGBA32* src, int len) const
+::applyToRGBA(RGBA32* dst, const RGBA32* src, int len) const
{
if (fColorLUT) {
handle_color_lut(dst, src, len, fColorLUT.get());
@@ -663,6 +663,43 @@ void SkColorSpaceXform_Base<SkColorSpace::kNonStandard_GammaNamed>
SkOpts::color_xform_RGB1_to_table(dst, src, len, fSrcGammaTables, fSrcToDst, fDstGammaTables);
}
+template <>
+void SkColorSpaceXform_Base<SkColorSpace::kSRGB_GammaNamed>
+::applyToBGRA(BGRA32* dst, const RGBA32* src, int len) const
+{
+ if (fColorLUT) {
+ handle_color_lut(dst, src, len, fColorLUT.get());
+ src = dst;
+ }
+
+ SkOpts::color_xform_RGB1_to_srgb_swaprb(dst, src, len, fSrcGammaTables, fSrcToDst);
+}
+
+template <>
+void SkColorSpaceXform_Base<SkColorSpace::k2Dot2Curve_GammaNamed>
+::applyToBGRA(BGRA32* dst, const RGBA32* src, int len) const
+{
+ if (fColorLUT) {
+ handle_color_lut(dst, src, len, fColorLUT.get());
+ src = dst;
+ }
+
+ SkOpts::color_xform_RGB1_to_2dot2_swaprb(dst, src, len, fSrcGammaTables, fSrcToDst);
+}
+
+template <>
+void SkColorSpaceXform_Base<SkColorSpace::kNonStandard_GammaNamed>
+::applyToBGRA(BGRA32* dst, const RGBA32* src, int len) const
+{
+ if (fColorLUT) {
+ handle_color_lut(dst, src, len, fColorLUT.get());
+ src = dst;
+ }
+
+ SkOpts::color_xform_RGB1_to_table_swaprb(dst, src, len, fSrcGammaTables, fSrcToDst,
+ fDstGammaTables);
+}
+
template <SkColorSpace::GammaNamed T>
void SkColorSpaceXform_Base<T>
::applyToF16(RGBAF16* dst, const RGBA32* src, int len) const
« no previous file with comments | « src/core/SkColorSpaceXform.h ('k') | src/core/SkOpts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698