diff options
author | 2016-09-16 11:01:27 -0700 | |
---|---|---|
committer | 2016-09-16 11:01:27 -0700 | |
commit | c71a9b7f53938b4f33f36f48e867b8b72cc1cc61 (patch) | |
tree | 8fbb6b55eb00f5fb5b55e89d97076f199cc0e205 /src/gpu/SkGr.cpp | |
parent | 046cb56c6c1bb40779c81b115271ed0e8196b48b (diff) |
Revert of Support Float32 output from SkColorSpaceXform (patchset #7 id:140001 of https://codereview.chromium.org/2339233003/ )
Reason for revert:
Hitting an assert
Original issue's description:
> Support Float32 output from SkColorSpaceXform
>
> * Adds Float32 support to SkColorSpaceXform
> * Changes API to allows clients to ask for F32, updates clients to
> new API
> * Adds Sk4f_load4 and Sk4f_store4 to SkNx
> * Make use of new xform in SkGr.cpp
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2339233003
> CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/43d6651111374b5d1e4ddd9030dcf079b448ec47
TBR=brianosman@google.com,mtklein@google.com,scroggo@google.com,mtklein@chromium.org,bsalomon@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review-Url: https://codereview.chromium.org/2347473007
Diffstat (limited to 'src/gpu/SkGr.cpp')
-rw-r--r-- | src/gpu/SkGr.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp index 86b1007ba5..c8839f3f1a 100644 --- a/src/gpu/SkGr.cpp +++ b/src/gpu/SkGr.cpp @@ -23,7 +23,6 @@ #include "SkColorFilter.h" #include "SkConfig8888.h" #include "SkCanvas.h" -#include "SkColorSpaceXform.h" #include "SkData.h" #include "SkErrorInternals.h" #include "SkMessageBus.h" @@ -530,20 +529,18 @@ static inline bool skpaint_to_grpaint_impl(GrContext* context, grPaint->setAntiAlias(skPaint.isAntiAlias()); grPaint->setAllowSRGBInputs(dc->isGammaCorrect()); - GrColor4f origColor; + // Raw translation of the SkPaint color to our 4f format: + GrColor4f origColor = GrColor4f::FromGrColor(SkColorToUnpremulGrColor(skPaint.getColor())); // Linearize, if the color is meant to be in sRGB gamma: if (dc->isGammaCorrect()) { - SkColorSpaceXform* xform = dc->getColorXformFromSRGB(); - SkASSERT(xform); + origColor.fRGBA[0] = exact_srgb_to_linear(origColor.fRGBA[0]); + origColor.fRGBA[1] = exact_srgb_to_linear(origColor.fRGBA[1]); + origColor.fRGBA[2] = exact_srgb_to_linear(origColor.fRGBA[2]); - // FIXME (msarett): Support BGRA inputs to SkColorSpaceXform? - uint32_t rgba = SkSwizzle_RB(skPaint.getColor()); - xform->apply(&origColor, &rgba, 1, SkColorSpaceXform::kRGBA_F32_ColorFormat, - kUnpremul_SkAlphaType); - } else { - // Raw translation of the SkPaint color to our 4f format: - origColor = GrColor4f::FromGrColor(SkColorToUnpremulGrColor(skPaint.getColor())); + if (dc->getColorXformFromSRGB()) { + origColor = dc->getColorXformFromSRGB()->apply(origColor); + } } // Setup the initial color considering the shader, the SkPaint color, and the presence or not |