Skip to content

Commit 0c252aa

Browse files
author
duke
committed
Added webrev for lanai/214
1 parent cc44517 commit 0c252aa

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

lanai/214/00/commits.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{"commit":{"message":"8263324: Lanai: use the PtrPixelsRow instead of multiplication\n\nAvoid multiplication in address arithmetics"},"files":[{"filename":"src\/java.desktop\/macosx\/native\/libawt_lwawt\/java2d\/metal\/MTLBlitLoops.m"},{"filename":"src\/java.desktop\/macosx\/native\/libawt_lwawt\/java2d\/metal\/MTLBufImgOps.m"},{"filename":"src\/java.desktop\/share\/native\/libawt\/java2d\/loops\/GraphicsPrimitiveMgr.h"}],"sha":"8420687d94febd6c22b82b322070aea042254dbb"}]

lanai/214/00/comparison.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"files":[{"patch":"@@ -602,1 +602,1 @@\n-void copyFromMTLBuffer(void *pDst, id<MTLBuffer> srcBuf, jint offset, jint len, BOOL convertFromArgbPre) {\n+void copyFromMTLBuffer(void *pDst, id<MTLBuffer> srcBuf, NSUInteger offset, NSUInteger len, BOOL convertFromArgbPre) {\n@@ -605,2 +605,2 @@\n- jint pixelLen = len>>2;\n- for (int i = 0; i < pixelLen; i++) {\n+ NSUInteger pixelLen = len >> 2;\n+ for (NSUInteger i = 0; i < pixelLen; i++) {\n@@ -643,0 +643,4 @@\n+ RETURN_IF_TRUE(width < 0);\n+ RETURN_IF_TRUE(height < 0);\n+ NSUInteger w = (NSUInteger)width;\n+ NSUInteger h = (NSUInteger)height;\n@@ -678,1 +682,1 @@\n- pDst = PtrAddBytes(pDst, dstx * dstInfo.pixelStride);\n+ pDst = PtrPixelsRow(pDst, dstx, dstInfo.pixelStride);\n@@ -684,1 +688,1 @@\n- const int byteLength = width * height * 4; \/\/ NOTE: assume that src format is MTLPixelFormatBGRA8Unorm\n+ NSUInteger byteLength = w * h * 4; \/\/ NOTE: assume that src format is MTLPixelFormatBGRA8Unorm\n@@ -711,1 +715,1 @@\n- mtlbuf = [mtlc.device newBufferWithLength:width*height*4 options:MTLResourceStorageModeShared];\n+ mtlbuf = [mtlc.device newBufferWithLength:byteLength options:MTLResourceStorageModeShared];\n@@ -726,1 +730,1 @@\n- sourceSize:MTLSizeMake(width, height, 1)\n+ sourceSize:MTLSizeMake(w, h, 1)\n@@ -728,2 +732,2 @@\n- destinationOffset:0 \/*offset already taken in: pDst = PtrAddBytes(pDst, dstx * dstInfo.pixelStride)*\/\n- destinationBytesPerRow:width*4\n+ destinationOffset:0 \/*offset already taken in: pDst = PtrPixelsRow(pDst, dstx, dstInfo.pixelStride)*\/\n+ destinationBytesPerRow:w*4\n@@ -740,1 +744,1 @@\n- if ((dstInfo.scanStride == width * dstInfo.pixelStride) &&\n+ if ((dstInfo.scanStride == w * dstInfo.pixelStride) &&\n@@ -749,1 +753,1 @@\n- int rowSize = width * dstInfo.pixelStride;\n+ NSUInteger rowSize = w * dstInfo.pixelStride;\n","filename":"src\/java.desktop\/macosx\/native\/libawt_lwawt\/java2d\/metal\/MTLBlitLoops.m","additions":15,"deletions":11,"binary":false,"changes":26,"status":"modified"},{"patch":"@@ -178,1 +178,1 @@\n- bands[i] = PtrAddBytes(tableValues, i*bandLength*bytesPerElem);\n+ bands[i] = PtrPixelsBand(tableValues, i, bandLength, bytesPerElem);\n@@ -184,1 +184,1 @@\n- bands[i] = PtrAddBytes(tableValues, i*bandLength*bytesPerElem);\n+ bands[i] = PtrPixelsBand(tableValues, i, bandLength, bytesPerElem);\n","filename":"src\/java.desktop\/macosx\/native\/libawt_lwawt\/java2d\/metal\/MTLBufImgOps.m","additions":2,"deletions":2,"binary":false,"changes":4,"status":"modified"},{"patch":"@@ -488,0 +488,3 @@\n+#define PtrPixelsBand(p, y, length, elemSize) PtrAddBytes(p, \\\n+ ((intptr_t) (y)) * (length) * (elemSize))\n+\n","filename":"src\/java.desktop\/share\/native\/libawt\/java2d\/loops\/GraphicsPrimitiveMgr.h","additions":3,"deletions":0,"binary":false,"changes":3,"status":"modified"}]}

lanai/214/00/metadata.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"head":{"repo":{"full_name":"avu\/lanai","html_url":"https:\/\/github.com\/avu\/lanai"},"sha":"8420687d94febd6c22b82b322070aea042254dbb"},"created_at":"2021-03-10T20:25:31.263307Z","base":{"repo":{"full_name":"openjdk\/lanai","html_url":"https:\/\/git.openjdk.java.net\/lanai"},"sha":"4639971dedc458206abb1633eb54c371ad16300b"}}

0 commit comments

Comments
 (0)