From a7d32b86e56ec31a028c90beec36444e65428735 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Tue, 19 Jun 2018 13:12:46 -0700 Subject: [PATCH] Get rid of an include of an internal Skia header in GPU Surface GL. (flutter/engine#5568) --- engine/src/flutter/shell/gpu/gpu_surface_gl.cc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/engine/src/flutter/shell/gpu/gpu_surface_gl.cc b/engine/src/flutter/shell/gpu/gpu_surface_gl.cc index c849b883b2..1d61effb0a 100644 --- a/engine/src/flutter/shell/gpu/gpu_surface_gl.cc +++ b/engine/src/flutter/shell/gpu/gpu_surface_gl.cc @@ -12,7 +12,14 @@ #include "third_party/skia/include/gpu/GrBackendSurface.h" #include "third_party/skia/include/gpu/GrContextOptions.h" #include "third_party/skia/include/gpu/gl/GrGLInterface.h" -#include "third_party/skia/src/gpu/gl/GrGLDefines.h" + +// These are common defines present on all OpenGL headers. However, we don't +// want to perform GL header reasolution on each platform we support. So just +// define these upfront. It is unlikely we will need more. But, if we do, we can +// add the same here. +#define GPU_GL_RGBA8 0x8058 +#define GPU_GL_RGBA4 0x8056 +#define GPU_GL_RGB565 0x8D62 namespace shell { @@ -83,9 +90,9 @@ static SkColorType FirstSupportedColorType(GrContext* context, *format = (y); \ return (x); \ } - RETURN_IF_RENDERABLE(kRGBA_8888_SkColorType, GR_GL_RGBA8); - RETURN_IF_RENDERABLE(kARGB_4444_SkColorType, GR_GL_RGBA4); - RETURN_IF_RENDERABLE(kRGB_565_SkColorType, GR_GL_RGB565); + RETURN_IF_RENDERABLE(kRGBA_8888_SkColorType, GPU_GL_RGBA8); + RETURN_IF_RENDERABLE(kARGB_4444_SkColorType, GPU_GL_RGBA4); + RETURN_IF_RENDERABLE(kRGB_565_SkColorType, GPU_GL_RGB565); return kUnknown_SkColorType; }