summaryrefslogtreecommitdiff
path: root/libs/gui/SurfaceTextureClient.cpp
diff options
context:
space:
mode:
author Jamie Gennis <jgennis@google.com> 2011-08-17 18:19:00 -0700
committer Jamie Gennis <jgennis@google.com> 2011-08-17 18:19:00 -0700
commit582270d69db94286a248bd829f1ae6f910d45124 (patch)
treefa28a1cbf4df275bd552c38c12ce481d0d8afa1c /libs/gui/SurfaceTextureClient.cpp
parent3cff0866a2bd2e3a736cb0660ce5bc76fce611b8 (diff)
SurfaceTexture: fix queues-to-composer
This change fixes the NATIVE_WINDOW_QUEUES_TO_WINDOW_COMPOSER query of Surface and SurfaceTextureClient. Surface now uses the inherited SurfaceTextureClient implementation of this query. SurfaceTextureClient now queries SurfaceFlinger to determine whether buffers that are queued to its ISurfaceTexture will be sent to SurfaceFlinger (as opposed to some other process). Change-Id: Iff187e72f30d454229f07f896b438198978270a8
Diffstat (limited to 'libs/gui/SurfaceTextureClient.cpp')
-rw-r--r--libs/gui/SurfaceTextureClient.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/libs/gui/SurfaceTextureClient.cpp b/libs/gui/SurfaceTextureClient.cpp
index e91be84c48..5a35b4d482 100644
--- a/libs/gui/SurfaceTextureClient.cpp
+++ b/libs/gui/SurfaceTextureClient.cpp
@@ -18,6 +18,8 @@
//#define LOG_NDEBUG 0
#include <gui/SurfaceTextureClient.h>
+#include <surfaceflinger/ISurfaceComposer.h>
+#include <surfaceflinger/SurfaceComposerClient.h>
#include <utils/Log.h>
@@ -234,7 +236,15 @@ int SurfaceTextureClient::query(int what, int* value) const {
}
break;
case NATIVE_WINDOW_QUEUES_TO_WINDOW_COMPOSER:
- *value = 0;
+ {
+ sp<ISurfaceComposer> composer(
+ ComposerService::getComposerService());
+ if (composer->authenticateSurfaceTexture(mSurfaceTexture)) {
+ *value = 1;
+ } else {
+ *value = 0;
+ }
+ }
return NO_ERROR;
case NATIVE_WINDOW_CONCRETE_TYPE:
*value = NATIVE_WINDOW_SURFACE_TEXTURE_CLIENT;