Skip to content

Commit 1e1a56b

Browse files
committedFeb 16, 2023
8302679: Regression - Fix for JDK-8301669 broke BYTE_ALPHA pixel format
1 parent 9b3efe3 commit 1e1a56b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
 

‎modules/javafx.graphics/src/main/java/com/sun/prism/mtl/MTLTexture.java

+12
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,18 @@ public void update(Buffer buffer, PixelFormat format, int dstx, int dsty, int sr
195195
}
196196
break;
197197

198+
case BYTE_ALPHA: {
199+
ByteBuffer buf = (ByteBuffer)buffer;
200+
byte[] arr = buf.hasArray()? buf.array(): null;
201+
202+
if (arr == null) {
203+
arr = new byte[buf.remaining()];
204+
buf.get(arr);
205+
}
206+
nUpdate(this.context.getContextHandle(), /*MetalTexture*/this.getNativeHandle(), arr, dstx, dsty, srcx, srcy, srcw, srch, srcscan);
207+
}
208+
break;
209+
198210
default:
199211
throw new IllegalArgumentException("Unsupported PixelFormat "+ format);
200212
}

0 commit comments

Comments
 (0)