1 #include <ui/DisplayInfo.h>
6 static const sp<ISurface>& getISurface(const sp<Surface>& s) {
7 return s->getISurface();
12 #define min(a,b) (a<b?a:b)
13 #define SURFACE_CREATE(client,surface_ctrl,android_surface, android_isurface, x, y, win_width, win_height) \
15 client = new SurfaceComposerClient(); \
16 android::DisplayInfo info; \
19 client->getDisplayInfo(android::DisplayID(0), &info); \
20 /*w = min(win_width, info.w);*/ \
21 /*h = min(win_height, info.h);*/ \
22 w = win_width, h = win_height; \
24 surface_ctrl = client->createSurface(getpid(), 0, w, h, PIXEL_FORMAT_RGB_565, ISurfaceComposer::ePushBuffers); \
25 android_surface = surface_ctrl->getSurface(); \
26 android_isurface = Test::getISurface(android_surface); \
28 client->openTransaction(); \
29 surface_ctrl->setPosition(x, y); \
30 client->closeTransaction(); \
32 client->openTransaction(); \
33 surface_ctrl->setSize(w, h); \
34 client->closeTransaction(); \
36 client->openTransaction(); \
37 surface_ctrl->setLayer(0x100000); \
38 client->closeTransaction(); \