diff options
author | Mathias Agopian <mathias@google.com> | 2011-08-08 19:14:03 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2011-08-08 20:25:44 -0700 |
commit | 053b02df2d350466a2226a90709e50fedef54747 (patch) | |
tree | 28a844d96bfc2fdd0e3714305a8cb86e977a1d90 /services/surfaceflinger | |
parent | fc4ba1141570fab7734e53586dc3d6f3afde10de (diff) | |
download | frameworks_base-053b02df2d350466a2226a90709e50fedef54747.zip frameworks_base-053b02df2d350466a2226a90709e50fedef54747.tar.gz frameworks_base-053b02df2d350466a2226a90709e50fedef54747.tar.bz2 |
return correct value from query after connecting a surface
the first time a surface was connected, the values returned
by query NATIVE_WINDOW_DEFAULT_{WIDTH|HEIGHT} and
NATIVE_WINDOW_TRANSFORM_HINT were wrong until a call
to queueBuffer was performed.
Bug: 5137366, 5121607
Change-Id: I7ac6b5b0daa876638f6bed7c20f286a6e6d984f6
Diffstat (limited to 'services/surfaceflinger')
-rw-r--r-- | services/surfaceflinger/SurfaceTextureLayer.cpp | 14 | ||||
-rw-r--r-- | services/surfaceflinger/SurfaceTextureLayer.h | 3 |
2 files changed, 14 insertions, 3 deletions
diff --git a/services/surfaceflinger/SurfaceTextureLayer.cpp b/services/surfaceflinger/SurfaceTextureLayer.cpp index 5973e76..79cd0c3 100644 --- a/services/surfaceflinger/SurfaceTextureLayer.cpp +++ b/services/surfaceflinger/SurfaceTextureLayer.cpp @@ -86,9 +86,19 @@ status_t SurfaceTextureLayer::dequeueBuffer(int *buf, return res; } -status_t SurfaceTextureLayer::connect(int api) { - status_t err = SurfaceTexture::connect(api); +status_t SurfaceTextureLayer::connect(int api, + uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform) { + status_t err = SurfaceTexture::connect(api, + outWidth, outHeight, outTransform); if (err == NO_ERROR) { + sp<Layer> layer(mLayer.promote()); + if (layer != NULL) { + uint32_t orientation = layer->getOrientation(); + if (orientation & Transform::ROT_INVALID) { + orientation = 0; + } + *outTransform = orientation; + } switch(api) { case NATIVE_WINDOW_API_MEDIA: case NATIVE_WINDOW_API_CAMERA: diff --git a/services/surfaceflinger/SurfaceTextureLayer.h b/services/surfaceflinger/SurfaceTextureLayer.h index 5d328b7..9508524 100644 --- a/services/surfaceflinger/SurfaceTextureLayer.h +++ b/services/surfaceflinger/SurfaceTextureLayer.h @@ -51,7 +51,8 @@ protected: virtual status_t dequeueBuffer(int *buf, uint32_t w, uint32_t h, uint32_t format, uint32_t usage); - virtual status_t connect(int api); + virtual status_t connect(int api, + uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform); }; // --------------------------------------------------------------------------- |