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
This commit is contained in:
parent
391bbe2246
commit
bae774eb20
@ -33,6 +33,8 @@ class SurfaceTextureClient
|
||||
public:
|
||||
SurfaceTextureClient(const sp<ISurfaceTexture>& surfaceTexture);
|
||||
|
||||
sp<ISurfaceTexture> getISurfaceTexture() const;
|
||||
|
||||
private:
|
||||
|
||||
// can't be copied
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user