Hi,
I'm running a native C++ application and trying to create a Surface,
using SurfaceComposerClient, in order to render to the screen (using
Skia graphics).
However, SurfaceComposerClient::createSurface() always returns NULL...
Is there anything you can spot that is wrong or something missing in
the below code snippet?
At some point I suspected that it has to do with the
ACCESS_SURFACE_FLINGER permission that is checked in frameworks/base/
libs/surfaceflinger/SurfaceFlinger.cpp. Do I need to give the new
process this permission, and how?
One more piece of information, that might be important - Looking at
the printed warnings, I see "W/Parcel ( 286): Attempt to read object
from Parcel 0xbeb7a910 at offset 0 that is not in the object list". Is
this relevant or gives any clue?
Thanks!
sp<SurfaceComposerClient> client = new SurfaceComposerClient();
DisplayInfo dispInfo;
client->getDisplayInfo(0,&dispInfo);
sp<Surface> surface1 = client->createSurface(getpid(),
0/*dpy*/,
dispInfo.w, dispInfo.h,
dispInfo.pixelFormatInfo.format,
0); //create a surface
//------ Here is where the problems start.... the surface is always
NULL ------
if(surface1 == NULL){
printf("surface1 == NULL\n"); //sadly, this is always printed...
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Android Discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---