| 5 | import org.jetbrains.skija.impl.*; |
| 6 | |
| 7 | public class Paint extends Managed { |
| 8 | static { Library.staticLoad(); } |
| 9 | |
| 10 | @ApiStatus.Internal |
| 11 | public static class _FinalizerHolder { |
| 12 | public static final long PTR = _nGetFinalizer(); |
| 13 | } |
| 14 | |
| 15 | @ApiStatus.Internal |
| 16 | public Paint(long ptr, boolean managed) { |
| 17 | super(ptr, _FinalizerHolder.PTR, managed); |
| 18 | } |
| 19 | |
| 20 | /** |
| 21 | * Constructs SkPaint with default values. |
| 22 | * |
| 23 | * @see <a href="https://fiddle.skia.org/c/@Paint_empty_constructor">https://fiddle.skia.org/c/@Paint_empty_constructor</a> |
| 24 | */ |
| 25 | public Paint() { |
| 26 | super(_nMake(), _FinalizerHolder.PTR); |
| 27 | Stats.onNativeCall(); |
| 28 | } |
| 29 | |
| 30 | /** |
| 31 | * <p>Makes a shallow copy of Paint. PathEffect, Shader, |
| 32 | * MaskFilter, ColorFilter, and ImageFilter are shared |
| 33 | * between the original paint and the copy.</p> |
| 34 | * |
| 35 | * <p>The referenced objects PathEffect, Shader, MaskFilter, ColorFilter, |
| 36 | * and ImageFilter cannot be modified after they are created.</p> |
| 37 | * |
| 38 | * @return shallow copy of paint |
| 39 | * |
| 40 | * @see <a href="https://fiddle.skia.org/c/@Paint_copy_const_SkPaint">https://fiddle.skia.org/c/@Paint_copy_const_SkPaint</a> |
| 41 | */ |
| 42 | @NotNull @Contract("-> new") |
| 43 | public Paint makeClone() { |
| 44 | try { |
| 45 | Stats.onNativeCall(); |
| 46 | return new Paint(_nMakeClone(_ptr), true); |
| 47 | } finally { |
| 48 | Reference.reachabilityFence(this); |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | @ApiStatus.Internal @Override |
| 53 | public boolean _nativeEquals(Native other) { |
| 54 | try { |
| 55 | return _nEquals(_ptr, Native.getPtr(other)); |
| 56 | } finally { |
| 57 | Reference.reachabilityFence(this); |
| 58 | Reference.reachabilityFence(other); |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | /** |
| 63 | * Sets all Paint contents to their initial values. This is equivalent to replacing |
| 64 | * Paint with the result of Paint(). |
no test coverage detected