Flutter Engine
The Flutter Engine
Public Attributes | List of all members
FlutterOpenGLRendererConfig Struct Reference

#include <embedder.h>

Public Attributes

size_t struct_size
 The size of this struct. Must be sizeof(FlutterOpenGLRendererConfig). More...
 
BoolCallback make_current
 
BoolCallback clear_current
 
BoolCallback present
 
UIntCallback fbo_callback
 
BoolCallback make_resource_current
 
bool fbo_reset_after_present
 
TransformationCallback surface_transformation
 
ProcResolver gl_proc_resolver
 
TextureFrameCallback gl_external_texture_frame_callback
 
UIntFrameInfoCallback fbo_with_frame_info_callback
 
BoolPresentInfoCallback present_with_info
 
FlutterFrameBufferWithDamageCallback populate_existing_damage
 

Detailed Description

Definition at line 513 of file embedder.h.

Member Data Documentation

◆ clear_current

BoolCallback FlutterOpenGLRendererConfig::clear_current

Definition at line 517 of file embedder.h.

◆ fbo_callback

UIntCallback FlutterOpenGLRendererConfig::fbo_callback

Specifying one (and only one) of the fbo_callback or fbo_with_frame_info_callback is required. Specifying both is an error and engine intialization will be terminated. The return value indicates the id of the frame buffer object that flutter will obtain the gl surface from.

Definition at line 530 of file embedder.h.

◆ fbo_reset_after_present

bool FlutterOpenGLRendererConfig::fbo_reset_after_present

By default, the renderer config assumes that the FBO does not change for the duration of the engine run. If this argument is true, the engine will ask the embedder for an updated FBO target (via an fbo_callback invocation) after a present call.

Definition at line 542 of file embedder.h.

◆ fbo_with_frame_info_callback

UIntFrameInfoCallback FlutterOpenGLRendererConfig::fbo_with_frame_info_callback

Specifying one (and only one) of the fbo_callback or fbo_with_frame_info_callback is required. Specifying both is an error and engine intialization will be terminated. The return value indicates the id of the frame buffer object (fbo) that flutter will obtain the gl surface from. When using this variant, the embedder is passed a FlutterFrameInfo struct that indicates the properties of the surface that flutter will acquire from the returned fbo.

Definition at line 567 of file embedder.h.

◆ gl_external_texture_frame_callback

TextureFrameCallback FlutterOpenGLRendererConfig::gl_external_texture_frame_callback

When the embedder specifies that a texture has a frame available, the engine will call this method (on an internal engine managed thread) so that external texture details can be supplied to the engine for subsequent composition.

Definition at line 559 of file embedder.h.

◆ gl_proc_resolver

ProcResolver FlutterOpenGLRendererConfig::gl_proc_resolver

Definition at line 554 of file embedder.h.

◆ make_current

BoolCallback FlutterOpenGLRendererConfig::make_current

Definition at line 516 of file embedder.h.

◆ make_resource_current

BoolCallback FlutterOpenGLRendererConfig::make_resource_current

This is an optional callback. Flutter will ask the emebdder to create a GL context current on a background thread. If the embedder is able to do so, Flutter will assume that this context is in the same sharegroup as the main rendering context and use this context for asynchronous texture uploads. Though optional, it is recommended that all embedders set this callback as it will lead to better performance in texture handling.

Definition at line 537 of file embedder.h.

◆ populate_existing_damage

FlutterFrameBufferWithDamageCallback FlutterOpenGLRendererConfig::populate_existing_damage

Specifying this callback is a requirement for dirty region management. Dirty region management will only render the areas of the screen that have changed in between frames, greatly reducing rendering times and energy consumption. To take advantage of these benefits, it is necessary to define populate_existing_damage as a callback that takes user data, an FBO ID, and an existing damage FlutterDamage. The callback should use the given FBO ID to identify the FBO's exisiting damage (i.e. areas that have changed since the FBO was last used) and use it to populate the given existing damage variable. This callback is dependent on either fbo_callback or fbo_with_frame_info_callback being defined as they are responsible for providing populate_existing_damage with the FBO's ID. Not specifying populate_existing_damage will result in full repaint (i.e. rendering all the pixels on the screen at every frame).

Definition at line 592 of file embedder.h.

◆ present

BoolCallback FlutterOpenGLRendererConfig::present

Specifying one (and only one) of present or present_with_info is required. Specifying both is an error and engine initialization will be terminated. The return value indicates success of the present call. If the intent is to use dirty region management, present_with_info must be defined as present will not succeed in communicating information about damage.

Definition at line 524 of file embedder.h.

◆ present_with_info

BoolPresentInfoCallback FlutterOpenGLRendererConfig::present_with_info

Specifying one (and only one) of present or present_with_info is required. Specifying both is an error and engine initialization will be terminated. When using this variant, the embedder is passed a FlutterPresentInfo struct that the embedder can use to release any resources. The return value indicates success of the present call. This callback is essential for dirty region management. If not defined, all the pixels on the screen will be rendered at every frame (regardless of whether damage is actually being computed or not). This is because the information that is passed along to the callback contains the frame and buffer damage that are essential for dirty region management.

Definition at line 578 of file embedder.h.

◆ struct_size

size_t FlutterOpenGLRendererConfig::struct_size

The size of this struct. Must be sizeof(FlutterOpenGLRendererConfig).

Definition at line 515 of file embedder.h.

◆ surface_transformation

TransformationCallback FlutterOpenGLRendererConfig::surface_transformation

The transformation to apply to the render target before any rendering operations. This callback is optional.

Attention
When using a custom compositor, the layer offset and sizes will be affected by this transformation. It will be embedder responsibility to render contents at the transformed offset and size. This is useful for embedders that want to render transformed contents directly into hardware overlay planes without having to apply extra transformations to layer contents (which may necessitate an expensive off-screen render pass).

Definition at line 553 of file embedder.h.


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