Free OSWindow and EGLWindow through helpers.

This cleans up any potential problems with allocating and freeing
resources in different shared objects or DLLs. Previously we were
using a dynamically linked allocation function and then calling
the standard delete function.

Also adds a base class helper for EGLWindow. Will base the WGL
Window class on this.

Needed for running ANGLE tests against native drivers.

Bug: angleproject:2995
Change-Id: Ic92b447649ebb32c547605c20086c07a601842f0
Reviewed-on: https://chromium-review.googlesource.com/c/1393443
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
diff --git a/util/android/AndroidWindow.cpp b/util/android/AndroidWindow.cpp
index 0767e82..930d9ec 100644
--- a/util/android/AndroidWindow.cpp
+++ b/util/android/AndroidWindow.cpp
@@ -86,16 +86,6 @@
     UNIMPLEMENTED();
 }
 
-OSWindow *CreateOSWindow()
-{
-    // There should be only one live instance of AndroidWindow at a time,
-    // as there is only one Activity Surface behind it.
-    // Creating a new AndroidWindow each time works for ANGLETest,
-    // as it destroys an old window before creating a new one.
-    // TODO: use GLSurfaceView to support multiple windows
-    return new AndroidWindow();
-}
-
 static void onAppCmd(struct android_app *app, int32_t cmd)
 {
     switch (cmd)
@@ -144,3 +134,14 @@
         }
     }
 }
+
+// static
+OSWindow *OSWindow::New()
+{
+    // There should be only one live instance of AndroidWindow at a time,
+    // as there is only one Activity Surface behind it.
+    // Creating a new AndroidWindow each time works for ANGLETest,
+    // as it destroys an old window before creating a new one.
+    // TODO: use GLSurfaceView to support multiple windows
+    return new AndroidWindow();
+}