1 #include "surfaceInterface.h"
3 #include <cutils/log.h>
4 #include <gui/Surface.h>
6 class SurfaceInterface : public android::ANativeObjectBase<
11 static SurfaceInterface* get();
12 void setAsyncMode(ANativeWindow* anw, bool async) {
13 ALOGD("SurfaceInterface::%s: set async mode %d", __func__, async);
15 android::Surface* s = android::Surface::getSelf(window);
16 s->setAsyncMode(async);
19 ANativeWindow* window;
22 static SurfaceInterface* sSurfaceInterface = NULL;
24 SurfaceInterface* SurfaceInterface::get() {
25 if (!sSurfaceInterface)
26 sSurfaceInterface = new SurfaceInterface;
27 return sSurfaceInterface;
30 extern "C" void surfaceInterface_init() {
31 SurfaceInterface::get();
34 extern "C" void surfaceInterface_setAsyncModeForWindow(void* window) {
35 SurfaceInterface::get()->setAsyncMode((ANativeWindow*)window, true);