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

Commit 65bdaf1c authored by Jason Sams's avatar Jason Sams
Browse files

Cleanup rs.spec file and code generator.

Change-Id: I369e36b222ff962fc6835bc550435c2940e2b5fd
parent e7c4a756
Loading
Loading
Loading
Loading
+18 −5
Original line number Diff line number Diff line
@@ -237,7 +237,11 @@ nContextGetErrorMessage(JNIEnv *_env, jobject _this, RsContext con)

    size_t receiveLen;
    uint32_t subID;
    int id = rsContextGetMessage(con, buf, &receiveLen, &subID, sizeof(buf), true);
    int id = rsContextGetMessage(con,
                                 buf, sizeof(buf),
                                 &receiveLen, sizeof(receiveLen),
                                 &subID, sizeof(subID),
                                 true);
    if (!id && receiveLen) {
        LOGV("message receive buffer too small.  %i", receiveLen);
    }
@@ -252,7 +256,11 @@ nContextGetUserMessage(JNIEnv *_env, jobject _this, RsContext con, jintArray dat
    jint *ptr = _env->GetIntArrayElements(data, NULL);
    size_t receiveLen;
    uint32_t subID;
    int id = rsContextGetMessage(con, ptr, &receiveLen, &subID, len * 4, true);
    int id = rsContextGetMessage(con,
                                 ptr, len * 4,
                                 &receiveLen, sizeof(receiveLen),
                                 &subID, sizeof(subID),
                                 true);
    if (!id && receiveLen) {
        LOGV("message receive buffer too small.  %i", receiveLen);
    }
@@ -266,7 +274,8 @@ nContextPeekMessage(JNIEnv *_env, jobject _this, RsContext con, jintArray auxDat
    jint *auxDataPtr = _env->GetIntArrayElements(auxData, NULL);
    size_t receiveLen;
    uint32_t subID;
    int id = rsContextPeekMessage(con, &receiveLen, &subID, wait);
    int id = rsContextPeekMessage(con, &receiveLen, sizeof(receiveLen),
                                  &subID, sizeof(subID), wait);
    auxDataPtr[0] = (jint)subID;
    auxDataPtr[1] = (jint)receiveLen;
    _env->ReleaseIntArrayElements(auxData, auxDataPtr, 0);
@@ -426,7 +435,9 @@ nAllocationCreateFromBitmap(JNIEnv *_env, jobject _this, RsContext con, jint typ

    bitmap.lockPixels();
    const void* ptr = bitmap.getPixels();
    jint id = (jint)rsaAllocationCreateFromBitmap(con, (RsType)type, (RsAllocationMipmapControl)mip, ptr, usage);
    jint id = (jint)rsaAllocationCreateFromBitmap(con,
                                                  (RsType)type, (RsAllocationMipmapControl)mip,
                                                  ptr, bitmap.getSize(), usage);
    bitmap.unlockPixels();
    return id;
}
@@ -440,7 +451,9 @@ nAllocationCubeCreateFromBitmap(JNIEnv *_env, jobject _this, RsContext con, jint

    bitmap.lockPixels();
    const void* ptr = bitmap.getPixels();
    jint id = (jint)rsaAllocationCubeCreateFromBitmap(con, (RsType)type, (RsAllocationMipmapControl)mip, ptr, usage);
    jint id = (jint)rsaAllocationCubeCreateFromBitmap(con,
                                                      (RsType)type, (RsAllocationMipmapControl)mip,
                                                      ptr, bitmap.getSize(), usage);
    bitmap.unlockPixels();
    return id;
}
+2 −26
Original line number Diff line number Diff line
@@ -26,20 +26,6 @@ extern "C" {

#include "RenderScriptDefines.h"

RsDevice rsDeviceCreate();
void rsDeviceDestroy(RsDevice);
void rsDeviceSetConfig(RsDevice, RsDeviceParam, int32_t value);

RsContext rsContextCreate(RsDevice, uint32_t version);
RsContext rsContextCreateGL(RsDevice, uint32_t version,
                            RsSurfaceConfig sc, uint32_t dpi);
void rsContextDestroy(RsContext);

RsMessageToClientType rsContextGetMessage(RsContext vrsc, void *data, size_t *receiveLen, uint32_t *subID, size_t bufferLen, bool wait);
RsMessageToClientType rsContextPeekMessage(RsContext vrsc, size_t *receiveLen, uint32_t *subID, bool wait);
void rsContextInitToClient(RsContext);
void rsContextDeinitToClient(RsContext);

//
// A3D loading and object update code.
// Should only be called at object creation, not thread safe
@@ -63,18 +49,8 @@ void rsaTypeGetNativeData(RsContext, RsType, uint32_t *typeData, uint32_t typeDa
void rsaElementGetNativeData(RsContext, RsElement, uint32_t *elemData, uint32_t elemDataSize);
void rsaElementGetSubElements(RsContext, RsElement, uint32_t *ids, const char **names, uint32_t dataSize);

// Async commands for returning new IDS
RsType rsaTypeCreate(RsContext, RsElement, uint32_t dimX, uint32_t dimY,
                     uint32_t dimZ, bool mips, bool faces);
RsAllocation rsaAllocationCreateTyped(RsContext rsc, RsType vtype,
                                      RsAllocationMipmapControl mips,
                                      uint32_t usages);
RsAllocation rsaAllocationCreateFromBitmap(RsContext con, RsType vtype,
                                           RsAllocationMipmapControl mips,
                                           const void *data, uint32_t usages);
RsAllocation rsaAllocationCubeCreateFromBitmap(RsContext con, RsType vtype,
                                               RsAllocationMipmapControl mips,
                                               const void *data, uint32_t usages);


#ifdef ANDROID_RS_SERIALIZE
#define NO_RS_FUNCS
#endif
+111 −8
Original line number Diff line number Diff line

DeviceCreate {
    direct
    nocontext
    ret RsDevice
}

DeviceDestroy {
    direct
    nocontext
    param RsDevice dev
}

DeviceSetConfig {
    direct
    nocontext
    param RsDevice dev
    param RsDeviceParam p
    param int32_t value
}

ContextCreate {
    direct
    nocontext
    param RsDevice dev
    param uint32_t version
    ret RsContext
}

ContextCreateGL {
    direct
    nocontext
    param RsDevice dev
    param uint32_t version
    param RsSurfaceConfig sc
    param uint32_t dpi
    ret RsContext
}

ContextDestroy {
    direct
}

ContextGetMessage {
    direct
    param void *data
    param size_t *receiveLen
    param uint32_t *subID
    param bool wait
    ret RsMessageToClientType
}

ContextPeekMessage {
    direct
    param size_t *receiveLen
    param uint32_t *subID
    param bool wait
    ret RsMessageToClientType
}

ContextInitToClient {
    direct
}

ContextDeinitToClient {
    direct
}

aTypeCreate {
    direct
    param RsElement e
    param uint32_t dimX
    param uint32_t dimY
    param uint32_t dimZ
    param bool mips
    param bool faces
    ret RsType
}

aAllocationCreateTyped {
    direct
    param RsType vtype
    param RsAllocationMipmapControl mips
    param uint32_t usages
    ret RsAllocation
}

aAllocationCreateFromBitmap {
    direct
    param RsType vtype
    param RsAllocationMipmapControl mips
    param const void *data
    param uint32_t usages
    ret RsAllocation
}

aAllocationCubeCreateFromBitmap {
    direct
    param RsType vtype
    param RsAllocationMipmapControl mips
    param const void *data
    param uint32_t usages
    ret RsAllocation
}



ContextFinish {
	handcodeApi
	}
@@ -82,23 +188,21 @@ AllocationCopyToBitmap {


Allocation1DData {
	handcodeApi
	param RsAllocation va
	param uint32_t xoff
	param uint32_t lod
	param uint32_t count
	param const void *data
	handcodeApi
	togglePlay
	}

Allocation1DElementData {
	handcodeApi
	param RsAllocation va
	param uint32_t x
	param uint32_t lod
	param const void *data
	param uint32_t comp_offset
	handcodeApi
	togglePlay
	}

Allocation2DData {
@@ -186,11 +290,10 @@ ScriptInvoke {
	}

ScriptInvokeV {
	handcodeApi
	param RsScript s
	param uint32_t slot
	param const void * data
	handcodeApi
	togglePlay
	}

ScriptSetVarI {
@@ -224,11 +327,10 @@ ScriptSetVarD {
	}

ScriptSetVarV {
	handcodeApi
	param RsScript s
	param uint32_t slot
	param const void * data
	handcodeApi
	togglePlay
	}


@@ -330,3 +432,4 @@ MeshBindVertex {
MeshInitVertexAttribs {
	param RsMesh mesh
	}
+2 −2
Original line number Diff line number Diff line
@@ -833,7 +833,7 @@ RsAllocation rsaAllocationCreateTyped(RsContext con, RsType vtype,

RsAllocation rsaAllocationCreateFromBitmap(RsContext con, RsType vtype,
                                           RsAllocationMipmapControl mips,
                                           const void *data, uint32_t usages) {
                                           const void *data, size_t data_length, uint32_t usages) {
    Context *rsc = static_cast<Context *>(con);
    Type *t = static_cast<Type *>(vtype);

@@ -855,7 +855,7 @@ RsAllocation rsaAllocationCreateFromBitmap(RsContext con, RsType vtype,

RsAllocation rsaAllocationCubeCreateFromBitmap(RsContext con, RsType vtype,
                                               RsAllocationMipmapControl mips,
                                               const void *data, uint32_t usages) {
                                               const void *data, size_t data_length, uint32_t usages) {
    Context *rsc = static_cast<Context *>(con);
    Type *t = static_cast<Type *>(vtype);

+9 −3
Original line number Diff line number Diff line
@@ -768,14 +768,20 @@ RsContext rsContextCreateGL(RsDevice vdev, uint32_t version,
    return rsc;
}

RsMessageToClientType rsContextPeekMessage(RsContext vrsc, size_t *receiveLen, uint32_t *subID, bool wait) {
RsMessageToClientType rsContextPeekMessage(RsContext vrsc,
                                           size_t * receiveLen, size_t receiveLen_length,
                                           uint32_t * subID, size_t subID_length, bool wait) {
    Context * rsc = static_cast<Context *>(vrsc);
    return rsc->peekMessageToClient(receiveLen, subID, wait);
}

RsMessageToClientType rsContextGetMessage(RsContext vrsc, void *data, size_t *receiveLen, uint32_t *subID, size_t bufferLen, bool wait) {
RsMessageToClientType rsContextGetMessage(RsContext vrsc, void * data, size_t data_length,
                                          size_t * receiveLen, size_t receiveLen_length,
                                          uint32_t * subID, size_t subID_length, bool wait) {
    Context * rsc = static_cast<Context *>(vrsc);
    return rsc->getMessageToClient(data, receiveLen, subID, bufferLen, wait);
    rsAssert(subID_length == sizeof(uint32_t));
    rsAssert(receiveLen_length == sizeof(size_t));
    return rsc->getMessageToClient(data, receiveLen, subID, data_length, wait);
}

void rsContextInitToClient(RsContext vrsc) {
Loading