Track canvas clearing for swap buffers logic.

A previous fix made it necessary for a frame to render something to GL
in order to cause a call to eglSwapBuffers(). Besides the calls being
tracked as part of issuing a DisplayList, there is also a potential call
to clear the canvas (via glClear()) on non-opaque surfaces. This call is also
good to track, since a surface that gets cleared without any other drawing operations
is worth flipping to the screen (to erase old contents on that surface).

This fix tracks the status of the pre-draw operations to find out whether
glClear() was called and then sets the drawing status appropriately.

Issue #6606422 QuickContact dismissal is janky again (Tracking)

Change-Id: I5fcaccfdc9293dd46b83f2fc279730a5d2740ebf
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 2dc9726..0d857bf 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -164,11 +164,11 @@
     glEnableVertexAttribArray(Program::kBindingPosition);
 }
 
-void OpenGLRenderer::prepare(bool opaque) {
-    prepareDirty(0.0f, 0.0f, mWidth, mHeight, opaque);
+int OpenGLRenderer::prepare(bool opaque) {
+    return prepareDirty(0.0f, 0.0f, mWidth, mHeight, opaque);
 }
 
-void OpenGLRenderer::prepareDirty(float left, float top, float right, float bottom, bool opaque) {
+int OpenGLRenderer::prepareDirty(float left, float top, float right, float bottom, bool opaque) {
     mCaches.clearGarbage();
 
     mSnapshot = new Snapshot(mFirstSnapshot,
@@ -184,9 +184,12 @@
     if (!opaque) {
         mCaches.setScissor(left, mSnapshot->height - bottom, right - left, bottom - top);
         glClear(GL_COLOR_BUFFER_BIT);
+        return DrawGlInfo::kStatusDrew;
     } else {
         mCaches.resetScissor();
     }
+
+    return DrawGlInfo::kStatusDone;
 }
 
 void OpenGLRenderer::syncState() {