Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
MatrixColorFilter.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 java.lang.IllegalArgumentException;
11
12public class MatrixColorFilter extends ColorFilter {
13 public MatrixColorFilter(float[] m) throws IllegalArgumentException {
14 super(makeNative(m));
15 }
16
17 private static long makeNative(float[] m) throws IllegalArgumentException {
18 if (m.length != 20) {
19 throw new IllegalArgumentException("Expecting an array of 20 floats.");
20 }
21
22 return nMakeMatrix(m);
23 }
24
25 private static native long nMakeMatrix(float[] m);
26};