diff options
Diffstat (limited to 'libs/rs/rsDevice.cpp')
-rw-r--r-- | libs/rs/rsDevice.cpp | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/libs/rs/rsDevice.cpp b/libs/rs/rsDevice.cpp index b670ad4..dd96445 100644 --- a/libs/rs/rsDevice.cpp +++ b/libs/rs/rsDevice.cpp @@ -15,29 +15,27 @@ */ #include "rsDevice.h" +#ifndef ANDROID_RS_BUILD_FOR_HOST #include "rsContext.h" +#else +#include "rsContextHostStub.h" +#endif using namespace android; using namespace android::renderscript; -Device::Device() -{ +Device::Device() { mForceSW = false; - } -Device::~Device() -{ - +Device::~Device() { } -void Device::addContext(Context *rsc) -{ - mContexts.add(rsc); +void Device::addContext(Context *rsc) { + mContexts.push(rsc); } -void Device::removeContext(Context *rsc) -{ +void Device::removeContext(Context *rsc) { for (size_t idx=0; idx < mContexts.size(); idx++) { if (mContexts[idx] == rsc) { mContexts.removeAt(idx); @@ -46,23 +44,17 @@ void Device::removeContext(Context *rsc) } } - - -RsDevice rsDeviceCreate() -{ +RsDevice rsDeviceCreate() { Device * d = new Device(); return d; } -void rsDeviceDestroy(RsDevice dev) -{ +void rsDeviceDestroy(RsDevice dev) { Device * d = static_cast<Device *>(dev); delete d; - } -void rsDeviceSetConfig(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; |