Flutter Engine
The Flutter Engine
third_party
skia
tools
fiddle
egl_context.cpp
Go to the documentation of this file.
1
/*
2
* Copyright 2017 Google Inc.
3
*
4
* Use of this source code is governed by a BSD-style license that can be
5
* found in the LICENSE file.
6
*/
7
8
#include "
include/core/SkRefCnt.h
"
9
#include "
include/gpu/GrDirectContext.h
"
10
#include "
include/gpu/gl/GrGLFunctions.h
"
11
#include "
include/gpu/gl/GrGLInterface.h
"
12
#include "
tools/gpu/gl/GLTestContext.h
"
13
14
#include <EGL/egl.h>
15
#include <GLES2/gl2.h>
16
17
#include <sstream>
18
19
// create_direct_context implementation for EGL.
20
sk_sp<GrDirectContext>
create_direct_context
(
21
std::ostringstream& driverinfo,
22
std::unique_ptr<sk_gpu_test::GLTestContext>* glContext) {
23
glContext->reset(
sk_gpu_test::CreatePlatformGLTestContext
(
kGLES_GrGLStandard
));
24
if
(!glContext) {
25
return
nullptr
;
26
}
27
(*glContext)->makeCurrent();
28
sk_sp<GrDirectContext>
result
= (*glContext)->makeContext(
GrContextOptions
());
29
if
(!
result
) {
30
glContext->reset();
31
return
nullptr
;
32
}
33
34
driverinfo <<
"GL Version: "
<< glGetString(GL_VERSION) <<
"\n"
;
35
driverinfo <<
"GL Vendor: "
<< glGetString(GL_VENDOR) <<
"\n"
;
36
driverinfo <<
"GL Renderer: "
<< glGetString(GL_RENDERER) <<
"\n"
;
37
driverinfo <<
"GL Extensions: "
<< glGetString(GL_EXTENSIONS) <<
"\n"
;
38
39
return
result
;
40
}
GLTestContext.h
GrDirectContext.h
GrGLFunctions.h
GrGLInterface.h
kGLES_GrGLStandard
@ kGLES_GrGLStandard
Definition:
GrGLTypes.h:22
SkRefCnt.h
sk_sp< GrDirectContext >
create_direct_context
sk_sp< GrDirectContext > create_direct_context(std::ostringstream &driverinfo, std::unique_ptr< sk_gpu_test::GLTestContext > *glContext)
Definition:
egl_context.cpp:20
result
GAsyncResult * result
Definition:
fl_text_input_plugin.cc:106
sk_gpu_test::CreatePlatformGLTestContext
GLTestContext * CreatePlatformGLTestContext(GrGLStandard forcedGpuAPI, GLTestContext *shareContext)
Definition:
gm_bindings.cpp:340
GrContextOptions
Definition:
GrContextOptions.h:23
Generated on Sun Jun 23 2024 21:56:49 for Flutter Engine by
1.9.4