From 313336ebbbdf256aabb3198f9294b447946bd01b Mon Sep 17 00:00:00 2001 From: Wei Zou Date: Mon, 5 Nov 2012 21:48:42 -0800 Subject: Remove opaque check in GLRenderer when preparing dirty region. Since preserved swap is enabled, we need to clear the color buffer when the scissor rect is prepared for a new process. This prevents garbage to be present from the previous process in the color buffer. CRs-Fixed: 391492, 403067, 405916 Change-Id: I1f72a3dee2f5d58a984f4cd367c9f7bf08ab9d6a Conflicts: libs/hwui/OpenGLRenderer.cpp [PATCH] Remove opaque check in preparing dirty region Since preserved swap is enabled, we need to clear the color buffer when the scissor rect is prepared for a new rocess. This prevents garbage to be present from the previous process in the color buffer. (cherry picked from commit 2b5e584e2615852b68a69bb529c6926190246b64) Change-Id: I92a4fa35e0746f12fcd736e21fd30d9c4b644a8a CRs-Fixed: 391492, 403067, 405916 Conflicts: libs/hwui/OpenGLRenderer.cpp Enable scissor when preparing dirty rect that is opaque Now enabling scissor before setting it in the opaque case, previously was not doing so. Change-Id: I1ea904cf01603096e423556090564291ab712d36 CRs-Fixed: 465346 Depends-on: 278453 --- libs/hwui/OpenGLRenderer.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) mode change 100644 => 100755 libs/hwui/OpenGLRenderer.cpp (limited to 'libs') diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp old mode 100644 new mode 100755 index bc30738..d8bf85c --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -208,14 +208,22 @@ status_t OpenGLRenderer::prepareDirty(float left, float top, float right, float } status_t OpenGLRenderer::clear(float left, float top, float right, float bottom, bool opaque) { +#ifdef QCOM_HARDWARE + mCaches.enableScissor(); + mCaches.setScissor(left, mSnapshot->height - bottom, right - left, bottom - top); + glClear(GL_COLOR_BUFFER_BIT); + if(opaque) + mCaches.resetScissor(); +#else if (!opaque) { mCaches.enableScissor(); mCaches.setScissor(left, mSnapshot->height - bottom, right - left, bottom - top); glClear(GL_COLOR_BUFFER_BIT); return DrawGlInfo::kStatusDrew; } - mCaches.resetScissor(); +#endif + return DrawGlInfo::kStatusDone; } -- cgit v1.1