From 606ca31f38df72908a10d35b1fe4412e6e4851a7 Mon Sep 17 00:00:00 2001 From: "Brian P. Hinz" Date: Mon, 17 Apr 2017 06:46:59 -0400 Subject: More fixes for java viewer performance regression --- java/com/tigervnc/vncviewer/Viewport.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'java/com/tigervnc/vncviewer/Viewport.java') diff --git a/java/com/tigervnc/vncviewer/Viewport.java b/java/com/tigervnc/vncviewer/Viewport.java index f7448bc8..fd1e6cff 100644 --- a/java/com/tigervnc/vncviewer/Viewport.java +++ b/java/com/tigervnc/vncviewer/Viewport.java @@ -101,8 +101,7 @@ class Viewport extends JPanel implements MouseListener, Rect r = frameBuffer.getDamage(); if (!r.is_empty()) { if (image == null) - image = (BufferedImage)createImage(frameBuffer.width(), frameBuffer.height()); - image.getRaster().setDataElements(r.tl.x, r.tl.y, frameBuffer.getBuffer(r)); + image = (BufferedImage)frameBuffer.getImage(); if (cc.cp.width != scaledWidth || cc.cp.height != scaledHeight) { AffineTransform t = new AffineTransform(); @@ -198,7 +197,7 @@ class Viewport extends JPanel implements MouseListener, frameBuffer = createFramebuffer(frameBuffer.getPF(), w, h); assert(frameBuffer != null); cc.setFramebuffer(frameBuffer); - image = null; + image = (BufferedImage)frameBuffer.getImage(); } setScaledSize(w, h); } -- cgit v1.2.3