Permalink
Browse files

ARGB_4444 is deprecated, so stop using it by default.

Games that still need to work on ancient devices can activate this themselves.
  • Loading branch information...
samskivert committed Sep 19, 2018
1 parent 68874ba commit d8e0dda22937c3a811ca2df2f3bc2f982c51132e
Showing with 3 additions and 16 deletions.
  1. +0 −1 android/src/playn/android/AndroidAssets.java
  2. +3 −15 android/src/playn/android/GameActivity.java
@@ -16,7 +16,6 @@
package playn.android;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
@@ -15,18 +15,13 @@
*/
package playn.android;
import java.io.File;
import android.app.Activity;
import android.app.ActivityManager;
import android.app.AlertDialog;
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.PixelFormat;
import android.os.Bundle;
import android.view.Gravity;
import android.view.KeyEvent;
@@ -168,18 +163,11 @@ protected String logIdent() {
/**
* Returns the configuration that will be used to decode bitmaps. The default implementation uses
* {@code ARGB_8888} unless the device memory class is 16MB or less or the device screen is
* itself {@code ARGB_4444}. NOTE: this is called once during platform initialization and the
* result is used for the lifetime of the game.
* {@code ARGB_8888}. NOTE: this is called once during platform initialization and the result is
* used for the lifetime of the game.
*/
protected Bitmap.Config preferredBitmapConfig() {
ActivityManager activityManager = (ActivityManager)
getApplication().getSystemService(Context.ACTIVITY_SERVICE);
int memoryClass = activityManager.getMemoryClass();
int format = getWindowManager().getDefaultDisplay().getPixelFormat();
// for low memory devices (like the HTC Magic), prefer 16-bit bitmaps
return (format == PixelFormat.RGBA_4444 || memoryClass <= 16) ?
Bitmap.Config.ARGB_4444 : Bitmap.Config.ARGB_8888;
return Bitmap.Config.ARGB_8888;
}
protected float scaleFactor() {

0 comments on commit d8e0dda

Please sign in to comment.