skia: Add ANGLE support on Mac

I want to be able to compare ANGLE vs CommandBuffer for
dm and nanobench on Mac, so enabling ANGLE on mac.

Review URL: https://codereview.chromium.org/1395783003
diff --git a/gyp/common.gypi b/gyp/common.gypi
index 46ae9f3..9e53b06 100644
--- a/gyp/common.gypi
+++ b/gyp/common.gypi
@@ -30,8 +30,8 @@
         [ 'skia_mesa and skia_os not in ["mac", "linux"]', {
           'error': '<!(skia_mesa=1 only supported with skia_os="mac" or "linux".)',
         }],
-        [ 'skia_angle and not (skia_os == "win" or skia_os == "linux")', {
-          'error': '<!(skia_angle=1 only supported with skia_os="win" or skia_os="linux".)',
+        [ 'skia_angle and not (skia_os == "win" or skia_os == "linux" or skia_os == "mac")', {
+          'error': '<!(skia_angle=1 only supported with skia_os="win" or skia_os="linux" or skia_os="mac".)',
         }],
         [ 'skia_os == "chromeos" and OS != "linux"', {
           'error': '<!(Skia ChromeOS build is only supported on Linux.)',
diff --git a/gyp/common_conditions.gypi b/gyp/common_conditions.gypi
index 02113c3..115d94b 100644
--- a/gyp/common_conditions.gypi
+++ b/gyp/common_conditions.gypi
@@ -464,6 +464,10 @@
     [ 'skia_os == "mac"',
       {
         'defines': [ 'SK_BUILD_FOR_MAC' ],
+        'conditions': [
+            # ANGLE for mac hits -Wunneeded-internal-declaration if this isn't set.
+            [ 'skia_angle', { 'defines': [ 'YY_NO_INPUT' ], } ],
+        ],
         'configurations': {
           'Coverage': {
             'xcode_settings': {
diff --git a/include/views/SkOSWindow_Mac.h b/include/views/SkOSWindow_Mac.h
index 5063c74..6ce8983 100644
--- a/include/views/SkOSWindow_Mac.h
+++ b/include/views/SkOSWindow_Mac.h
@@ -24,6 +24,9 @@
 #if SK_SUPPORT_GPU
         kNativeGL_BackEndType,
 #endif
+#if SK_ANGLE
+        kANGLE_BackEndType,
+#endif // SK_ANGLE
 #if SK_COMMAND_BUFFER
         kCommandBuffer_BackEndType,
 #endif // SK_COMMAND_BUFFER
diff --git a/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp b/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp
index 1ebd376..834e122 100644
--- a/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp
+++ b/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp
@@ -27,6 +27,8 @@
         // We load the ANGLE library and never let it go
 #if defined _WIN32
         gANGLELib = DynamicLoadLibrary("libGLESv2.dll");
+#elif defined SK_BUILD_FOR_MAC
+        gANGLELib = DynamicLoadLibrary("libGLESv2.dylib");
 #else
         gANGLELib = DynamicLoadLibrary("libGLESv2.so");
 #endif // defined _WIN32