Revision: 2433
http://sourceforge.net/p/swingme/code/2433
Author: yuranet
Date: 2021-04-02 22:35:56 +0000 (Fri, 02 Apr 2021)
Log Message:
-----------
more density logging
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 2021-03-31 22:36:49 UTC (rev 2432)
+++ AndroidME/src_MIDP/javax/microedition/lcdui/Image.java 2021-04-02 22:35:56 UTC (rev 2433)
@@ -131,9 +131,20 @@
throw new IOException("BitmapFactory.decodeStream returned null " + stream + " available=" + available + " " + options.outMimeType + " " + options.outWidth + "x" + options.outHeight + " " + error);
}
+ int systemDensity = getTargetDensity();
+
+ if (systemDensity == Bitmap.DENSITY_NONE) {
+ // does this ever happen? should we return DisplayMetrics.DENSITY_DEFAULT?
+ System.err.println("startup density is zero");
+ }
+ if (systemDensity != AndroidMeApp.getContext().getResources().getDisplayMetrics().densityDpi) {
+ // on API-26 and API-30 on some Samsungs the current density does not seem to match bitmaps density
+ System.err.println("startup density does not match current density");
+ }
+
// some Samsungs will set density to a random number, so we fix it so it draws correctly
- if (bitmap.getDensity() != Bitmap.DENSITY_NONE && bitmap.getDensity() != getTargetDensity()) {
- int systemDensity = getTargetDensity();
+ if (bitmap.getDensity() != Bitmap.DENSITY_NONE && bitmap.getDensity() != systemDensity) {
+
int bitmapDensity = bitmap.getDensity();
int w = bitmap.getWidth();
int h = bitmap.getHeight();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|