aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar hendrikw <hendrikw@chromium.org>2015-10-28 08:42:29 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-10-28 08:42:29 -0700
commit9a7404188e4fe435a97b17685ec9959f1e5c220f (patch)
tree5be11dfb747ea39b33ca3d0c58a6ea907ed0d210
parent100b8f8c079510a6b7572f9ed8058c1d4a2bfeba (diff)
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
-rw-r--r--gyp/common.gypi4
-rw-r--r--gyp/common_conditions.gypi4
-rw-r--r--include/views/SkOSWindow_Mac.h3
-rw-r--r--src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp2
4 files changed, 11 insertions, 2 deletions
diff --git a/gyp/common.gypi b/gyp/common.gypi
index 46ae9f37e7..9e53b0650f 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 02113c3f8a..115d94b45c 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 5063c74e6d..6ce898321f 100644
--- a/include/views/SkOSWindow_Mac.h
+++ b/include/views/SkOSWindow_Mac.h
@@ -24,6 +24,9 @@ public:
#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 1ebd376288..834e122f57 100644
--- a/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp
+++ b/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp
@@ -27,6 +27,8 @@ const GrGLInterface* GrGLCreateANGLEInterface() {
// 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