Loading include/gui/SurfaceTexture.h +3 −2 Original line number Diff line number Diff line Loading @@ -259,10 +259,11 @@ private: // This method must be called with mMutex locked. virtual void freeBufferLocked(int slotIndex); // computeCurrentTransformMatrix computes the transform matrix for the // computeCurrentTransformMatrixLocked computes the transform matrix for the // current texture. It uses mCurrentTransform and the current GraphicBuffer // to compute this matrix and stores it in mCurrentTransformMatrix. void computeCurrentTransformMatrix(); // mCurrentTextureBuf must not be NULL. void computeCurrentTransformMatrixLocked(); // doGLFenceWaitLocked inserts a wait command into the OpenGL ES command // stream to ensure that it is safe for future OpenGL ES commands to Loading libs/gui/SurfaceTexture.cpp +19 −5 Original line number Diff line number Diff line Loading @@ -317,7 +317,7 @@ status_t SurfaceTexture::updateTexImage(BufferRejecter* rejecter, bool skipSync) // texturing from this SurfaceTexture. doGLFenceWaitLocked(); } computeCurrentTransformMatrix(); computeCurrentTransformMatrixLocked(); } else { if (err < 0) { ST_LOGE("updateTexImage: acquire failed: %s (%d)", Loading Loading @@ -566,15 +566,24 @@ void SurfaceTexture::getTransformMatrix(float mtx[16]) { void SurfaceTexture::setFilteringEnabled(bool enabled) { Mutex::Autolock lock(mMutex); if (mAbandoned) { ST_LOGE("setFilteringEnabled: SurfaceTexture is abandoned!"); return; } bool needsRecompute = mFilteringEnabled != enabled; mFilteringEnabled = enabled; if (needsRecompute) { computeCurrentTransformMatrix(); if (needsRecompute && mCurrentTextureBuf==NULL) { ST_LOGD("setFilteringEnabled called with mCurrentTextureBuf == NULL"); } if (needsRecompute && mCurrentTextureBuf != NULL) { computeCurrentTransformMatrixLocked(); } } void SurfaceTexture::computeCurrentTransformMatrix() { ST_LOGV("computeCurrentTransformMatrix"); void SurfaceTexture::computeCurrentTransformMatrixLocked() { ST_LOGV("computeCurrentTransformMatrixLocked"); float xform[16]; for (int i = 0; i < 16; i++) { Loading Loading @@ -603,6 +612,11 @@ void SurfaceTexture::computeCurrentTransformMatrix() { } sp<GraphicBuffer>& buf(mCurrentTextureBuf); if (buf == NULL) { ST_LOGD("computeCurrentTransformMatrixLocked: mCurrentTextureBuf is NULL"); } Rect cropRect = mCurrentCrop; float tx = 0.0f, ty = 0.0f, sx = 1.0f, sy = 1.0f; float bufferWidth = buf->getWidth(); Loading Loading
include/gui/SurfaceTexture.h +3 −2 Original line number Diff line number Diff line Loading @@ -259,10 +259,11 @@ private: // This method must be called with mMutex locked. virtual void freeBufferLocked(int slotIndex); // computeCurrentTransformMatrix computes the transform matrix for the // computeCurrentTransformMatrixLocked computes the transform matrix for the // current texture. It uses mCurrentTransform and the current GraphicBuffer // to compute this matrix and stores it in mCurrentTransformMatrix. void computeCurrentTransformMatrix(); // mCurrentTextureBuf must not be NULL. void computeCurrentTransformMatrixLocked(); // doGLFenceWaitLocked inserts a wait command into the OpenGL ES command // stream to ensure that it is safe for future OpenGL ES commands to Loading
libs/gui/SurfaceTexture.cpp +19 −5 Original line number Diff line number Diff line Loading @@ -317,7 +317,7 @@ status_t SurfaceTexture::updateTexImage(BufferRejecter* rejecter, bool skipSync) // texturing from this SurfaceTexture. doGLFenceWaitLocked(); } computeCurrentTransformMatrix(); computeCurrentTransformMatrixLocked(); } else { if (err < 0) { ST_LOGE("updateTexImage: acquire failed: %s (%d)", Loading Loading @@ -566,15 +566,24 @@ void SurfaceTexture::getTransformMatrix(float mtx[16]) { void SurfaceTexture::setFilteringEnabled(bool enabled) { Mutex::Autolock lock(mMutex); if (mAbandoned) { ST_LOGE("setFilteringEnabled: SurfaceTexture is abandoned!"); return; } bool needsRecompute = mFilteringEnabled != enabled; mFilteringEnabled = enabled; if (needsRecompute) { computeCurrentTransformMatrix(); if (needsRecompute && mCurrentTextureBuf==NULL) { ST_LOGD("setFilteringEnabled called with mCurrentTextureBuf == NULL"); } if (needsRecompute && mCurrentTextureBuf != NULL) { computeCurrentTransformMatrixLocked(); } } void SurfaceTexture::computeCurrentTransformMatrix() { ST_LOGV("computeCurrentTransformMatrix"); void SurfaceTexture::computeCurrentTransformMatrixLocked() { ST_LOGV("computeCurrentTransformMatrixLocked"); float xform[16]; for (int i = 0; i < 16; i++) { Loading Loading @@ -603,6 +612,11 @@ void SurfaceTexture::computeCurrentTransformMatrix() { } sp<GraphicBuffer>& buf(mCurrentTextureBuf); if (buf == NULL) { ST_LOGD("computeCurrentTransformMatrixLocked: mCurrentTextureBuf is NULL"); } Rect cropRect = mCurrentCrop; float tx = 0.0f, ty = 0.0f, sx = 1.0f, sy = 1.0f; float bufferWidth = buf->getWidth(); Loading