From 76169da0e84b0fcf621aeac6141af3ee85bc7c1e Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Wed, 9 Dec 2009 14:32:56 -0800 Subject: fix [2315900] Monochrome camera preview screen after launching camera this was introduced by a recent change. when we try to figure out the size of the yuv->rgb temporary buffer, the output resolution has not been computed yet and an invalid buffer size is used. most of the time the allocation fails and the system reverts to "standard" GL will uses onle the Y plane. the allocation of the temporary buffer is moved to onDraw(), the first time it is called, by that time, the window is positioned properly. --- libs/surfaceflinger/LayerBuffer.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libs/surfaceflinger/LayerBuffer.h') diff --git a/libs/surfaceflinger/LayerBuffer.h b/libs/surfaceflinger/LayerBuffer.h index 1abb103a674a..2ca63aca7a38 100644 --- a/libs/surfaceflinger/LayerBuffer.h +++ b/libs/surfaceflinger/LayerBuffer.h @@ -130,13 +130,14 @@ private: virtual bool transformed() const; virtual void destroy() { } private: + status_t initTempBuffer() const; mutable Mutex mBufferSourceLock; sp mBuffer; status_t mStatus; ISurface::BufferHeap mBufferHeap; size_t mBufferSize; mutable LayerBase::Texture mTexture; - NativeBuffer mTempBuffer; + mutable NativeBuffer mTempBuffer; mutable sp mTempGraphicBuffer; }; -- cgit v1.2.3-59-g8ed1b