summaryrefslogtreecommitdiff
path: root/libs/ui/FramebufferNativeWindow.cpp
diff options
context:
space:
mode:
authorDima Zavin <dima@android.com>2012-02-22 14:37:57 -0800
committerDima Zavin <dima@android.com>2012-02-22 15:44:46 -0800
commit180600dec8b1b2900da42f2158edc70cf2264fbc (patch)
tree3c05ce2341535cd33f927504f7551cb1bfdccd2c /libs/ui/FramebufferNativeWindow.cpp
parentcbc69718cb8c637426bc1a642a13a1880d843a45 (diff)
libui: add ability to force a framebuffer format for EGL's use
This does not actually change the framebuffer format. It merely fakes this format to surfaceflinger so that when it creates framebuffer surfaces it will use this format. It's really a giant HACK to allow interworking with buggy gralloc+GPU driver implementations. You should *NEVER* need to set this for shipping devices. Change-Id: I03eeb5b4d72838ef219df386ecc489fc20ab9cc7 Signed-off-by: Dima Zavin <dima@android.com>
Diffstat (limited to 'libs/ui/FramebufferNativeWindow.cpp')
-rw-r--r--libs/ui/FramebufferNativeWindow.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/libs/ui/FramebufferNativeWindow.cpp b/libs/ui/FramebufferNativeWindow.cpp
index d1dca0c906db..26d4823db110 100644
--- a/libs/ui/FramebufferNativeWindow.cpp
+++ b/libs/ui/FramebufferNativeWindow.cpp
@@ -100,6 +100,18 @@ FramebufferNativeWindow::FramebufferNativeWindow()
mNumFreeBuffers = NUM_FRAME_BUFFERS;
mBufferHead = mNumBuffers-1;
+ /*
+ * This does not actually change the framebuffer format. It merely
+ * fakes this format to surfaceflinger so that when it creates
+ * framebuffer surfaces it will use this format. It's really a giant
+ * HACK to allow interworking with buggy gralloc+GPU driver
+ * implementations. You should *NEVER* need to set this for shipping
+ * devices.
+ */
+#ifdef FRAMEBUFFER_FORCE_FORMAT
+ *((uint32_t *)&fbDev->format) = FRAMEBUFFER_FORCE_FORMAT;
+#endif
+
for (i = 0; i < mNumBuffers; i++)
{
buffers[i] = new NativeBuffer(