diff options
author | Alex Sakhartchouk <alexst@google.com> | 2011-05-18 16:39:05 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-05-18 16:39:05 -0700 |
commit | 60108e629c4c7e97e62b071a70cc1a34f3b7c44d (patch) | |
tree | 5153d75f1d2bd99de76931bba8660da8cda77254 /libs | |
parent | cb3cf992aee3a6db122379aa940fd38ffab77249 (diff) | |
parent | 6c72eec06e69559b4d990777c7b280aa81586797 (diff) | |
download | frameworks_base-60108e629c4c7e97e62b071a70cc1a34f3b7c44d.zip frameworks_base-60108e629c4c7e97e62b071a70cc1a34f3b7c44d.tar.gz frameworks_base-60108e629c4c7e97e62b071a70cc1a34f3b7c44d.tar.bz2 |
Merge "Preparing libRS for for compilation on host."
Diffstat (limited to 'libs')
-rw-r--r-- | libs/rs/RenderScriptDefines.h | 2 | ||||
-rw-r--r-- | libs/rs/driver/rsdGL.cpp | 4 | ||||
-rw-r--r-- | libs/rs/driver/rsdGL.h | 3 | ||||
-rw-r--r-- | libs/rs/rs.spec | 2 | ||||
-rw-r--r-- | libs/rs/rsContext.cpp | 13 | ||||
-rw-r--r-- | libs/rs/rsContext.h | 6 | ||||
-rw-r--r-- | libs/rs/rsUtils.h | 4 | ||||
-rw-r--r-- | libs/rs/rs_hal.h | 2 |
8 files changed, 15 insertions, 21 deletions
diff --git a/libs/rs/RenderScriptDefines.h b/libs/rs/RenderScriptDefines.h index 308437d..ee9645c 100644 --- a/libs/rs/RenderScriptDefines.h +++ b/libs/rs/RenderScriptDefines.h @@ -50,6 +50,8 @@ typedef void * RsProgramFragment; typedef void * RsProgramStore; typedef void * RsProgramRaster; +typedef void * RsNativeWindow; + typedef void (* RsBitmapCallback_t)(void *); typedef struct { diff --git a/libs/rs/driver/rsdGL.cpp b/libs/rs/driver/rsdGL.cpp index de9fb51..a70589b 100644 --- a/libs/rs/driver/rsdGL.cpp +++ b/libs/rs/driver/rsdGL.cpp @@ -300,7 +300,7 @@ bool rsdGLInit(const Context *rsc) { } -bool rsdGLSetSurface(const Context *rsc, uint32_t w, uint32_t h, ANativeWindow *sur) { +bool rsdGLSetSurface(const Context *rsc, uint32_t w, uint32_t h, RsNativeWindow sur) { RsdHal *dc = (RsdHal *)rsc->mHal.drv; EGLBoolean ret; @@ -319,7 +319,7 @@ bool rsdGLSetSurface(const Context *rsc, uint32_t w, uint32_t h, ANativeWindow * dc->gl.height = 1; } - dc->gl.wndSurface = sur; + dc->gl.wndSurface = (ANativeWindow *)sur; if (dc->gl.wndSurface != NULL) { dc->gl.width = w; dc->gl.height = h; diff --git a/libs/rs/driver/rsdGL.h b/libs/rs/driver/rsdGL.h index 90cbe04..01c8438 100644 --- a/libs/rs/driver/rsdGL.h +++ b/libs/rs/driver/rsdGL.h @@ -18,6 +18,7 @@ #define RSD_GL_H #include <rs_hal.h> +#include <EGL/egl.h> class RsdShaderCache; class RsdVertexArrayState; @@ -74,7 +75,7 @@ typedef struct RsdGLRec { bool rsdGLInit(const android::renderscript::Context *rsc); void rsdGLShutdown(const android::renderscript::Context *rsc); bool rsdGLSetSurface(const android::renderscript::Context *rsc, - uint32_t w, uint32_t h, ANativeWindow *sur); + uint32_t w, uint32_t h, RsNativeWindow sur); void rsdGLSwap(const android::renderscript::Context *rsc); void rsdGLCheckError(const android::renderscript::Context *rsc, const char *msg, bool isFatal = false); diff --git a/libs/rs/rs.spec b/libs/rs/rs.spec index 29de5f0..4c8b5db 100644 --- a/libs/rs/rs.spec +++ b/libs/rs/rs.spec @@ -140,7 +140,7 @@ ContextResume { ContextSetSurface { param uint32_t width param uint32_t height - param ANativeWindow *sur + param RsNativeWindow sur } ContextDump { diff --git a/libs/rs/rsContext.cpp b/libs/rs/rsContext.cpp index a4e1b72..d3bd0d9 100644 --- a/libs/rs/rsContext.cpp +++ b/libs/rs/rsContext.cpp @@ -18,8 +18,6 @@ #include "rsContext.h" #include "rsThreadIO.h" #include <ui/FramebufferNativeWindow.h> -#include <ui/PixelFormat.h> -#include <ui/egl/android_natives.h> #include <sys/types.h> #include <sys/resource.h> @@ -246,7 +244,7 @@ void * Context::threadProc(void *vrsc) { while (!rsc->mExit) { mDraw |= rsc->mIO.playCoreCommands(rsc, !mDraw); mDraw &= (rsc->mRootScript.get() != NULL); - mDraw &= (rsc->mWndSurface != NULL); + mDraw &= rsc->mHasSurface; uint32_t targetTime = 0; if (mDraw && rsc->mIsGraphicsContext) { @@ -371,7 +369,7 @@ bool Context::initContext(Device *dev, const RsSurfaceConfig *sc) { return false; } - mWndSurface = NULL; + mHasSurface = false; timerInit(); timerSet(RS_TIMER_INTERNAL); @@ -406,7 +404,6 @@ Context::~Context() { mIO.shutdown(); int status = pthread_join(mThreadId, &res); - if (mHal.funcs.shutdownDriver) { mHal.funcs.shutdownDriver(this); } @@ -421,11 +418,11 @@ Context::~Context() { LOGV("Context::~Context done"); } -void Context::setSurface(uint32_t w, uint32_t h, ANativeWindow *sur) { +void Context::setSurface(uint32_t w, uint32_t h, RsNativeWindow sur) { rsAssert(mIsGraphicsContext); mHal.funcs.setSurface(this, w, h, sur); - mWndSurface = sur; + mHasSurface = sur != NULL; mWidth = w; mHeight = h; @@ -617,7 +614,7 @@ void rsi_ContextResume(Context *rsc) { rsc->resume(); } -void rsi_ContextSetSurface(Context *rsc, uint32_t w, uint32_t h, ANativeWindow *sur, size_t sur_length) { +void rsi_ContextSetSurface(Context *rsc, uint32_t w, uint32_t h, RsNativeWindow sur) { rsc->setSurface(w, h, sur); } diff --git a/libs/rs/rsContext.h b/libs/rs/rsContext.h index 6336210..be615a3 100644 --- a/libs/rs/rsContext.h +++ b/libs/rs/rsContext.h @@ -44,8 +44,6 @@ #endif // ANDROID_RS_SERIALIZE -class ANativeWindow; - // --------------------------------------------------------------------------- namespace android { @@ -136,7 +134,7 @@ public: void pause(); void resume(); - void setSurface(uint32_t w, uint32_t h, ANativeWindow *sur); + void setSurface(uint32_t w, uint32_t h, RsNativeWindow sur); void setPriority(int32_t p); void destroyWorkerThreadResources(); @@ -244,7 +242,7 @@ private: static void * threadProc(void *); static void * helperThreadProc(void *); - ANativeWindow *mWndSurface; + bool mHasSurface; Vector<ObjectBase *> mNames; diff --git a/libs/rs/rsUtils.h b/libs/rs/rsUtils.h index 3b60af5..3a6c85a 100644 --- a/libs/rs/rsUtils.h +++ b/libs/rs/rsUtils.h @@ -32,10 +32,6 @@ #include <time.h> #include <cutils/atomic.h> -#ifndef ANDROID_RS_SERIALIZE -#include <EGL/egl.h> -#endif - #include <math.h> #include "RenderScript.h" diff --git a/libs/rs/rs_hal.h b/libs/rs/rs_hal.h index cfa4e74..9d8c906 100644 --- a/libs/rs/rs_hal.h +++ b/libs/rs/rs_hal.h @@ -47,7 +47,7 @@ typedef void *(*RsHalSymbolLookupFunc)(void *usrptr, char const *symbolName); typedef struct { bool (*initGraphics)(const Context *); void (*shutdownGraphics)(const Context *); - bool (*setSurface)(const Context *, uint32_t w, uint32_t h, ANativeWindow *); + bool (*setSurface)(const Context *, uint32_t w, uint32_t h, RsNativeWindow); void (*swap)(const Context *); void (*shutdownDriver)(Context *); |