Flutter Engine
The Flutter Engine
LinearGradient.java
Go to the documentation of this file.
1/*
2 * Copyright 2021 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8package org.skia.jetski;
9
10import androidx.annotation.Nullable;
11import java.lang.IllegalArgumentException;
12
13public class LinearGradient extends Gradient {
14 public LinearGradient(float x0, float y0, float x1, float y1, int[] colors,
15 float[] pos, TileMode tm,
16 @Nullable Matrix localMatrix) throws IllegalArgumentException {
17 super(colors, pos, tm, localMatrix,
18 (c, p, t, m) -> nMakeLinear(x0, y0, x1, y1, c, p, t, m));
19 }
20
21 public LinearGradient(float x0, float y0, float x1, float y1, int[] colors,
22 float[] pos, TileMode tm) throws IllegalArgumentException {
23 this(x0, y0, x1, y1, colors, pos, tm, null);
24 }
25
26 public LinearGradient(float x0, float y0, float x1, float y1, float[] colors,
27 float[] pos, TileMode tm,
28 @Nullable Matrix localMatrix) throws IllegalArgumentException {
29 super(colors, pos, tm, localMatrix,
30 (c, p, t, m) -> nMakeLinear(x0, y0, x1, y1, c, p, t, m));
31 }
32
33 public LinearGradient(float x0, float y0, float x1, float y1, float[] colors,
34 float[] pos, TileMode tm) throws IllegalArgumentException {
35 this(x0, y0, x1, y1, colors, pos, tm, null);
36 }
37
38 private static native long nMakeLinear(float x0, float y0, float x1, float y1,
39 float[] colors, float[] pos, int tilemode,
40 long nativeLocalMatrix);
41}
SkPoint pos
LinearGradient(float x0, float y0, float x1, float y1, int[] colors, float[] pos, TileMode tm, @Nullable Matrix localMatrix)
LinearGradient(float x0, float y0, float x1, float y1, int[] colors, float[] pos, TileMode tm)
LinearGradient(float x0, float y0, float x1, float y1, float[] colors, float[] pos, TileMode tm)
LinearGradient(float x0, float y0, float x1, float y1, float[] colors, float[] pos, TileMode tm, @Nullable Matrix localMatrix)
PODArray< SkColor > colors
Definition: SkRecords.h:276