Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6deb7d47 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 7633

* changes:
  Fix conflict with automatic DPI support on high density devices by forcing bitmap loading to not be scaled.
parents 3a3ba057 764205c1
Loading
Loading
Loading
Loading
+12 −10
Original line number Original line Diff line number Diff line
@@ -24,6 +24,7 @@ import android.renderscript.ProgramVertexAlloc;
import android.content.Context;
import android.content.Context;
import android.content.res.Resources;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.os.Handler;
@@ -188,20 +189,21 @@ public class RolloRS {
                RenderScript.ElementPredefined.USER_I32, mAllocIconIDBuf.length);
                RenderScript.ElementPredefined.USER_I32, mAllocIconIDBuf.length);


            
            
            BitmapDrawable bd;
            Bitmap b;
            Bitmap b;
            BitmapFactory.Options opts = new BitmapFactory.Options();
            opts.inScaled = false;


            bd = (BitmapDrawable)mRes.getDrawable(R.drawable.browser);
            b = BitmapFactory.decodeResource(mRes, R.raw.browser, opts);
            mIcons[0] = mRS.allocationCreateFromBitmap(bd.getBitmap(), RenderScript.ElementPredefined.RGB_565, true);
            mIcons[0] = mRS.allocationCreateFromBitmap(b, RenderScript.ElementPredefined.RGB_565, true);


            bd = (BitmapDrawable)mRes.getDrawable(R.drawable.market);
            b = BitmapFactory.decodeResource(mRes, R.raw.market, opts);
            mIcons[1] = mRS.allocationCreateFromBitmap(bd.getBitmap(), RenderScript.ElementPredefined.RGB_565, true);
            mIcons[1] = mRS.allocationCreateFromBitmap(b, RenderScript.ElementPredefined.RGB_565, true);


            bd = (BitmapDrawable)mRes.getDrawable(R.drawable.photos);
            b = BitmapFactory.decodeResource(mRes, R.raw.photos, opts);
            mIcons[2] = mRS.allocationCreateFromBitmap(bd.getBitmap(), RenderScript.ElementPredefined.RGB_565, true);
            mIcons[2] = mRS.allocationCreateFromBitmap(b, RenderScript.ElementPredefined.RGB_565, true);


            bd = (BitmapDrawable)mRes.getDrawable(R.drawable.settings);
            b = BitmapFactory.decodeResource(mRes, R.raw.settings, opts);
            mIcons[3] = mRS.allocationCreateFromBitmap(bd.getBitmap(), RenderScript.ElementPredefined.RGB_565, true);
            mIcons[3] = mRS.allocationCreateFromBitmap(b, RenderScript.ElementPredefined.RGB_565, true);


            for(int ct=0; ct < mIcons.length; ct++) {
            for(int ct=0; ct < mIcons.length; ct++) {
                mIcons[ct].uploadToTexture(0);
                mIcons[ct].uploadToTexture(0);
Loading