Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a9593496 authored by Leon Scroggins III's avatar Leon Scroggins III
Browse files

Switch to Skia's new representation of linear gamma

Bug: 77276533
Test: CtsGraphicsTestCases ImageDecoderTest#testColorSpace
      ag/5244477

Although the old one works for [0,1], Skia has switched to this new
representation because it has the following nice properties:
- it extends cleanly above 1
- it's unambiguously defined

Having ColorSpace out of sync results in mismatches between those
objects underlying SkColorSpace objects when they should be the same.

Change-Id: Ie5cf223d6053718aded12b66ea58a874ce888903
parent 1e7b9347
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -2525,9 +2525,7 @@ public abstract class ColorSpace {
                    gamma == 1.0 ? DoubleUnaryOperator.identity() :
                            x -> Math.pow(x < 0.0 ? 0.0 : x, gamma),
                    min, max, id);
            mTransferParameters = gamma == 1.0 ?
                    new TransferParameters(0.0, 0.0, 1.0, 1.0 + Math.ulp(1.0f), gamma) :
                    new TransferParameters(1.0, 0.0, 0.0, 0.0, gamma);
            mTransferParameters = new TransferParameters(1.0, 0.0, 0.0, 0.0, gamma);
        }

        /**