Get rid of the "pid" parameter from createSurface

Change-Id: I28635e3f803e6abe965d79998e305f54a202465d
This commit is contained in:
Mathias Agopian 2011-04-20 14:19:32 -07:00
parent 6157437aec
commit 0ef4e15a6c
6 changed files with 15 additions and 20 deletions

View File

@ -64,7 +64,6 @@ public:
* Requires ACCESS_SURFACE_FLINGER permission
*/
virtual sp<ISurface> createSurface( surface_data_t* data,
int pid,
const String8& name,
DisplayID display,
uint32_t w,

View File

@ -79,7 +79,6 @@ public:
//! Create a surface
sp<SurfaceControl> createSurface(
int pid, // pid of the process the surface is for
const String8& name,// name of the surface
DisplayID display, // Display to create this surface on
uint32_t w, // width in pixel
@ -89,7 +88,6 @@ public:
);
sp<SurfaceControl> createSurface(
int pid, // pid of the process the surface is for
DisplayID display, // Display to create this surface on
uint32_t w, // width in pixel
uint32_t h, // height in pixel

View File

@ -83,7 +83,6 @@ public:
}
virtual sp<ISurface> createSurface( surface_data_t* params,
int pid,
const String8& name,
DisplayID display,
uint32_t w,
@ -93,7 +92,6 @@ public:
{
Parcel data, reply;
data.writeInterfaceToken(ISurfaceComposerClient::getInterfaceDescriptor());
data.writeInt32(pid);
data.writeString8(name);
data.writeInt32(display);
data.writeInt32(w);
@ -172,14 +170,13 @@ status_t BnSurfaceComposerClient::onTransact(
case CREATE_SURFACE: {
CHECK_INTERFACE(ISurfaceComposerClient, data, reply);
surface_data_t params;
int32_t pid = data.readInt32();
String8 name = data.readString8();
DisplayID display = data.readInt32();
uint32_t w = data.readInt32();
uint32_t h = data.readInt32();
PixelFormat format = data.readInt32();
uint32_t flags = data.readInt32();
sp<ISurface> s = createSurface(&params, pid, name, display, w, h,
sp<ISurface> s = createSurface(&params, name, display, w, h,
format, flags);
params.writeToParcel(reply);
reply->writeStrongBinder(s->asBinder());

View File

@ -273,7 +273,6 @@ ssize_t SurfaceComposerClient::getNumberOfDisplays()
}
sp<SurfaceControl> SurfaceComposerClient::createSurface(
int pid,
DisplayID display,
uint32_t w,
uint32_t h,
@ -286,12 +285,11 @@ sp<SurfaceControl> SurfaceComposerClient::createSurface(
snprintf(buffer, SIZE, "<pid_%d>", getpid());
name.append(buffer);
return SurfaceComposerClient::createSurface(pid, name, display,
return SurfaceComposerClient::createSurface(name, display,
w, h, format, flags);
}
sp<SurfaceControl> SurfaceComposerClient::createSurface(
int pid,
const String8& name,
DisplayID display,
uint32_t w,
@ -302,7 +300,7 @@ sp<SurfaceControl> SurfaceComposerClient::createSurface(
sp<SurfaceControl> result;
if (mStatus == NO_ERROR) {
ISurfaceComposerClient::surface_data_t data;
sp<ISurface> surface = mClient->createSurface(&data, pid, name,
sp<ISurface> surface = mClient->createSurface(&data, name,
display, w, h, format, flags);
if (surface != 0) {
result = new SurfaceControl(this, surface, data, w, h, format, flags);

View File

@ -1241,8 +1241,10 @@ int SurfaceFlinger::setOrientation(DisplayID dpy,
return orientation;
}
sp<ISurface> SurfaceFlinger::createSurface(const sp<Client>& client, int pid,
const String8& name, ISurfaceComposerClient::surface_data_t* params,
sp<ISurface> SurfaceFlinger::createSurface(
ISurfaceComposerClient::surface_data_t* params,
const String8& name,
const sp<Client>& client,
DisplayID d, uint32_t w, uint32_t h, PixelFormat format,
uint32_t flags)
{
@ -2414,12 +2416,12 @@ ssize_t Client::getTokenForSurface(const sp<ISurface>& sur) const {
return -1;
}
sp<ISurface> Client::createSurface(
ISurfaceComposerClient::surface_data_t* params, int pid,
ISurfaceComposerClient::surface_data_t* params,
const String8& name,
DisplayID display, uint32_t w, uint32_t h, PixelFormat format,
uint32_t flags)
{
return mFlinger->createSurface(this, pid, name, params,
return mFlinger->createSurface(params, name, this,
display, w, h, format, flags);
}
status_t Client::destroySurface(SurfaceID sid) {
@ -2523,7 +2525,7 @@ ssize_t UserClient::getTokenForSurface(const sp<ISurface>& sur) const
}
sp<ISurface> UserClient::createSurface(
ISurfaceComposerClient::surface_data_t* params, int pid,
ISurfaceComposerClient::surface_data_t* params,
const String8& name,
DisplayID display, uint32_t w, uint32_t h, PixelFormat format,
uint32_t flags) {

View File

@ -75,7 +75,7 @@ private:
virtual sp<IMemoryHeap> getControlBlock() const;
virtual ssize_t getTokenForSurface(const sp<ISurface>& sur) const;
virtual sp<ISurface> createSurface(
surface_data_t* params, int pid, const String8& name,
surface_data_t* params, const String8& name,
DisplayID display, uint32_t w, uint32_t h,PixelFormat format,
uint32_t flags);
virtual status_t destroySurface(SurfaceID surfaceId);
@ -107,7 +107,7 @@ private:
virtual sp<IMemoryHeap> getControlBlock() const;
virtual ssize_t getTokenForSurface(const sp<ISurface>& sur) const;
virtual sp<ISurface> createSurface(
surface_data_t* params, int pid, const String8& name,
surface_data_t* params, const String8& name,
DisplayID display, uint32_t w, uint32_t h,PixelFormat format,
uint32_t flags);
virtual status_t destroySurface(SurfaceID surfaceId);
@ -232,9 +232,10 @@ private:
friend class Layer;
friend class LayerDim;
sp<ISurface> createSurface(const sp<Client>& client,
int pid, const String8& name,
sp<ISurface> createSurface(
ISurfaceComposerClient::surface_data_t* params,
const String8& name,
const sp<Client>& client,
DisplayID display, uint32_t w, uint32_t h, PixelFormat format,
uint32_t flags);