Flutter Engine
The Flutter Engine
Functions
egl_context.cpp File Reference
#include "include/core/SkRefCnt.h"
#include "include/gpu/GrDirectContext.h"
#include "include/gpu/gl/GrGLFunctions.h"
#include "include/gpu/gl/GrGLInterface.h"
#include "tools/gpu/gl/GLTestContext.h"
#include <EGL/egl.h>
#include <GLES2/gl2.h>
#include <sstream>

Go to the source code of this file.

Functions

sk_sp< GrDirectContextcreate_direct_context (std::ostringstream &driverinfo, std::unique_ptr< sk_gpu_test::GLTestContext > *glContext)
 

Function Documentation

◆ create_direct_context()

sk_sp< GrDirectContext > create_direct_context ( std::ostringstream &  driverinfo,
std::unique_ptr< sk_gpu_test::GLTestContext > *  glContext 
)

Definition at line 20 of file egl_context.cpp.

22 {
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}
@ kGLES_GrGLStandard
Definition: GrGLTypes.h:22
GAsyncResult * result
GLTestContext * CreatePlatformGLTestContext(GrGLStandard forcedGpuAPI, GLTestContext *shareContext)