Skip to content

Commit

Permalink
Update ImageDrawable with antialias, dither, filter, and tile modes
Browse files Browse the repository at this point in the history
  • Loading branch information
BloCamLimb committed Aug 25, 2024
1 parent 1668fa8 commit 742c7a5
Show file tree
Hide file tree
Showing 3 changed files with 266 additions and 24 deletions.
16 changes: 16 additions & 0 deletions core/src/main/java/icyllis/modernui/graphics/ImageShader.java
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,22 @@ public boolean getLocalMatrix(@NonNull Matrix localMatrix) {
return false;
}

/**
* Return true if the local matrix of the shader is equal to the given local matrix.
*
* @param localMatrix the local matrix to compare, null means identity
* @return true if local matrix equals
*/
public boolean localMatrixEquals(@Nullable Matrix localMatrix) {
if (localMatrix == null || localMatrix.isIdentity()) {
return mLocalMatrix == null;
} else if (mLocalMatrix == null) {
return false;
} else {
return mLocalMatrix.equals(localMatrix);
}
}

/**
* @hidden
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ public void setAlpha(int alpha) {
* return value is 255 if the class does not override this method to return a value
* specific to its use of alpha.
*/
@IntRange(from = 0, to = 255)
public int getAlpha() {
return 0xFF;
}
Expand Down
Loading

0 comments on commit 742c7a5

Please sign in to comment.