Merge "SurfaceTextureClient: Add ISurfaceTexture getter." into honeycomb-mr1

This commit is contained in:
Jamie Gennis 2011-03-15 10:34:35 -07:00 committed by Android (Google) Code Review
commit f9a20d77fa
3 changed files with 11 additions and 0 deletions

View File

@ -33,6 +33,8 @@ class SurfaceTextureClient
public:
SurfaceTextureClient(const sp<ISurfaceTexture>& surfaceTexture);
sp<ISurfaceTexture> getISurfaceTexture() const;
private:
// can't be copied

View File

@ -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);

View File

@ -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;