Skip to content

Commit

Permalink
Merge master jdk8u422-b05 into openj9-staging
Browse files Browse the repository at this point in the history
Signed-off-by: J9 Build <j9build@ca.ibm.com>
  • Loading branch information
j9build committed Jul 17, 2024
2 parents 6bfd83e + bc1e0de commit 2673076
Show file tree
Hide file tree
Showing 11 changed files with 175 additions and 121 deletions.
42 changes: 24 additions & 18 deletions jdk/src/share/classes/sun/java2d/SunGraphics2D.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -2152,27 +2152,33 @@ private void doCopyArea(int x, int y, int w, int h, int dx, int dy) {
}

Blit ob = lastCAblit;
if (dy == 0 && dx > 0 && dx < w) {
while (w > 0) {
int partW = Math.min(w, dx);
w -= partW;
int sx = x + w;
ob.Blit(theData, theData, comp, clip,
sx, y, sx+dx, y+dy, partW, h);
try {
if (dy == 0 && dx > 0 && dx < w) {
while (w > 0) {
int partW = Math.min(w, dx);
w -= partW;
int sx = Math.addExact(x, w);
ob.Blit(theData, theData, comp, clip,
sx, y, sx+dx, y+dy, partW, h);
}
return;
}
return;
}
if (dy > 0 && dy < h && dx > -w && dx < w) {
while (h > 0) {
int partH = Math.min(h, dy);
h -= partH;
int sy = y + h;
ob.Blit(theData, theData, comp, clip,
x, sy, x+dx, sy+dy, w, partH);
if (dy > 0 && dy < h && dx > -w && dx < w) {
while (h > 0) {
int partH = Math.min(h, dy);
h -= partH;
int sy = Math.addExact(y, h);
ob.Blit(theData, theData, comp, clip,
x, sy, Math.addExact(x, dx), sy+dy, w, partH);
}
return;
}
ob.Blit(theData, theData, comp, clip, x, y,
Math.addExact(x, dx), Math.addExact(y, dy), w, h);
} catch (ArithmeticException ex) {
// We are hitting integer overflow in Math.addExact()
return;
}
ob.Blit(theData, theData, comp, clip, x, y, x+dx, y+dy, w, h);
}

/*
Expand Down
9 changes: 8 additions & 1 deletion jdk/src/share/classes/sun/java2d/pipe/DrawImage.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -367,6 +367,13 @@ protected void renderImageXform(SunGraphics2D sg, Image img,
final AffineTransform itx;
try {
itx = tx.createInverse();
double[] mat = new double[6];
itx.getMatrix(mat);
for (double d : mat) {
if (!Double.isFinite(d)) {
return;
}
}
} catch (final NoninvertibleTransformException ignored) {
// Non-invertible transform means no output
return;
Expand Down
6 changes: 3 additions & 3 deletions jdk/src/share/native/com/sun/java/util/jar/pack/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ extern int assert_failed(const char*);

#define lengthof(array) (sizeof(array)/sizeof(array[0]))

#define NEW(T, n) (T*) must_malloc((int)(scale_size(n, sizeof(T))))
#define U_NEW(T, n) (T*) u->alloc(scale_size(n, sizeof(T)))
#define T_NEW(T, n) (T*) u->temp_alloc(scale_size(n, sizeof(T)))
#define NEW(T, n) (T*) must_calloc(n, sizeof(T))
#define U_NEW(T, n) (T*) u->calloc(n, sizeof(T))
#define T_NEW(T, n) (T*) u->temp_calloc(n, sizeof(T))


// bytes and byte arrays
Expand Down
Loading

0 comments on commit 2673076

Please sign in to comment.