Fix GPUSurfaceGL includes on macOS (flutter/engine#4844)

macOS doesn't include GLES support.
This commit is contained in:
Chris Bracken 2018-03-21 16:45:41 -07:00 committed by GitHub
parent 9f169ccfbb
commit 9dcf4907f6

View File

@ -4,9 +4,11 @@
#include "gpu_surface_gl.h"
#if OS_MACOSX || OS_IOS
#if OS_IOS
#include <OpenGLES/ES2/gl.h>
#include <OpenGLES/ES2/glext.h>
#elif OS_MACOSX
#include <OpenGL/gl3.h>
#else
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
@ -85,7 +87,11 @@ static SkColorType FirstSupportedColorType(GrContext* context, GLenum* format) {
*format = (y); \
return (x); \
}
#if OS_MACOSX
RETURN_IF_RENDERABLE(kRGBA_8888_SkColorType, GL_RGBA8);
#else
RETURN_IF_RENDERABLE(kRGBA_8888_SkColorType, GL_RGBA8_OES);
#endif
RETURN_IF_RENDERABLE(kARGB_4444_SkColorType, GL_RGBA4);
RETURN_IF_RENDERABLE(kRGB_565_SkColorType, GL_RGB565);
return kUnknown_SkColorType;