summaryrefslogtreecommitdiffstats
path: root/java/com/tigervnc/vncviewer/Viewport.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/com/tigervnc/vncviewer/Viewport.java')
-rw-r--r--java/com/tigervnc/vncviewer/Viewport.java5
1 files changed, 2 insertions, 3 deletions
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);
}