17 {
18 PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT =
19 (PFNEGLGETPLATFORMDISPLAYEXTPROC)eglGetProcAddress("eglGetPlatformDisplayEXT");
20
21
22 if (!eglGetPlatformDisplayEXT) {
23 return nullptr;
24 }
25
27 if (EGL_NO_DISPLAY == fDisplay) {
28 return nullptr;
29 }
30
31 EGLint majorVersion;
32 EGLint minorVersion;
33 if (!eglInitialize(fDisplay, &majorVersion, &minorVersion)) {
34 SkDebugf(
"Could not initialize display!\n");
35 return nullptr;
36 }
37 EGLint numConfigs;
41 const EGLint configAttribs[] = {EGL_RENDERABLE_TYPE,
42
43 EGL_OPENGL_ES3_BIT,
44 EGL_RED_SIZE,
45 8,
46 EGL_GREEN_SIZE,
47 8,
48 EGL_BLUE_SIZE,
49 8,
50 EGL_ALPHA_SIZE,
51 8,
52 EGL_SAMPLE_BUFFERS,
53 sampleBuffers,
54 EGL_SAMPLES,
55 eglSampleCnt,
56 EGL_NONE};
57
58 EGLConfig surfaceConfig;
59 if (!eglChooseConfig(fDisplay, configAttribs, &surfaceConfig, 1, &numConfigs)) {
60 SkDebugf(
"Could not create choose config!\n");
61 return nullptr;
62 }
63
64 const EGLint contextAttribs[] = {EGL_CONTEXT_CLIENT_VERSION, 3, EGL_NONE};
65 fEGLContext = eglCreateContext(fDisplay, surfaceConfig, nullptr, contextAttribs);
66 if (EGL_NO_CONTEXT == fEGLContext) {
67 SkDebugf(
"Could not create context!\n");
68 return nullptr;
69 }
70 fEGLSurface =
71 eglCreateWindowSurface(fDisplay, surfaceConfig, this->
onGetNativeWindow(),
nullptr);
72 if (EGL_NO_SURFACE == fEGLSurface) {
73 SkDebugf(
"Could not create surface!\n");
74 return nullptr;
75 }
76 if (!eglMakeCurrent(fDisplay, fEGLSurface, fEGLSurface, fEGLContext)) {
77 SkDebugf(
"Could not make context current!\n");
78 return nullptr;
79 }
80
82 nullptr,
84 if (interface) {
85 interface->fFunctions.fClearStencil(0);
86 interface->fFunctions.fClearColor(0, 0, 0, 0);
87 interface->fFunctions.fStencilMask(0xffffffff);
89
91
96 }
97 return interface;
98}
SK_API sk_sp< const GrGLInterface > GrGLMakeAssembledInterface(void *ctx, GrGLGetProc get)
#define GR_GL_STENCIL_BUFFER_BIT
#define GR_GL_COLOR_BUFFER_BIT
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
const DisplayParams & getDisplayParams()
virtual SkISize onGetSize() const =0
virtual int onGetStencilBits() const =0
virtual EGLDisplay onGetEGLDisplay(PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT) const =0
virtual NativeWindowType onGetNativeWindow() const =0
DEF_SWITCHES_START aot vmservice shared library name
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
constexpr int32_t width() const