{
LOG_API("nContextSetSurface, con(%p), width(%i), height(%i), surface(%p)", con, width, height, (Surface *)wnd);
- Surface * window = NULL;
+ ANativeWindow * window = NULL;
if (wnd == NULL) {
} else {
- window = (Surface*) android_Surface_getNativeWindow(_env, wnd).get();
+ window = android_Surface_getNativeWindow(_env, wnd).get();
}
- rsContextSetSurface(con, width, height, window, 1);
+ rsContextSetSurface(con, width, height, window);
}
static void
typedef void * RsProgramStore;
typedef void * RsProgramRaster;
+typedef void * RsNativeWindow;
+
typedef void (* RsBitmapCallback_t)(void *);
typedef struct {
}
-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;
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;
#define RSD_GL_H
#include <rs_hal.h>
+#include <EGL/egl.h>
class RsdShaderCache;
class RsdVertexArrayState;
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);
ContextSetSurface {
param uint32_t width
param uint32_t height
- param ANativeWindow *sur
+ param RsNativeWindow sur
}
ContextDump {
#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>
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) {
return false;
}
- mWndSurface = NULL;
+ mHasSurface = false;
timerInit();
timerSet(RS_TIMER_INTERNAL);
mIO.shutdown();
int status = pthread_join(mThreadId, &res);
-
if (mHal.funcs.shutdownDriver) {
mHal.funcs.shutdownDriver(this);
}
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;
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);
}
#endif // ANDROID_RS_SERIALIZE
-class ANativeWindow;
-
// ---------------------------------------------------------------------------
namespace android {
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();
static void * threadProc(void *);
static void * helperThreadProc(void *);
- ANativeWindow *mWndSurface;
+ bool mHasSurface;
Vector<ObjectBase *> mNames;
#include <time.h>
#include <cutils/atomic.h>
-#ifndef ANDROID_RS_SERIALIZE
-#include <EGL/egl.h>
-#endif
-
#include <math.h>
#include "RenderScript.h"
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 *);