Loading...
Searching...
No Matches
SurfaceFactoryabstract

#include <Ultralight/platform/Surface.h>

Overview

User-defined factory to provide your own surface implementation.

The library uses this to create/destroy Surface instances when rendering Views on the CPU.

Precondition
This is automatically managed for you when using App::Create(), if you want to override Surface or SurfaceFactory, you'll need to use Renderer::Create() instead.

Setting the Surface Factory

The default factory creates/destroys a BitmapSurface but you can override this by providing your own factory to Platform::set_surface_factory().

Public Member Functions

virtual ~SurfaceFactory ()
 
virtual SurfaceCreateSurface (uint32_t width, uint32_t height)=0
 Create a native Surface with a certain width and height (in pixels).
 
virtual void DestroySurface (Surface *surface)=0
 Destroy a native Surface previously created by CreateSurface().
 

Constructor & Destructor Documentation

◆ ~SurfaceFactory()

virtual ~SurfaceFactory ( )
virtual

Member Function Documentation

◆ CreateSurface()

virtual Surface * CreateSurface ( uint32_t width,
uint32_t height )
pure virtual

Create a native Surface with a certain width and height (in pixels).

◆ DestroySurface()

virtual void DestroySurface ( Surface * surface)
pure virtual

Destroy a native Surface previously created by CreateSurface().


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