Flutter Impeller
impeller::egl::Surface Class Reference

#include <surface.h>

Public Member Functions

 Surface (EGLDisplay display, EGLSurface surface)
 
 ~Surface ()
 
bool IsValid () const
 
const EGLSurface & GetHandle () const
 
bool Present () const
 

Detailed Description

Definition at line 14 of file surface.h.

Constructor & Destructor Documentation

◆ Surface()

impeller::egl::Surface::Surface ( EGLDisplay  display,
EGLSurface  surface 
)

Definition at line 10 of file surface.cc.

11  : display_(display), surface_(surface) {}

◆ ~Surface()

impeller::egl::Surface::~Surface ( )

Definition at line 13 of file surface.cc.

13  {
14  if (surface_ != EGL_NO_SURFACE) {
15  if (::eglDestroySurface(display_, surface_) != EGL_TRUE) {
17  }
18  }
19 }

References IMPELLER_LOG_EGL_ERROR.

Member Function Documentation

◆ GetHandle()

const EGLSurface & impeller::egl::Surface::GetHandle ( ) const

Definition at line 21 of file surface.cc.

21  {
22  return surface_;
23 }

Referenced by impeller::egl::Context::MakeCurrent().

◆ IsValid()

bool impeller::egl::Surface::IsValid ( ) const

Definition at line 25 of file surface.cc.

25  {
26  return surface_ != EGL_NO_SURFACE;
27 }

◆ Present()

bool impeller::egl::Surface::Present ( ) const

Definition at line 29 of file surface.cc.

29  {
30  const auto result = ::eglSwapBuffers(display_, surface_) == EGL_TRUE;
31  if (!result) {
33  }
34  return result;
35 }

References IMPELLER_LOG_EGL_ERROR.


The documentation for this class was generated from the following files:
IMPELLER_LOG_EGL_ERROR
#define IMPELLER_LOG_EGL_ERROR
Definition: egl.h:19