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

Commit 336712fb authored by Koushik K. Dutta's avatar Koushik K. Dutta
Browse files

Revert part of previous commit which adds a call to create 2^N dimension...

Revert part of previous commit which adds a call to create 2^N dimension textures. This is now all done automatically to any call into nAllocationCreateFromBitmap if BOARD_GL_TEXT_POW2_DIMENSION_REQUIRED is defined by the BoardConfig.mk.
parent 79f4bd3d
Loading
Loading
Loading
Loading
+1 −12
Original line number Original line Diff line number Diff line
@@ -268,7 +268,7 @@ public class Allocation extends BaseObj {
        return new Allocation(id, rs, null);
        return new Allocation(id, rs, null);
    }
    }


    static public Allocation createFromBitmapBoxed(RenderScript rs, Bitmap b, Element dstFmt, boolean genMips)
    static Allocation createFromBitmapBoxed(RenderScript rs, Bitmap b, Element dstFmt, boolean genMips)
        throws IllegalArgumentException {
        throws IllegalArgumentException {


        rs.validate();
        rs.validate();
@@ -279,17 +279,6 @@ public class Allocation extends BaseObj {
        return new Allocation(id, rs, null);
        return new Allocation(id, rs, null);
    }
    }


    static public Allocation createFromBitmapStretched(RenderScript rs, Bitmap b, Element dstFmt, boolean genMips)
        throws IllegalArgumentException {

        rs.validate();
        int id = rs.nAllocationCreateFromBitmapStretched(dstFmt.mID, genMips, b);
        if(id == 0) {
            throw new IllegalStateException("Load failed.");
        }
        return new Allocation(id, rs, null);
    }

    static public Allocation createFromBitmapResource(RenderScript rs, Resources res, int id, Element dstFmt, boolean genMips)
    static public Allocation createFromBitmapResource(RenderScript rs, Resources res, int id, Element dstFmt, boolean genMips)
        throws IllegalArgumentException {
        throws IllegalArgumentException {


+0 −1
Original line number Original line Diff line number Diff line
@@ -100,7 +100,6 @@ public class RenderScript {
    native int  nAllocationCreateTyped(int type);
    native int  nAllocationCreateTyped(int type);
    native int  nAllocationCreateFromBitmap(int dstFmt, boolean genMips, Bitmap bmp);
    native int  nAllocationCreateFromBitmap(int dstFmt, boolean genMips, Bitmap bmp);
    native int  nAllocationCreateFromBitmapBoxed(int dstFmt, boolean genMips, Bitmap bmp);
    native int  nAllocationCreateFromBitmapBoxed(int dstFmt, boolean genMips, Bitmap bmp);
    native int  nAllocationCreateFromBitmapStretched(int dstFmt, boolean genMips, Bitmap bmp);
    native int  nAllocationCreateFromAssetStream(int dstFmt, boolean genMips, int assetStream);
    native int  nAllocationCreateFromAssetStream(int dstFmt, boolean genMips, int assetStream);


    native void nAllocationUploadToTexture(int alloc, int baseMioLevel);
    native void nAllocationUploadToTexture(int alloc, int baseMioLevel);
+4 −0
Original line number Original line Diff line number Diff line
@@ -33,6 +33,10 @@ LOCAL_C_INCLUDES += \


LOCAL_CFLAGS +=
LOCAL_CFLAGS +=


ifdef BOARD_GL_TEX_POW2_DIMENSION_REQUIRED
    LOCAL_CFLAGS += -DBOARD_GL_TEX_POW2_DIMENSION_REQUIRED
endif

LOCAL_LDLIBS := -lpthread
LOCAL_LDLIBS := -lpthread
LOCAL_ADDITIONAL_DEPENDENCIES := $(addprefix $(rs_generated_include_dir)/,rsgApiFuncDecl.h)
LOCAL_ADDITIONAL_DEPENDENCIES := $(addprefix $(rs_generated_include_dir)/,rsgApiFuncDecl.h)
LOCAL_MODULE:= librs_jni
LOCAL_MODULE:= librs_jni
+4 −1
Original line number Original line Diff line number Diff line
@@ -1402,9 +1402,12 @@ static JNINativeMethod methods[] = {
{"nTypeSetupFields",               "(Landroid/renderscript/Type;[I[I[Ljava/lang/reflect/Field;)V", (void*)nTypeSetupFields },
{"nTypeSetupFields",               "(Landroid/renderscript/Type;[I[I[Ljava/lang/reflect/Field;)V", (void*)nTypeSetupFields },


{"nAllocationCreateTyped",         "(I)I",                                 (void*)nAllocationCreateTyped },
{"nAllocationCreateTyped",         "(I)I",                                 (void*)nAllocationCreateTyped },
#ifndef BOARD_GL_TEX_POW2_DIMENSION_REQUIRED
{"nAllocationCreateFromBitmap",    "(IZLandroid/graphics/Bitmap;)I",       (void*)nAllocationCreateFromBitmap },
{"nAllocationCreateFromBitmap",    "(IZLandroid/graphics/Bitmap;)I",       (void*)nAllocationCreateFromBitmap },
#else
{"nAllocationCreateFromBitmap",    "(IZLandroid/graphics/Bitmap;)I",       (void*)nAllocationCreateFromBitmapStretched },
#endif
{"nAllocationCreateFromBitmapBoxed","(IZLandroid/graphics/Bitmap;)I",      (void*)nAllocationCreateFromBitmapBoxed },
{"nAllocationCreateFromBitmapBoxed","(IZLandroid/graphics/Bitmap;)I",      (void*)nAllocationCreateFromBitmapBoxed },
{"nAllocationCreateFromBitmapStretched","(IZLandroid/graphics/Bitmap;)I",      (void*)nAllocationCreateFromBitmapStretched },
{"nAllocationCreateFromAssetStream","(IZI)I",                              (void*)nAllocationCreateFromAssetStream },
{"nAllocationCreateFromAssetStream","(IZI)I",                              (void*)nAllocationCreateFromAssetStream },
{"nAllocationUploadToTexture",     "(II)V",                                (void*)nAllocationUploadToTexture },
{"nAllocationUploadToTexture",     "(II)V",                                (void*)nAllocationUploadToTexture },
{"nAllocationUploadToBufferObject","(I)V",                                 (void*)nAllocationUploadToBufferObject },
{"nAllocationUploadToBufferObject","(I)V",                                 (void*)nAllocationUploadToBufferObject },