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

Commit 765d3124 authored by Mike Reed's avatar Mike Reed
Browse files

use colormatrix w/o legacy apis

Test: make

Change-Id: I01e29bd36ed3788c4f996092c81310c17f5039cd
parent 0945f83b
Loading
Loading
Loading
Loading
+5 −12
Original line number Diff line number Diff line
@@ -53,20 +53,13 @@ private:
                x, y, x + width, y + height,
                [width, height](RenderProperties& props, Canvas& canvas) {
                    SkPaint paint;
                    float matrix[20] = {0};
                    
                    // Simple scale/translate case where R, G, and B are all treated equivalently
                    matrix[SkColorMatrix::kR_Scale] = 1.1f;
                    matrix[SkColorMatrix::kG_Scale] = 1.1f;
                    matrix[SkColorMatrix::kB_Scale] = 1.1f;
                    matrix[SkColorMatrix::kA_Scale] = 0.5f;
                    SkColorMatrix cm;
                    cm.setScale(1.1f, 1.1f, 1.1f, 0.5f);
                    cm.postTranslate255(5.0f, 5.0f, 5.0f, 10.0f);

                    matrix[SkColorMatrix::kR_Trans] = 5.0f;
                    matrix[SkColorMatrix::kG_Trans] = 5.0f;
                    matrix[SkColorMatrix::kB_Trans] = 5.0f;
                    matrix[SkColorMatrix::kA_Trans] = 10.0f;

                    paint.setColorFilter(SkColorFilters::MatrixRowMajor255(matrix));
                    paint.setColorFilter(SkColorFilters::Matrix(cm));

                    // set a shader so it's not likely for the matrix to be optimized away (since a
                    // clever