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

Commit e5973728 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "use colormatrix w/o legacy apis"

parents 800009e9 765d3124
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