Merge "Move context and device creation out of the spec file."
This commit is contained in:
@@ -49,6 +49,12 @@ 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);
|
||||
|
||||
RsDevice rsDeviceCreate();
|
||||
void rsDeviceDestroy(RsDevice dev);
|
||||
void rsDeviceSetConfig(RsDevice dev, RsDeviceParam p, int32_t value);
|
||||
RsContext rsContextCreate(RsDevice dev, uint32_t version);
|
||||
RsContext rsContextCreateGL(RsDevice dev, uint32_t version, RsSurfaceConfig sc, uint32_t dpi);
|
||||
|
||||
|
||||
|
||||
#ifdef ANDROID_RS_SERIALIZE
|
||||
|
||||
@@ -1,42 +1,4 @@
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
@@ -637,22 +637,6 @@ void rsi_ContextDestroy(Context *rsc) {
|
||||
LOGV("rsContextDestroy 2 %p", rsc);
|
||||
}
|
||||
|
||||
RsContext rsi_ContextCreate(RsDevice vdev, uint32_t version) {
|
||||
LOGV("rsContextCreate %p", vdev);
|
||||
Device * dev = static_cast<Device *>(vdev);
|
||||
Context *rsc = Context::createContext(dev, NULL);
|
||||
return rsc;
|
||||
}
|
||||
|
||||
RsContext rsi_ContextCreateGL(RsDevice vdev, uint32_t version,
|
||||
RsSurfaceConfig sc, uint32_t dpi) {
|
||||
LOGV("rsContextCreateGL %p", vdev);
|
||||
Device * dev = static_cast<Device *>(vdev);
|
||||
Context *rsc = Context::createContext(dev, &sc);
|
||||
rsc->setDPI(dpi);
|
||||
LOGV("rsContextCreateGL ret %p ", rsc);
|
||||
return rsc;
|
||||
}
|
||||
|
||||
RsMessageToClientType rsi_ContextPeekMessage(Context *rsc,
|
||||
size_t * receiveLen, size_t receiveLen_length,
|
||||
@@ -679,6 +663,23 @@ void rsi_ContextDeinitToClient(Context *rsc) {
|
||||
}
|
||||
}
|
||||
|
||||
RsContext rsContextCreate(RsDevice vdev, uint32_t version) {
|
||||
LOGV("rsContextCreate %p", vdev);
|
||||
Device * dev = static_cast<Device *>(vdev);
|
||||
Context *rsc = Context::createContext(dev, NULL);
|
||||
return rsc;
|
||||
}
|
||||
|
||||
RsContext rsContextCreateGL(RsDevice vdev, uint32_t version,
|
||||
RsSurfaceConfig sc, uint32_t dpi) {
|
||||
LOGV("rsContextCreateGL %p", vdev);
|
||||
Device * dev = static_cast<Device *>(vdev);
|
||||
Context *rsc = Context::createContext(dev, &sc);
|
||||
rsc->setDPI(dpi);
|
||||
LOGV("rsContextCreateGL ret %p ", rsc);
|
||||
return rsc;
|
||||
}
|
||||
|
||||
// Only to be called at a3d load time, before object is visible to user
|
||||
// not thread safe
|
||||
void rsaGetName(RsContext con, void * obj, const char **name) {
|
||||
|
||||
@@ -40,20 +40,17 @@ void Device::removeContext(Context *rsc) {
|
||||
}
|
||||
}
|
||||
|
||||
namespace android {
|
||||
namespace renderscript {
|
||||
|
||||
RsDevice rsi_DeviceCreate() {
|
||||
RsDevice rsDeviceCreate() {
|
||||
Device * d = new Device();
|
||||
return d;
|
||||
}
|
||||
|
||||
void rsi_DeviceDestroy(RsDevice dev) {
|
||||
void rsDeviceDestroy(RsDevice dev) {
|
||||
Device * d = static_cast<Device *>(dev);
|
||||
delete d;
|
||||
}
|
||||
|
||||
void rsi_DeviceSetConfig(RsDevice dev, RsDeviceParam p, int32_t value) {
|
||||
void rsDeviceSetConfig(RsDevice dev, RsDeviceParam p, int32_t value) {
|
||||
Device * d = static_cast<Device *>(dev);
|
||||
if (p == RS_DEVICE_PARAM_FORCE_SOFTWARE_GL) {
|
||||
d->mForceSW = value != 0;
|
||||
@@ -62,5 +59,3 @@ void rsi_DeviceSetConfig(RsDevice dev, RsDeviceParam p, int32_t value) {
|
||||
rsAssert(0);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user