Fix a problem where hwc and GL composition could show a different buffer
if a surface's buffers are reallocated, the current active buffer will
end-up pointing on one of these until a new buffer is retired.
we're now keeping a reference to the actual buffer until we retire a
new one.
Change-Id: Ib1703947e7a0340694d846e0962576318863b935
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index c367a8d..5444d2f 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -164,7 +164,8 @@
size_t mNumBuffers;
Texture mFailoverTexture;
TextureManager& mTextureManager;
- ssize_t mActiveBuffer;
+ ssize_t mActiveBufferIndex;
+ sp<GraphicBuffer> mActiveBuffer;
bool mFailover;
static status_t destroyTexture(Image* tex, EGLDisplay dpy);