Loading include/gui/SurfaceTexture.h +4 −1 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ public: // tex indicates the name OpenGL texture to which images are to be streamed. // This texture name cannot be changed once the SurfaceTexture is created. SurfaceTexture(GLuint tex); SurfaceTexture(GLuint tex, bool allowSynchronousMode = true); virtual ~SurfaceTexture(); Loading Loading @@ -361,6 +361,9 @@ private: // mSynchronousMode whether we're in synchronous mode or not bool mSynchronousMode; // mAllowSynchronousMode whether we allow synchronous mode or not const bool mAllowSynchronousMode; // mDequeueCondition condition used for dequeueBuffer in synchronous mode mutable Condition mDequeueCondition; Loading libs/gui/SurfaceTexture.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -78,7 +78,7 @@ static float mtxRot270[16] = { static void mtxMul(float out[16], const float a[16], const float b[16]); SurfaceTexture::SurfaceTexture(GLuint tex) : SurfaceTexture::SurfaceTexture(GLuint tex, bool allowSynchronousMode) : mDefaultWidth(1), mDefaultHeight(1), mPixelFormat(PIXEL_FORMAT_RGBA_8888), Loading @@ -91,7 +91,8 @@ SurfaceTexture::SurfaceTexture(GLuint tex) : mCurrentTimestamp(0), mNextTransform(0), mTexName(tex), mSynchronousMode(false) { mSynchronousMode(false), mAllowSynchronousMode(allowSynchronousMode) { LOGV("SurfaceTexture::SurfaceTexture"); sp<ISurfaceComposer> composer(ComposerService::getComposerService()); mGraphicBufferAlloc = composer->createGraphicBufferAlloc(); Loading Loading @@ -371,6 +372,9 @@ status_t SurfaceTexture::setSynchronousMode(bool enabled) { Mutex::Autolock lock(mMutex); status_t err = OK; if (!mAllowSynchronousMode && enabled) return err; if (!enabled) { // going to asynchronous mode, drain the queue while (mSynchronousMode != enabled && !mQueue.isEmpty()) { Loading Loading
include/gui/SurfaceTexture.h +4 −1 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ public: // tex indicates the name OpenGL texture to which images are to be streamed. // This texture name cannot be changed once the SurfaceTexture is created. SurfaceTexture(GLuint tex); SurfaceTexture(GLuint tex, bool allowSynchronousMode = true); virtual ~SurfaceTexture(); Loading Loading @@ -361,6 +361,9 @@ private: // mSynchronousMode whether we're in synchronous mode or not bool mSynchronousMode; // mAllowSynchronousMode whether we allow synchronous mode or not const bool mAllowSynchronousMode; // mDequeueCondition condition used for dequeueBuffer in synchronous mode mutable Condition mDequeueCondition; Loading
libs/gui/SurfaceTexture.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -78,7 +78,7 @@ static float mtxRot270[16] = { static void mtxMul(float out[16], const float a[16], const float b[16]); SurfaceTexture::SurfaceTexture(GLuint tex) : SurfaceTexture::SurfaceTexture(GLuint tex, bool allowSynchronousMode) : mDefaultWidth(1), mDefaultHeight(1), mPixelFormat(PIXEL_FORMAT_RGBA_8888), Loading @@ -91,7 +91,8 @@ SurfaceTexture::SurfaceTexture(GLuint tex) : mCurrentTimestamp(0), mNextTransform(0), mTexName(tex), mSynchronousMode(false) { mSynchronousMode(false), mAllowSynchronousMode(allowSynchronousMode) { LOGV("SurfaceTexture::SurfaceTexture"); sp<ISurfaceComposer> composer(ComposerService::getComposerService()); mGraphicBufferAlloc = composer->createGraphicBufferAlloc(); Loading Loading @@ -371,6 +372,9 @@ status_t SurfaceTexture::setSynchronousMode(bool enabled) { Mutex::Autolock lock(mMutex); status_t err = OK; if (!mAllowSynchronousMode && enabled) return err; if (!enabled) { // going to asynchronous mode, drain the queue while (mSynchronousMode != enabled && !mQueue.isEmpty()) { Loading