diff options
author | Jamie Gennis <jgennis@google.com> | 2011-03-14 15:08:53 -0700 |
---|---|---|
committer | Jamie Gennis <jgennis@google.com> | 2011-03-14 17:47:11 -0700 |
commit | f95a9f019daa0631e6d6ddc826ad9cfe787c42ce (patch) | |
tree | 8e2998c5efebb67a007cfcbe7f2e110d97abbf92 /libs | |
parent | c4ca7c511499693f13622b135637f600ec913e57 (diff) | |
download | frameworks_base-f95a9f019daa0631e6d6ddc826ad9cfe787c42ce.zip frameworks_base-f95a9f019daa0631e6d6ddc826ad9cfe787c42ce.tar.gz frameworks_base-f95a9f019daa0631e6d6ddc826ad9cfe787c42ce.tar.bz2 |
SurfaceTextureClient: Add ISurfaceTexture getter.
This change adds a getter method to SurfaceTextureClient to get the
ISurfaceTexture object with which the SurfaceTextureClient is
communicating.
Bug: 4086509
Change-Id: Ifec621e0fe5392a5be56b2348fdc54067cbebcdd
Diffstat (limited to 'libs')
-rw-r--r-- | libs/gui/SurfaceTextureClient.cpp | 4 | ||||
-rw-r--r-- | libs/gui/tests/SurfaceTextureClient_test.cpp | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/libs/gui/SurfaceTextureClient.cpp b/libs/gui/SurfaceTextureClient.cpp index 111141f..7f1d9cb 100644 --- a/libs/gui/SurfaceTextureClient.cpp +++ b/libs/gui/SurfaceTextureClient.cpp @@ -40,6 +40,10 @@ SurfaceTextureClient::SurfaceTextureClient( mAllocator = mSurfaceTexture->getAllocator(); } +sp<ISurfaceTexture> SurfaceTextureClient::getISurfaceTexture() const { + return mSurfaceTexture; +} + int SurfaceTextureClient::setSwapInterval(ANativeWindow* window, int interval) { SurfaceTextureClient* c = getSelf(window); return c->setSwapInterval(interval); diff --git a/libs/gui/tests/SurfaceTextureClient_test.cpp b/libs/gui/tests/SurfaceTextureClient_test.cpp index 359b71c..25109f6 100644 --- a/libs/gui/tests/SurfaceTextureClient_test.cpp +++ b/libs/gui/tests/SurfaceTextureClient_test.cpp @@ -35,6 +35,11 @@ protected: sp<SurfaceTextureClient> mSTC; }; +TEST_F(SurfaceTextureClientTest, GetISurfaceTextureIsNotNull) { + sp<ISurfaceTexture> ist(mSTC->getISurfaceTexture()); + ASSERT_TRUE(ist != NULL); +} + TEST_F(SurfaceTextureClientTest, QueuesToWindowCompositorIsFalse) { sp<ANativeWindow> anw(mSTC); int result = -123; |