diff options
Diffstat (limited to 'libs')
-rw-r--r-- | libs/gui/SurfaceTextureClient.cpp | 3 | ||||
-rw-r--r-- | libs/gui/tests/SurfaceTextureClient_test.cpp | 8 | ||||
-rw-r--r-- | libs/surfaceflinger_client/Surface.cpp | 6 | ||||
-rw-r--r-- | libs/surfaceflinger_client/tests/Surface_test.cpp | 8 | ||||
-rw-r--r-- | libs/ui/FramebufferNativeWindow.cpp | 3 |
5 files changed, 27 insertions, 1 deletions
diff --git a/libs/gui/SurfaceTextureClient.cpp b/libs/gui/SurfaceTextureClient.cpp index a40fac9..111141f 100644 --- a/libs/gui/SurfaceTextureClient.cpp +++ b/libs/gui/SurfaceTextureClient.cpp @@ -160,6 +160,9 @@ int SurfaceTextureClient::query(int what, int* value) { // SurfaceTextureClient currently never queues frames to SurfaceFlinger. *value = 0; return NO_ERROR; + case NATIVE_WINDOW_CONCRETE_TYPE: + *value = NATIVE_WINDOW_SURFACE_TEXTURE_CLIENT; + return NO_ERROR; } return BAD_VALUE; } diff --git a/libs/gui/tests/SurfaceTextureClient_test.cpp b/libs/gui/tests/SurfaceTextureClient_test.cpp index 0f140ff..359b71c 100644 --- a/libs/gui/tests/SurfaceTextureClient_test.cpp +++ b/libs/gui/tests/SurfaceTextureClient_test.cpp @@ -44,4 +44,12 @@ TEST_F(SurfaceTextureClientTest, QueuesToWindowCompositorIsFalse) { EXPECT_EQ(0, result); } +TEST_F(SurfaceTextureClientTest, ConcreteTypeIsSurfaceTextureClient) { + sp<ANativeWindow> anw(mSTC); + int result = -123; + int err = anw->query(anw.get(), NATIVE_WINDOW_CONCRETE_TYPE, &result); + EXPECT_EQ(NO_ERROR, err); + EXPECT_EQ(NATIVE_WINDOW_SURFACE_TEXTURE_CLIENT, result); +} + } diff --git a/libs/surfaceflinger_client/Surface.cpp b/libs/surfaceflinger_client/Surface.cpp index afabbf4..21d509a 100644 --- a/libs/surfaceflinger_client/Surface.cpp +++ b/libs/surfaceflinger_client/Surface.cpp @@ -712,11 +712,15 @@ int Surface::query(int what, int* value) case NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS: *value = MIN_UNDEQUEUED_BUFFERS; return NO_ERROR; - case NATIVE_WINDOW_QUEUES_TO_WINDOW_COMPOSER: + case NATIVE_WINDOW_QUEUES_TO_WINDOW_COMPOSER: { sp<ISurfaceComposer> sf(ComposerService::getComposerService()); *value = sf->authenticateSurface(mSurface) ? 1 : 0; return NO_ERROR; } + case NATIVE_WINDOW_CONCRETE_TYPE: + *value = NATIVE_WINDOW_SURFACE; + return NO_ERROR; + } return BAD_VALUE; } diff --git a/libs/surfaceflinger_client/tests/Surface_test.cpp b/libs/surfaceflinger_client/tests/Surface_test.cpp index 74ebf4e..fd07479 100644 --- a/libs/surfaceflinger_client/tests/Surface_test.cpp +++ b/libs/surfaceflinger_client/tests/Surface_test.cpp @@ -130,4 +130,12 @@ TEST_F(SurfaceTest, ScreenshotsOfProtectedBuffersFail) { ASSERT_TRUE(heap != NULL); } +TEST_F(SurfaceTest, ConcreteTypeIsSurface) { + sp<ANativeWindow> anw(mSurface); + int result = -123; + int err = anw->query(anw.get(), NATIVE_WINDOW_CONCRETE_TYPE, &result); + EXPECT_EQ(NO_ERROR, err); + EXPECT_EQ(NATIVE_WINDOW_SURFACE, result); +} + } diff --git a/libs/ui/FramebufferNativeWindow.cpp b/libs/ui/FramebufferNativeWindow.cpp index 0702d49..dc223f9 100644 --- a/libs/ui/FramebufferNativeWindow.cpp +++ b/libs/ui/FramebufferNativeWindow.cpp @@ -286,6 +286,9 @@ int FramebufferNativeWindow::query(ANativeWindow* window, case NATIVE_WINDOW_FORMAT: *value = fb->format; return NO_ERROR; + case NATIVE_WINDOW_CONCRETE_TYPE: + *value = NATIVE_WINDOW_FRAMEBUFFER; + return NO_ERROR; } *value = 0; return BAD_VALUE; |