debug.egl.finish can be used to force a glFinish() when eglSwapBuffers() is called

this debug property is evaludated at eglInitialize() time.

Change-Id: Ie439e4aac87f7fdc6ab2add86183d6d042f3ee8b
diff --git a/opengl/libs/EGL/egl_display.cpp b/opengl/libs/EGL/egl_display.cpp
index f1e493d..b80afd6 100644
--- a/opengl/libs/EGL/egl_display.cpp
+++ b/opengl/libs/EGL/egl_display.cpp
@@ -22,6 +22,7 @@
 #include "egl_tls.h"
 #include "egl_impl.h"
 #include "Loader.h"
+#include <cutils/properties.h>
 
 // ----------------------------------------------------------------------------
 namespace android {
@@ -66,7 +67,7 @@
 egl_display_t egl_display_t::sDisplay[NUM_DISPLAYS];
 
 egl_display_t::egl_display_t() :
-    magic('_dpy'), refs(0) {
+    magic('_dpy'), finishOnSwap(false), refs(0) {
 }
 
 egl_display_t::~egl_display_t() {
@@ -232,6 +233,12 @@
 
     egl_cache_t::get()->initialize(this);
 
+    char value[PROPERTY_VALUE_MAX];
+    property_get("debug.egl.finish", value, "0");
+    if (atoi(value)) {
+        finishOnSwap = true;
+    }
+
     refs++;
     if (major != NULL)
         *major = VERSION_MAJOR;