19 #ifndef ANBOX_SDK_GRAPHICS_PROCESSOR_H_
20 #define ANBOX_SDK_GRAPHICS_PROCESSOR_H_
104 return EGL_NO_SURFACE;
153 [[deprecated(
"Use GraphicsProcessor::present(AnboxGraphicsBuffer2* buffer, AnboxCallback* callback) instead")]]
207 virtual bool create_buffer(uint32_t width, uint32_t height, uint32_t format,
230 vsync_callback_ = callback;
231 vsync_callback_user_data_ = user_data;
236 if (!vsync_callback_)
239 vsync_callback_(time_ns, vsync_callback_user_data_);
244 void* vsync_callback_user_data_ =
nullptr;
GraphicsProcessor allows integration with the graphics engine inside Anbox.
virtual bool destroy_offscreen_surface(EGLDisplay display, EGLSurface surface)
virtual bool present(AnboxGraphicsBuffer2 *buffer, AnboxCallback *callback)
Present the given buffer to a display or other output.
GraphicsProcessor & operator=(const GraphicsProcessor &)=delete
virtual EGLSurface create_offscreen_surface(EGLDisplay display, EGLConfig config, const EGLint *attribs)
Create an offscreen EGL surface for the given display, configuration and attributes.
virtual EGLDisplay create_display()
Create an EGL display.
GraphicsProcessor()=default
void signal_vsync(uint64_t time_ns)
virtual void begin_frame()
Called from Anbox when a new frame is started.
virtual bool create_buffer(uint32_t width, uint32_t height, uint32_t format, uint32_t usage, AnboxGraphicsBuffer2 **buffer)
Create a buffer with the given specifications.
virtual void set_vsync_callback(const AnboxVsyncCallback &callback, void *user_data)
Sets a callback which will be invoked whenever a new vsync is about to start.
virtual void finish_frame()
Called from Anbox when a frame was fully rendered.
virtual int initialize(AnboxGraphicsConfiguration *configuration)
Initialize the graphics processor.
GraphicsProcessor(const GraphicsProcessor &)=delete
virtual bool present(AnboxGraphicsBuffer *buffer, AnboxCallback *callback)
Present the given buffer to a display or other output.
virtual ~GraphicsProcessor()=default
void(* AnboxVsyncCallback)(uint64_t time_ns, void *user_data)
AnboxVsyncCallback is invoked to signal a new vsync is about to start.
Generic callback wrapper.
AnboxDisplaySpec describes properties of the Anbox rendering pipeline the platform plugin can influen...