Flutter Engine
The Flutter Engine
Public Member Functions | Friends | List of all members
impeller::egl::Surface Class Reference

An instance of an EGL surface. There is no ability to create surfaces directly. Instead, one must be created using a Display connection. More...

#include <surface.h>

Public Member Functions

 ~Surface ()
 
bool IsValid () const
 
const EGLSurface & GetHandle () const
 
bool Present () const
 Present the surface. For an offscreen pixel buffer surface, this is a no-op. More...
 

Friends

class Display
 

Detailed Description

An instance of an EGL surface. There is no ability to create surfaces directly. Instead, one must be created using a Display connection.

Definition at line 18 of file surface.h.

Constructor & Destructor Documentation

◆ ~Surface()

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}
#define IMPELLER_LOG_EGL_ERROR
Definition: egl.h:25

Member Function Documentation

◆ GetHandle()

const EGLSurface & Surface::GetHandle ( ) const
Returns
Get the handle to the underlying surface.

Definition at line 21 of file surface.cc.

21 {
22 return surface_;
23}

◆ IsValid()

bool Surface::IsValid ( ) const
Returns
True if this is a valid surface.

Definition at line 25 of file surface.cc.

25 {
26 return surface_ != EGL_NO_SURFACE;
27}

◆ Present()

bool Surface::Present ( ) const

Present the surface. For an offscreen pixel buffer surface, this is a no-op.

Returns
True if the surface could be presented.

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}
GAsyncResult * result

Friends And Related Function Documentation

◆ Display

friend class Display
friend

Definition at line 41 of file surface.h.


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