Skip to content

Commit

Permalink
refactor: use old style switch statement in FeCompositeView.java (#2562)
Browse files Browse the repository at this point in the history
Use old-style switch statement in `FeCompositeView.java`.
  • Loading branch information
mrtawil authored Dec 6, 2024
1 parent c59eb29 commit d1e9114
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions android/src/main/java/com/horcrux/svg/FeCompositeView.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,22 @@ public Bitmap applyFilter(HashMap<String, Bitmap> resultsMap, Bitmap prevResult)
canvas.drawBitmap(in1, 0, 0, paint);

switch (this.mOperator) {
case OVER -> {
case OVER:
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_OVER));
}
case IN -> {
break;
case IN:
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_IN));
}
case OUT -> {
break;
case OUT:
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_OUT));
}
case ATOP -> {
break;
case ATOP:
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_ATOP));
}
case XOR -> {
break;
case XOR:
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.XOR));
}
case ARITHMETIC -> {
break;
case ARITHMETIC:
// result = k1*i1*i2 + k2*i1 + k3*i2 + k4
int nPixels = result.getWidth() * result.getHeight();
int[] pixels1 = new int[nPixels];
Expand Down Expand Up @@ -121,7 +121,7 @@ public Bitmap applyFilter(HashMap<String, Bitmap> resultsMap, Bitmap prevResult)

result.setPixels(
pixels1, 0, result.getWidth(), 0, 0, result.getWidth(), result.getHeight());
}
break;
}

if (this.mOperator != FilterProperties.FeCompositeOperator.ARITHMETIC) {
Expand Down

0 comments on commit d1e9114

Please sign in to comment.