Merge change 22021 into eclair
* changes: fix a bug that caused the PixelFormat viewed by Surface to be wrong.
This commit is contained in:
@@ -52,6 +52,9 @@ public:
|
|||||||
struct surface_data_t {
|
struct surface_data_t {
|
||||||
int32_t token;
|
int32_t token;
|
||||||
int32_t identity;
|
int32_t identity;
|
||||||
|
uint32_t width;
|
||||||
|
uint32_t height;
|
||||||
|
uint32_t format;
|
||||||
status_t readFromParcel(const Parcel& parcel);
|
status_t readFromParcel(const Parcel& parcel);
|
||||||
status_t writeToParcel(Parcel* parcel) const;
|
status_t writeToParcel(Parcel* parcel) const;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -730,14 +730,6 @@ sp<LayerBaseClient> LayerBaseClient::Surface::getOwner() const {
|
|||||||
return owner;
|
return owner;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LayerBaseClient::Surface::getSurfaceData(
|
|
||||||
ISurfaceFlingerClient::surface_data_t* params) const
|
|
||||||
{
|
|
||||||
params->token = mToken;
|
|
||||||
params->identity = mIdentity;
|
|
||||||
}
|
|
||||||
|
|
||||||
status_t LayerBaseClient::Surface::onTransact(
|
status_t LayerBaseClient::Surface::onTransact(
|
||||||
uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
|
uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -321,10 +321,9 @@ public:
|
|||||||
class Surface : public BnSurface
|
class Surface : public BnSurface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
int32_t getToken() const { return mToken; }
|
||||||
|
int32_t getIdentity() const { return mIdentity; }
|
||||||
|
|
||||||
virtual void getSurfaceData(
|
|
||||||
ISurfaceFlingerClient::surface_data_t* params) const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Surface(const sp<SurfaceFlinger>& flinger,
|
Surface(const sp<SurfaceFlinger>& flinger,
|
||||||
SurfaceID id, int identity,
|
SurfaceID id, int identity,
|
||||||
|
|||||||
@@ -1239,9 +1239,11 @@ sp<ISurface> SurfaceFlinger::createSurface(ClientID clientId, int pid,
|
|||||||
switch (flags & eFXSurfaceMask) {
|
switch (flags & eFXSurfaceMask) {
|
||||||
case eFXSurfaceNormal:
|
case eFXSurfaceNormal:
|
||||||
if (UNLIKELY(flags & ePushBuffers)) {
|
if (UNLIKELY(flags & ePushBuffers)) {
|
||||||
layer = createPushBuffersSurfaceLocked(client, d, id, w, h, flags);
|
layer = createPushBuffersSurfaceLocked(client, d, id,
|
||||||
|
w, h, flags);
|
||||||
} else {
|
} else {
|
||||||
layer = createNormalSurfaceLocked(client, d, id, w, h, format, flags);
|
layer = createNormalSurfaceLocked(client, d, id,
|
||||||
|
w, h, flags, format);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case eFXSurfaceBlur:
|
case eFXSurfaceBlur:
|
||||||
@@ -1255,8 +1257,13 @@ sp<ISurface> SurfaceFlinger::createSurface(ClientID clientId, int pid,
|
|||||||
if (layer != 0) {
|
if (layer != 0) {
|
||||||
setTransactionFlags(eTransactionNeeded);
|
setTransactionFlags(eTransactionNeeded);
|
||||||
surfaceHandle = layer->getSurface();
|
surfaceHandle = layer->getSurface();
|
||||||
if (surfaceHandle != 0)
|
if (surfaceHandle != 0) {
|
||||||
surfaceHandle->getSurfaceData(params);
|
params->token = surfaceHandle->getToken();
|
||||||
|
params->identity = surfaceHandle->getIdentity();
|
||||||
|
params->width = w;
|
||||||
|
params->height = h;
|
||||||
|
params->format = format;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return surfaceHandle;
|
return surfaceHandle;
|
||||||
@@ -1264,7 +1271,8 @@ sp<ISurface> SurfaceFlinger::createSurface(ClientID clientId, int pid,
|
|||||||
|
|
||||||
sp<LayerBaseClient> SurfaceFlinger::createNormalSurfaceLocked(
|
sp<LayerBaseClient> SurfaceFlinger::createNormalSurfaceLocked(
|
||||||
const sp<Client>& client, DisplayID display,
|
const sp<Client>& client, DisplayID display,
|
||||||
int32_t id, uint32_t w, uint32_t h, PixelFormat format, uint32_t flags)
|
int32_t id, uint32_t w, uint32_t h, uint32_t flags,
|
||||||
|
PixelFormat& format)
|
||||||
{
|
{
|
||||||
// initialize the surfaces
|
// initialize the surfaces
|
||||||
switch (format) { // TODO: take h/w into account
|
switch (format) { // TODO: take h/w into account
|
||||||
|
|||||||
@@ -195,8 +195,8 @@ private:
|
|||||||
|
|
||||||
sp<LayerBaseClient> createNormalSurfaceLocked(
|
sp<LayerBaseClient> createNormalSurfaceLocked(
|
||||||
const sp<Client>& client, DisplayID display,
|
const sp<Client>& client, DisplayID display,
|
||||||
int32_t id, uint32_t w, uint32_t h,
|
int32_t id, uint32_t w, uint32_t h, uint32_t flags,
|
||||||
PixelFormat format, uint32_t flags);
|
PixelFormat& format);
|
||||||
|
|
||||||
sp<LayerBaseClient> createBlurSurfaceLocked(
|
sp<LayerBaseClient> createBlurSurfaceLocked(
|
||||||
const sp<Client>& client, DisplayID display,
|
const sp<Client>& client, DisplayID display,
|
||||||
|
|||||||
@@ -189,8 +189,11 @@ status_t BnSurfaceFlingerClient::onTransact(
|
|||||||
|
|
||||||
status_t ISurfaceFlingerClient::surface_data_t::readFromParcel(const Parcel& parcel)
|
status_t ISurfaceFlingerClient::surface_data_t::readFromParcel(const Parcel& parcel)
|
||||||
{
|
{
|
||||||
token = parcel.readInt32();
|
token = parcel.readInt32();
|
||||||
identity = parcel.readInt32();
|
identity = parcel.readInt32();
|
||||||
|
width = parcel.readInt32();
|
||||||
|
height = parcel.readInt32();
|
||||||
|
format = parcel.readInt32();
|
||||||
return NO_ERROR;
|
return NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -198,6 +201,9 @@ status_t ISurfaceFlingerClient::surface_data_t::writeToParcel(Parcel* parcel) co
|
|||||||
{
|
{
|
||||||
parcel->writeInt32(token);
|
parcel->writeInt32(token);
|
||||||
parcel->writeInt32(identity);
|
parcel->writeInt32(identity);
|
||||||
|
parcel->writeInt32(width);
|
||||||
|
parcel->writeInt32(height);
|
||||||
|
parcel->writeInt32(format);
|
||||||
return NO_ERROR;
|
return NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -197,7 +197,8 @@ SurfaceControl::SurfaceControl(
|
|||||||
uint32_t w, uint32_t h, PixelFormat format, uint32_t flags)
|
uint32_t w, uint32_t h, PixelFormat format, uint32_t flags)
|
||||||
: mClient(client), mSurface(surface),
|
: mClient(client), mSurface(surface),
|
||||||
mToken(data.token), mIdentity(data.identity),
|
mToken(data.token), mIdentity(data.identity),
|
||||||
mWidth(w), mHeight(h), mFormat(format), mFlags(flags)
|
mWidth(data.width), mHeight(data.height), mFormat(data.format),
|
||||||
|
mFlags(flags)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user