|
1 | 1 | /*
|
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. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
4 | 4 | *
|
5 | 5 | * This code is free software; you can redistribute it and/or modify it
|
|
34 | 34 | import java.awt.geom.*;
|
35 | 35 | import java.lang.ref.*;
|
36 | 36 |
|
37 |
| -public class XRPMBlitLoops { |
| 37 | +public final class XRPMBlitLoops { |
38 | 38 |
|
39 | 39 | static WeakReference<SunVolatileImage> argbTmpPM = new WeakReference<SunVolatileImage>(null);
|
40 | 40 | static WeakReference<SunVolatileImage> rgbTmpPM = new WeakReference<SunVolatileImage>(null);
|
41 | 41 |
|
42 |
| - public XRPMBlitLoops() { |
| 42 | + private XRPMBlitLoops() { |
43 | 43 | }
|
44 | 44 |
|
45 | 45 | public static void register() {
|
@@ -355,19 +355,13 @@ class XrSwToPMBlit extends Blit {
|
355 | 355 | }
|
356 | 356 |
|
357 | 357 | 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(); |
365 | 360 |
|
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(); |
371 | 365 | }
|
372 | 366 | }
|
373 | 367 | }
|
|
0 commit comments