summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/SurfaceTextureLayer.cpp
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-08-08 19:14:03 -0700
committerMathias Agopian <mathias@google.com>2011-08-08 20:25:44 -0700
commit5bfc24515bb5c8ea7975f72d538df37753733a2f (patch)
treeeebb0444121007e834e3433d3bb27cc6dc0157cc /services/surfaceflinger/SurfaceTextureLayer.cpp
parentaf08d8ab6dd2188544ca4f038f33c1c4ed8447cf (diff)
downloadframeworks_native-5bfc24515bb5c8ea7975f72d538df37753733a2f.zip
frameworks_native-5bfc24515bb5c8ea7975f72d538df37753733a2f.tar.gz
frameworks_native-5bfc24515bb5c8ea7975f72d538df37753733a2f.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/SurfaceTextureLayer.cpp')
-rw-r--r--services/surfaceflinger/SurfaceTextureLayer.cpp14
1 files changed, 12 insertions, 2 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: