5#include "flutter/shell/gpu/gpu_surface_gl_delegate.h"
40#define GPU_GL_VERSION 0x1F02
41 constexpr char kGLESVersionPrefix[] =
"OpenGL ES";
44 using GLGetStringProc =
const char*(__stdcall*)(uint32_t);
46 using GLGetStringProc =
const char* (*)(uint32_t);
49 GLGetStringProc gl_get_string =
50 reinterpret_cast<GLGetStringProc
>(proc_resolver(
"glGetString"));
53 <<
"The GL proc resolver could not resolve glGetString";
58 <<
"The GL proc resolver's glGetString(GL_VERSION) failed";
60 return strncmp(gl_version_string, kGLESVersionPrefix,
61 strlen(kGLESVersionPrefix)) == 0;
66 if (proc_resolver ==
nullptr) {
72 struct ProcResolverContext {
76 ProcResolverContext context = {proc_resolver};
80 auto proc_resolver_context =
81 reinterpret_cast<ProcResolverContext*
>(context);
83 proc_resolver_context->resolver(gl_proc_name));
96 FML_LOG(
ERROR) <<
"Could not create a valid GL interface.";
SK_API sk_sp< const GrGLInterface > GrGLMakeAssembledGLInterface(void *ctx, GrGLGetProc get)
GrGLFuncPtr(* GrGLGetProc)(void *ctx, const char name[])
SK_API sk_sp< const GrGLInterface > GrGLMakeAssembledGLESInterface(void *ctx, GrGLGetProc get)
SK_API sk_sp< const GrGLInterface > GrGLMakeNativeInterface()
virtual bool AllowsDrawingWhenGpuDisabled() const
std::function< void *(const char *)> GLProcResolver
static sk_sp< const GrGLInterface > GetDefaultPlatformGLInterface()
virtual GLProcResolver GetGLProcResolver() const
virtual SkMatrix GLContextSurfaceTransformation() const
virtual sk_sp< const GrGLInterface > GetGLInterface() const
virtual bool GLContextFBOResetAfterPresent() const
virtual SurfaceFrame::FramebufferInfo GLContextFramebufferInfo() const
#define FML_LOG(severity)
#define FML_CHECK(condition)
static sk_sp< const GrGLInterface > CreateGLInterface(const GPUSurfaceGLDelegate::GLProcResolver &proc_resolver)
static bool IsProcResolverOpenGLES(const GPUSurfaceGLDelegate::GLProcResolver &proc_resolver)