Precache glyphs at final raster size

The deferred display lists model now allows us to precache glyphs
at their exact size on screen.

This change also removes debug markers when the renderer defers
and reorders display lists. It also adds a flush event marker.

Change-Id: I66ec5216dc12b93ecfdad52a7146b1cfb31fbeb4
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 7e9734f..ff6f332 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -122,8 +122,6 @@
     mFirstSnapshot = new Snapshot;
 
     mScissorOptimizationDisabled = false;
-    mDrawDeferDisabled = false;
-    mDrawReorderDisabled = false;
 }
 
 OpenGLRenderer::~OpenGLRenderer() {
@@ -140,20 +138,6 @@
     } else {
         INIT_LOGD("  Scissor optimization enabled");
     }
-
-    if (property_get(PROPERTY_DISABLE_DRAW_DEFER, property, "false")) {
-        mDrawDeferDisabled = !strcasecmp(property, "true");
-        INIT_LOGD("  Draw defer %s", mDrawDeferDisabled ? "disabled" : "enabled");
-    } else {
-        INIT_LOGD("  Draw defer enabled");
-    }
-
-    if (property_get(PROPERTY_DISABLE_DRAW_REORDER, property, "false")) {
-        mDrawReorderDisabled = !strcasecmp(property, "true");
-        INIT_LOGD("  Draw reorder %s", mDrawReorderDisabled ? "disabled" : "enabled");
-    } else {
-        INIT_LOGD("  Draw reorder enabled");
-    }
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -462,6 +446,10 @@
 // Debug
 ///////////////////////////////////////////////////////////////////////////////
 
+void OpenGLRenderer::eventMark(const char* name) const {
+    mCaches.eventMark(0, name);
+}
+
 void OpenGLRenderer::startMark(const char* name) const {
     mCaches.startMark(0, name);
 }
@@ -1815,7 +1803,7 @@
     // All the usual checks and setup operations (quickReject, setupDraw, etc.)
     // will be performed by the display list itself
     if (displayList && displayList->isRenderable()) {
-        if (CC_UNLIKELY(mDrawDeferDisabled)) {
+        if (CC_UNLIKELY(mCaches.drawDeferDisabled)) {
             return displayList->replay(*this, dirty, flags, 0);
         }
 
@@ -2710,7 +2698,7 @@
     setupDrawShaderUniforms(!isPerspective);
     setupDrawTextGammaUniforms();
 
-    const Rect* clip = mSnapshot->hasPerspectiveTransform() ? NULL : mSnapshot->clipRect;
+    const Rect* clip = isPerspective ? NULL : mSnapshot->clipRect;
     Rect bounds(FLT_MAX / 2.0f, FLT_MAX / 2.0f, FLT_MIN / 2.0f, FLT_MIN / 2.0f);
 
     const bool hasActiveLayer = hasLayer();