Revision: 1476
          http://swingme.svn.sourceforge.net/swingme/?rev=1476&view=rev
Author:   yuranet
Date:     2011-02-07 11:00:30 +0000 (Mon, 07 Feb 2011)
Log Message:
-----------
optimization for images. lots of love. xoxo -yura
Modified Paths:
--------------
    AndroidME/src_MIDP/javax/microedition/lcdui/Image.java
Modified: AndroidME/src_MIDP/javax/microedition/lcdui/Image.java
===================================================================
--- AndroidME/src_MIDP/javax/microedition/lcdui/Image.java	2011-02-04 19:06:33 UTC (rev 1475)
+++ AndroidME/src_MIDP/javax/microedition/lcdui/Image.java	2011-02-07 11:00:30 UTC (rev 1476)
@@ -46,11 +46,11 @@
             case Sprite.TRANS_ROT270:
             case Sprite.TRANS_MIRROR_ROT90:
             case Sprite.TRANS_MIRROR_ROT270: {
-                res = Image.createTransparentImage(height, width);
+                res = Image.createImage(height, width, image.bitmap.getConfig());
                 break;
             }
             default: {
-                res = Image.createTransparentImage(width, height);
+                res = Image.createImage(width, height, image.bitmap.getConfig());
             }
         }
 
@@ -91,20 +91,20 @@
         return new Image(bitmap);
     }
 
-    private static Image createTransparentImage(int width, int height) {
+    private static Image createImage(int width, int height, Config config) {
         Bitmap bitmap;
         try {
-            bitmap = Bitmap.createBitmap(width, height, Config.ARGB_8888);
+            bitmap = Bitmap.createBitmap(width, height, config);
 
         } catch (OutOfMemoryError e) {
             cleanMem();
-            bitmap = Bitmap.createBitmap(width, height, Config.ARGB_8888);
+            bitmap = Bitmap.createBitmap(width, height, config);
         }
         return new Image(bitmap);
     }
 
     public static Image createImage(int width, int height) {
-        Image res = createTransparentImage(width, height);
+        Image res = createImage(width, height, Config.ARGB_8888);
 
         // MIDP: All pixels should be white
         Graphics g = res.getGraphics();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 |