diff --git a/src/effects/SkToSRGBColorFilter.cpp b/src/effects/SkToSRGBColorFilter.cpp index 948c4d908b..41b54e1ecd 100644 --- a/src/effects/SkToSRGBColorFilter.cpp +++ b/src/effects/SkToSRGBColorFilter.cpp @@ -40,15 +40,15 @@ void SkToSRGBColorFilter::onAppendStages(SkRasterPipeline* p, // Step 2: Transform to sRGB gamut, without clamping. float* gamut_transform = alloc->makeArrayDefault(12); - (void)append_gamut_transform_noclamp(p, - gamut_transform, - fSrcColorSpace.get(), - SkColorSpace::MakeSRGB().get()); - - bool needs_clamp_0, needs_clamp_1; - analyze_3x4_matrix(gamut_transform, &needs_clamp_0, &needs_clamp_1); - if (needs_clamp_0 || needs_clamp_1) { - p->set_clamped(false); + if (append_gamut_transform_noclamp(p, + gamut_transform, + fSrcColorSpace.get(), + SkColorSpace::MakeSRGB().get())) { + bool needs_clamp_0, needs_clamp_1; + analyze_3x4_matrix(gamut_transform, &needs_clamp_0, &needs_clamp_1); + if (needs_clamp_0 || needs_clamp_1) { + p->set_clamped(false); + } } // Step 3: Back to sRGB encoding.