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

Commit f61f33dd authored by Alex Sakhartchouk's avatar Alex Sakhartchouk Committed by Android (Google) Code Review
Browse files

Merge "Added ability to set font color. Propagating the name of meshes and...

Merge "Added ability to set font color. Propagating the name of meshes and allocations from native a3d to java"
parents a8bd3a30 fb10c16a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ public class Allocation extends BaseObj {
    @Override
    void updateFromNative() {
        mRS.validate();
        mName = mRS.nGetName(mID);
        int typeID = mRS.nAllocationGetType(mID);
        if(typeID != 0) {
            mType = new Type(typeID, mRS);
+1 −0
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@ public class Mesh extends BaseObj {

    @Override
    void updateFromNative() {
        mName = mRS.nGetName(mID);
        int vtxCount = mRS.nMeshGetVertexBufferCount(mID);
        int idxCount = mRS.nMeshGetIndexCount(mID);

+1 −0
Original line number Diff line number Diff line
@@ -83,6 +83,7 @@ public class RenderScript {
    native void nContextDeinitToClient();

    native void nAssignName(int obj, byte[] name);
    native String nGetName(int obj);
    native void nObjDestroy(int id);
    native void nObjDestroyOOB(int id);
    native int  nFileOpen(byte[] name);
+12 −0
Original line number Diff line number Diff line
@@ -104,6 +104,17 @@ nAssignName(JNIEnv *_env, jobject _this, jint obj, jbyteArray str)
    _env->ReleasePrimitiveArrayCritical(str, cptr, JNI_ABORT);
}

static jstring
nGetName(JNIEnv *_env, jobject _this, jint obj)
{
    RsContext con = (RsContext)(_env->GetIntField(_this, gContextId));
    LOG_API("nGetName, con(%p), obj(%p)", con, (void *)obj);

    const char *name = NULL;
    rsGetName(con, (void *)obj, &name);
    return _env->NewStringUTF(name);
}

static void
nObjDestroy(JNIEnv *_env, jobject _this, jint obj)
{
@@ -1518,6 +1529,7 @@ static JNINativeMethod methods[] = {
{"nContextPause",                  "()V",                                  (void*)nContextPause },
{"nContextResume",                 "()V",                                  (void*)nContextResume },
{"nAssignName",                    "(I[B)V",                               (void*)nAssignName },
{"nGetName",                       "(I)Ljava/lang/String;",               (void*)nGetName },
{"nObjDestroy",                    "(I)V",                                 (void*)nObjDestroy },
{"nObjDestroyOOB",                 "(I)V",                                 (void*)nObjDestroyOOB },
{"nContextGetMessage",             "([IZ)I",                               (void*)nContextGetMessage },
+5 −0
Original line number Diff line number Diff line
@@ -58,6 +58,11 @@ AssignName {
	param size_t len
	}

GetName {
	param void *obj
	param const char **name
	}

ObjDestroy {
	param void *obj
	}
Loading