diff options
author | Jamie Gennis <jgennis@google.com> | 2011-06-12 17:03:06 -0700 |
---|---|---|
committer | Jamie Gennis <jgennis@google.com> | 2011-06-13 10:50:12 -0700 |
commit | eadfb673e7b346af02a925ad04494100db1ebbf7 (patch) | |
tree | 6ff88f77a6762f00a868807706f1e995d16373ae /include/gui | |
parent | fe93010446e68c747f4af727cbc48eaf63131689 (diff) | |
download | frameworks_base-eadfb673e7b346af02a925ad04494100db1ebbf7.zip frameworks_base-eadfb673e7b346af02a925ad04494100db1ebbf7.tar.gz frameworks_base-eadfb673e7b346af02a925ad04494100db1ebbf7.tar.bz2 |
SurfaceTexture: fix a getTransformMatrix crash.
This change moves the computation of the transform matrix out of
getTransformMatrix and instead performs the computation when
updateTexImage gets called. This is needed in order for
getTransformMatrix to succeed even if the buffers have been freed (e.g.
by changing the buffer count) because the computation depends upon the
properties of the current GraphicBuffer.
Change-Id: Ied541ab8747b7ad604f862717135f9a16a816be9
Bug: 4490420
Diffstat (limited to 'include/gui')
-rw-r--r-- | include/gui/SurfaceTexture.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/gui/SurfaceTexture.h b/include/gui/SurfaceTexture.h index 2b31462..62c3a4a 100644 --- a/include/gui/SurfaceTexture.h +++ b/include/gui/SurfaceTexture.h @@ -188,6 +188,11 @@ private: status_t setBufferCountServerLocked(int bufferCount); + // computeCurrentTransformMatrix 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(); + enum { INVALID_BUFFER_SLOT = -1 }; struct BufferSlot { @@ -322,6 +327,11 @@ private: // gets set to mLastQueuedTransform each time updateTexImage is called. uint32_t mCurrentTransform; + // mCurrentTransformMatrix is the transform matrix for the current texture. + // It gets computed by computeTransformMatrix each time updateTexImage is + // called. + float mCurrentTransformMatrix[16]; + // mCurrentTimestamp is the timestamp for the current texture. It // gets set to mLastQueuedTimestamp each time updateTexImage is called. int64_t mCurrentTimestamp; @@ -362,6 +372,7 @@ private: // variables of SurfaceTexture objects. It must be locked whenever the // member variables are accessed. mutable Mutex mMutex; + }; // ---------------------------------------------------------------------------- |