Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
flutter::egl::Context Class Reference

#include <context.h>

Inheritance diagram for flutter::egl::Context:
flutter::testing::egl::MockContext

Public Member Functions

 Context (EGLDisplay display, EGLContext context)
 
 ~Context ()
 
virtual bool IsCurrent () const
 
virtual bool MakeCurrent () const
 
virtual bool ClearCurrent () const
 
virtual const EGLContext & GetHandle () const
 

Detailed Description

Definition at line 20 of file context.h.

Constructor & Destructor Documentation

◆ Context()

Context::Context ( EGLDisplay  display,
EGLContext  context 
)

Definition at line 12 of file context.cc.

13 : display_(display), context_(context) {}

◆ ~Context()

Context::~Context ( )

Definition at line 15 of file context.cc.

15 {
16 if (display_ == EGL_NO_DISPLAY && context_ == EGL_NO_CONTEXT) {
17 return;
18 }
19
20 if (::eglDestroyContext(display_, context_) != EGL_TRUE) {
22 }
23}
#define WINDOWS_LOG_EGL_ERROR
Definition: egl.h:19

Member Function Documentation

◆ ClearCurrent()

bool Context::ClearCurrent ( ) const
virtual

Definition at line 40 of file context.cc.

40 {
41 const auto result = ::eglMakeCurrent(display_, EGL_NO_SURFACE, EGL_NO_SURFACE,
42 EGL_NO_CONTEXT);
43 if (result != EGL_TRUE) {
45 return false;
46 }
47
48 return true;
49}
GAsyncResult * result

◆ GetHandle()

const EGLContext & Context::GetHandle ( ) const
virtual

Definition at line 51 of file context.cc.

51 {
52 return context_;
53}

◆ IsCurrent()

bool Context::IsCurrent ( ) const
virtual

Definition at line 25 of file context.cc.

25 {
26 return ::eglGetCurrentContext() == context_;
27}

◆ MakeCurrent()

bool Context::MakeCurrent ( ) const
virtual

Definition at line 29 of file context.cc.

29 {
30 const auto result =
31 ::eglMakeCurrent(display_, EGL_NO_SURFACE, EGL_NO_SURFACE, context_);
32 if (result != EGL_TRUE) {
34 return false;
35 }
36
37 return true;
38}

The documentation for this class was generated from the following files: