Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
Skwasm::RenderContext Class Referenceabstract

#include <render_context.h>

Public Member Functions

virtual ~RenderContext ()=default
 
virtual void RenderPicture (const sk_sp< flutter::DisplayList > display_list)=0
 
virtual void RenderImage (flutter::DlImage *image, ImageByteFormat format)=0
 
virtual void Resize (int width, int height)=0
 
virtual void SetResourceCacheLimit (int bytes)=0
 

Static Public Member Functions

static std::unique_ptr< RenderContextMake (int sample_count, int stencil)
 

Detailed Description

Definition at line 15 of file render_context.h.

Constructor & Destructor Documentation

◆ ~RenderContext()

virtual Skwasm::RenderContext::~RenderContext ( )
virtualdefault

Member Function Documentation

◆ Make()

std::unique_ptr< Skwasm::RenderContext > Skwasm::RenderContext::Make ( int  sample_count,
int  stencil 
)
static

Definition at line 96 of file render_context_impeller.cc.

98 {
99 auto clear_depth_emulated = [](float depth) {};
100 auto depth_range_emulated = [](float near_val, float far_val) {};
101
102 std::map<std::string, void*> gl_procs;
103
104 gl_procs["glGetError"] = (void*)&glGetError;
105 gl_procs["glClearDepthf"] = (void*)&clear_depth_emulated;
106 gl_procs["glDepthRangef"] = (void*)&depth_range_emulated;
107
108#define IMPELLER_PROC(name) gl_procs["gl" #name] = (void*)&gl##name;
112 IMPELLER_PROC(GenQueriesEXT);
113 IMPELLER_PROC(DeleteQueriesEXT);
114 IMPELLER_PROC(GetQueryObjectui64vEXT);
115 IMPELLER_PROC(BeginQueryEXT);
116 IMPELLER_PROC(EndQueryEXT);
117 IMPELLER_PROC(GetQueryObjectuivEXT);
118#undef IMPELLER_PROC
119
120 auto gl = std::make_unique<impeller::ProcTableGLES>(
121 [gl_procs = std::move(gl_procs)](const char* function_name) -> void* {
122 auto found = gl_procs.find(function_name);
123 if (found == gl_procs.end()) {
124 return nullptr;
125 }
126 return found->second;
127 });
128
129 auto context = impeller::ContextGLES::Create(
130 impeller::Flags{}, std::move(gl), ShaderLibraryMappingsForApplication(),
131 false);
132
133 auto worker = std::make_shared<ReactorWorker>();
134 context->AddReactorWorker(worker);
135 return std::make_unique<ImpellerRenderContext>(std::move(context),
136 std::move(worker));
137}
static std::shared_ptr< ContextGLES > Create(const Flags &flags, std::unique_ptr< ProcTableGLES > gl, const std::vector< std::shared_ptr< fml::Mapping > > &shader_libraries, bool enable_gpu_tracing)
#define IMPELLER_PROC(proc_ivar)
#define FOR_EACH_IMPELLER_GLES3_PROC(PROC)
#define FOR_EACH_IMPELLER_ES_ONLY_PROC(PROC)
#define FOR_EACH_IMPELLER_PROC(PROC)

References impeller::ContextGLES::Create(), FOR_EACH_IMPELLER_ES_ONLY_PROC, FOR_EACH_IMPELLER_GLES3_PROC, FOR_EACH_IMPELLER_PROC, and IMPELLER_PROC.

◆ RenderImage()

virtual void Skwasm::RenderContext::RenderImage ( flutter::DlImage image,
ImageByteFormat  format 
)
pure virtual

◆ RenderPicture()

virtual void Skwasm::RenderContext::RenderPicture ( const sk_sp< flutter::DisplayList display_list)
pure virtual

◆ Resize()

virtual void Skwasm::RenderContext::Resize ( int  width,
int  height 
)
pure virtual

◆ SetResourceCacheLimit()

virtual void Skwasm::RenderContext::SetResourceCacheLimit ( int  bytes)
pure virtual

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