Revision: 4961
          http://tigervnc.svn.sourceforge.net/tigervnc/?rev=4961&view=rev
Author:   bphinz
Date:     2012-08-26 18:22:24 +0000 (Sun, 26 Aug 2012)
Log Message:
-----------
Remove the AWTPixelBuffer class.  After switching to using rasters in 
BIPixelBuffer, we can no longer find a case in which AWTPixelBuffer performs 
faster.

Modified Paths:
--------------
    trunk/java/com/tigervnc/vncviewer/DesktopWindow.java

Removed Paths:
-------------
    trunk/java/com/tigervnc/vncviewer/AWTPixelBuffer.java

Deleted: trunk/java/com/tigervnc/vncviewer/AWTPixelBuffer.java
===================================================================
--- trunk/java/com/tigervnc/vncviewer/AWTPixelBuffer.java       2012-08-26 
18:20:15 UTC (rev 4960)
+++ trunk/java/com/tigervnc/vncviewer/AWTPixelBuffer.java       2012-08-26 
18:22:24 UTC (rev 4961)
@@ -1,102 +0,0 @@
-/* Copyright (C) 2012 Brian P. Hinz
- * 
- * This is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * 
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this software; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
- * USA.
- */
-
-package com.tigervnc.vncviewer;
-
-import java.awt.*;
-import java.awt.image.*;
-
-import com.tigervnc.rfb.*;
-import com.tigervnc.rfb.Exception;
-
-public class AWTPixelBuffer extends PlatformPixelBuffer
-{
-  public AWTPixelBuffer(int w, int h, CConn cc_, DesktopWindow desktop_) {
-    super(w, h, cc_, desktop_);
-  }
-
-  public void setPF(PixelFormat pf) {
-    super.setPF(pf);
-    if (source != null)
-      source.newPixels(data, cm, 0, width_);
-  }
-
-  public void updateColourMap() {
-    cm = new IndexColorModel(8, nColours, reds, greens, blues);
-    if (source != null)
-      source.newPixels(data, cm, 0, width_);
-  }
-  
-  // resize() resizes the image, preserving the image data where possible.
-  public void resize(int w, int h) {
-    if (w == width() && h == height()) return;
-
-    int rowsToCopy = h < height() ? h : height();
-    int copyWidth = w < width() ? w : width();
-    int[] oldData = data;
-
-    width_ = w;
-    height_ = h;
-
-    data = new int[width() * height()];
-    for (int i = 0; i < rowsToCopy; i++)
-      System.arraycopy(oldData, copyWidth * i, 
-                       data, width_ * i, copyWidth);
-
-    source = new MemoryImageSource(w, h, cm, data, 0, w);
-    source.setAnimated(true);
-    source.setFullBufferUpdates(false);
-    image = desktop.createImage(source);
-    source.newPixels(data, cm, 0, width_);
-  }
-
-  public void fillRect(int x, int y, int w, int h, int pix) {
-    super.fillRect(x, y, w, h, pix);
-    source.newPixels(x, y, w, h, true);
-  }
-
-  public void imageRect(int x, int y, int w, int h, Object pix) {
-    if (pix instanceof Image) {
-      PixelGrabber pg = 
-        new PixelGrabber((Image)pix, 0, 0, w, h, data, (width_ * y) + x, 
width_);
-      try {
-        pg.grabPixels(0);
-      } catch (InterruptedException e) {
-        vlog.error("Tight Decoding: Wrong JPEG data recieved");
-      }
-    } else {
-      for (int j = 0; j < h; j++)
-        System.arraycopy(pix, (w*j), data, width_ * (y + j) + x, w);
-    }
-    source.newPixels(x, y, w, h, true);
-  }
-
-  public void copyRect(int x, int y, int w, int h, int srcX, int srcY) {
-    super.copyRect(x, y, w, h, srcX, srcY);
-    source.newPixels(x, y, w, h, true);
-  }
-
-  public Image getImage() {
-    return (Image)image;
-  }
-
-  Image image;
-  MemoryImageSource source;
-
-  static LogWriter vlog = new LogWriter("AWTPixelBuffer");
-}

Modified: trunk/java/com/tigervnc/vncviewer/DesktopWindow.java
===================================================================
--- trunk/java/com/tigervnc/vncviewer/DesktopWindow.java        2012-08-26 
18:20:15 UTC (rev 4960)
+++ trunk/java/com/tigervnc/vncviewer/DesktopWindow.java        2012-08-26 
18:22:24 UTC (rev 4961)
@@ -66,11 +66,10 @@
     if (bufCaps.isPageFlipping() || bufCaps.isMultiBufferAvailable() ||
         imgCaps.isAccelerated()) {
       vlog.debug("GraphicsDevice supports HW acceleration.");
-      im = new BIPixelBuffer(width, height, cc, this);
     } else {
       vlog.debug("GraphicsDevice does not support HW acceleration.");
-      im = new AWTPixelBuffer(width, height, cc, this);
     }
+    im = new BIPixelBuffer(width, height, cc, this);
 
     cursor = new Cursor();
     cursorBacking = new ManagedPixelBuffer();

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Tigervnc-commits mailing list
Tigervnc-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tigervnc-commits

Reply via email to