Skip to content

Commit 89e5444

Browse files
committed
8254788: Dead code in the sun.java2d.xr.XRPMBlitLoops$XrSwToPMBlit
Reviewed-by: prr
1 parent 3267b09 commit 89e5444

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

src/java.desktop/unix/classes/sun/java2d/xr/XRPMBlitLoops.java

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2010, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -34,12 +34,12 @@
3434
import java.awt.geom.*;
3535
import java.lang.ref.*;
3636

37-
public class XRPMBlitLoops {
37+
public final class XRPMBlitLoops {
3838

3939
static WeakReference<SunVolatileImage> argbTmpPM = new WeakReference<SunVolatileImage>(null);
4040
static WeakReference<SunVolatileImage> rgbTmpPM = new WeakReference<SunVolatileImage>(null);
4141

42-
public XRPMBlitLoops() {
42+
private XRPMBlitLoops() {
4343
}
4444

4545
public static void register() {
@@ -355,19 +355,13 @@ class XrSwToPMBlit extends Blit {
355355
}
356356

357357
public void Blit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int sx, int sy, int dx, int dy, int w, int h) {
358-
// If the blit is write-only (putimge), no need for a temporary VI.
359-
if (CompositeType.SrcOverNoEa.equals(comp) && (src.getTransparency() == Transparency.OPAQUE)) {
360-
Blit opaqueSwToSurfaceBlit = Blit.getFromCache(src.getSurfaceType(), CompositeType.SrcNoEa, dst.getSurfaceType());
361-
opaqueSwToSurfaceBlit.Blit(src, dst, comp, clip, sx, sy, dx, dy, w, h);
362-
} else {
363-
try {
364-
SunToolkit.awtLock();
358+
try {
359+
SunToolkit.awtLock();
365360

366-
XRSurfaceData vImgSurface = XRPMBlitLoops.cacheToTmpSurface(src, (XRSurfaceData) dst, w, h, sx, sy);
367-
pmToSurfaceBlit.Blit(vImgSurface, dst, comp, clip, 0, 0, dx, dy, w, h);
368-
} finally {
369-
SunToolkit.awtUnlock();
370-
}
361+
XRSurfaceData vImgSurface = XRPMBlitLoops.cacheToTmpSurface(src, (XRSurfaceData) dst, w, h, sx, sy);
362+
pmToSurfaceBlit.Blit(vImgSurface, dst, comp, clip, 0, 0, dx, dy, w, h);
363+
} finally {
364+
SunToolkit.awtUnlock();
371365
}
372366
}
373367
}

0 commit comments

Comments
 (0)