| Flutter Windows Embedder |

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

`#include <context.h>`

## 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()

flutter::egl::Context::Context | ( | EGLDisplay | display,
|  | EGLContext | context
| ) |  |

Definition at line 12 of file context.cc.

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

## ◆ ~Context()

flutter::egl::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) {
21 WINDOWS_LOG_EGL_ERROR;
22 }
23 }
WINDOWS_LOG_EGL_ERROR
#define WINDOWS_LOG_EGL_ERROR
Definition: egl.h:19

References WINDOWS_LOG_EGL_ERROR.

## Member Function Documentation

## ◆ ClearCurrent()

bool flutter::egl::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) {
44 WINDOWS_LOG_EGL_ERROR;
45 return false;
46 }
47
48 return true;
49 }

References WINDOWS_LOG_EGL_ERROR.

## ◆ GetHandle()

const EGLContext & flutter::egl::Context::GetHandle | ( |  | ) | const
| virtual

Definition at line 51 of file context.cc.

51 {
52 return context_;
53 }

## ◆ IsCurrent()

bool flutter::egl::Context::IsCurrent | ( |  | ) | const
| virtual

Definition at line 25 of file context.cc.

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

## ◆ MakeCurrent()

bool flutter::egl::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) {
33 WINDOWS_LOG_EGL_ERROR;
34 return false;
35 }
36
37 return true;
38 }

References WINDOWS_LOG_EGL_ERROR.

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

- shell/platform/windows/egl/context.h
- shell/platform/windows/egl/context.cc