diff options
author | Alexey Ushakov <Alexey.Ushakov@jetbrains.com> | 2018-03-20 15:18:04 +0300 |
---|---|---|
committer | Alexey Ushakov <Alexey.Ushakov@jetbrains.com> | 2018-03-20 16:20:43 +0300 |
commit | a1c340989fb4eb837f94c5963e3f005edd530941 (patch) | |
tree | b6af7d15f48091db067948a21ed6d63c13295d8b | |
parent | e03e6ad98876fb727970a92c57260b44529c5b71 (diff) | |
download | jdk8u_jdk-a1c340989fb4eb837f94c5963e3f005edd530941.tar.gz |
JRE-690 Recent bundled JDK VCS Log UI slowdownsjb8u152-b1194.5
Replaced OLG blit sync with threshold by the sync without threshold
(cherry picked from commit 45cbdc7)
4 files changed, 17 insertions, 10 deletions
diff --git a/src/share/classes/sun/java2d/opengl/OGLBlitLoops.java b/src/share/classes/sun/java2d/opengl/OGLBlitLoops.java index 5605dc0fee..7a273f9c74 100644 --- a/src/share/classes/sun/java2d/opengl/OGLBlitLoops.java +++ b/src/share/classes/sun/java2d/opengl/OGLBlitLoops.java @@ -293,7 +293,7 @@ final class OGLBlitLoops { // always flush immediately, since we (currently) have no means // of tracking changes to the system memory surface - rq.flushNow(); + rq.flushNow(RenderQueue.QueueSyncType.SYNC_NOW); } finally { rq.unlock(); } @@ -370,7 +370,7 @@ final class OGLBlitLoops { // we only have to flush immediately when copying from a // (non-texture) surface to the screen; otherwise Swing apps // might appear unresponsive until the auto-flush completes - rq.flushNow(); + rq.flushNow(RenderQueue.QueueSyncType.SYNC_NOW); } } finally { rq.unlock(); @@ -611,7 +611,7 @@ final class OGLSurfaceToSwBlit extends Blit { buf.putLong(dst.getNativeOps()); // always flush immediately - rq.flushNow(); + rq.flushNow(RenderQueue.QueueSyncType.SYNC_NOW); } finally { rq.unlock(); } diff --git a/src/share/classes/sun/java2d/opengl/OGLRenderQueue.java b/src/share/classes/sun/java2d/opengl/OGLRenderQueue.java index 9287e10cb0..9a672f7c65 100644 --- a/src/share/classes/sun/java2d/opengl/OGLRenderQueue.java +++ b/src/share/classes/sun/java2d/opengl/OGLRenderQueue.java @@ -119,7 +119,7 @@ public class OGLRenderQueue extends RenderQueue { } @Override - public void flushNow(boolean sync) { + public void flushNow(QueueSyncType sync) { // assert lock.isHeldByCurrentThread(); try { flusher.flushNow(sync); @@ -169,13 +169,16 @@ public class OGLRenderQueue extends RenderQueue { } public synchronized void flushNow() { - flushNow(true); + flushNow(QueueSyncType.SYNC); } - public synchronized void flushNow(boolean sync) { + public synchronized void flushNow(QueueSyncType sync) { // wake up the flusher needsFlush = true; - if (!sync) return; + switch (sync) { + case NO_SYNC: return; + case SYNC_NOW: notify(); + } // wait for flush to complete while (needsFlush) { diff --git a/src/share/classes/sun/java2d/pipe/RenderQueue.java b/src/share/classes/sun/java2d/pipe/RenderQueue.java index f9b955a794..d93ffd4eba 100644 --- a/src/share/classes/sun/java2d/pipe/RenderQueue.java +++ b/src/share/classes/sun/java2d/pipe/RenderQueue.java @@ -71,6 +71,10 @@ import sun.awt.SunToolkit; */ public abstract class RenderQueue { + public enum QueueSyncType { + NO_SYNC, SYNC, SYNC_NOW + } + /** The size of the underlying buffer, in bytes. */ private static final int BUFFER_SIZE = 6400000; @@ -202,7 +206,7 @@ public abstract class RenderQueue { * queue lock must be acquired before calling this method. */ public void flushNow() { - flushNow(true); + flushNow(QueueSyncType.SYNC); } /** @@ -211,7 +215,7 @@ public abstract class RenderQueue { * queue lock must be acquired before calling this method. * @param sync true, process the operations immediately */ - public abstract void flushNow(boolean sync); + public abstract void flushNow(QueueSyncType sync); /** diff --git a/src/windows/classes/sun/java2d/d3d/D3DRenderQueue.java b/src/windows/classes/sun/java2d/d3d/D3DRenderQueue.java index 46c6002d5a..8b740429d8 100644 --- a/src/windows/classes/sun/java2d/d3d/D3DRenderQueue.java +++ b/src/windows/classes/sun/java2d/d3d/D3DRenderQueue.java @@ -132,7 +132,7 @@ public class D3DRenderQueue extends RenderQueue { } } - public void flushNow(boolean sync) { + public void flushNow(QueueSyncType sync) { // assert lock.isHeldByCurrentThread(); flushBuffer(null); } |