Skip to content

Commit

Permalink
Update with latest Arc3D
Browse files Browse the repository at this point in the history
  • Loading branch information
BloCamLimb committed Aug 21, 2024
1 parent 4f0b0ff commit ea3f76a
Show file tree
Hide file tree
Showing 19 changed files with 676 additions and 143 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/icyllis/modernui/ModernUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ public void run(@NonNull Fragment fragment) {
Monitor monitor = Monitor.getPrimary();

/*TinyFileDialogs.tinyfd_messageBox(
"Arc3D Test",
"Arc3D starting with pid: " + ProcessHandle.current().pid(),
"ModernUI Test",
"ModernUI starting with pid: " + ProcessHandle.current().pid(),
"ok",
"info",
true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ private AngularGradient(float centerX, float centerY,
if (colorCount < 1) {
throw new IllegalArgumentException("needs >= 1 number of colors");
}
mShader = icyllis.arc3d.core.shaders.AngularGradient.makeAngular(
mShader = icyllis.arc3d.core.shaders.AngularGradient.make(
centerX, centerY,
startAngle, endAngle,
colors,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ private LinearGradient(float startX, float startY,
if (colorCount < 1) {
throw new IllegalArgumentException("needs >= 1 number of colors");
}
mShader = icyllis.arc3d.core.shaders.LinearGradient.makeLinear(
mShader = icyllis.arc3d.core.shaders.LinearGradient.make(
startX, startY,
endX, endY,
colors,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ private RadialGradient(float centerX, float centerY,
if (colorCount < 1) {
throw new IllegalArgumentException("needs >= 1 number of colors");
}
mShader = icyllis.arc3d.core.shaders.RadialGradient.makeRadial(
mShader = icyllis.arc3d.core.shaders.RadialGradient.make(
centerX, centerY,
radius,
colors,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ public AngularGradient(float centerX, float centerY,
@CheckReturnValue
@Nullable
@SharedPtr
public static Shader makeAngular(float centerX, float centerY,
float startAngle, float endAngle,
@Nonnull float[] colors,
@Nullable ColorSpace colorSpace,
@Nullable float[] positions,
int colorCount,
int tileMode,
int interpolation,
@Nullable Matrixc localMatrix) {
public static Shader make(float centerX, float centerY,
float startAngle, float endAngle,
@Nonnull float[] colors,
@Nullable ColorSpace colorSpace,
@Nullable float[] positions,
int colorCount,
int tileMode,
int interpolation,
@Nullable Matrixc localMatrix) {
if (!Float.isFinite(startAngle) || !Float.isFinite(endAngle)) {
return null;
}
Expand Down Expand Up @@ -144,7 +144,7 @@ public static Shader makeAngular(float centerX, float centerY,
float[] newColor = {colors[0], colors[1], colors[2], colors[3],
colors[0], colors[1], colors[2], colors[3],
colors[i], colors[i + 1], colors[i + 2], colors[i + 3]};
return makeAngular(centerX, centerY, 0, endAngle,
return make(centerX, centerY, 0, endAngle,
newColor, colorSpace, newPos, 3, tileMode, interpolation, localMatrix);
}
return makeDegenerateGradient(colors, colorSpace, positions, colorCount, tileMode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@

import javax.annotation.Nullable;

public final class BlendModeShader extends Shader {
public final class BlendShader extends Shader {

private final BlendMode mMode;
@SharedPtr
private final Shader mSrc;
@SharedPtr
private final Shader mDst;

BlendModeShader(BlendMode mode, @SharedPtr Shader src, @SharedPtr Shader dst) {
BlendShader(BlendMode mode, @SharedPtr Shader src, @SharedPtr Shader dst) {
mMode = mode;
mSrc = src;
mDst = dst;
Expand Down Expand Up @@ -60,7 +60,7 @@ public static Shader make(BlendMode mode, @SharedPtr Shader src, @SharedPtr Shad
return dst;
}
}
return new BlendModeShader(mode, src, dst); // move
return new BlendShader(mode, src, dst); // move
}

@Override
Expand Down
Loading

0 comments on commit ea3f76a

Please sign in to comment.