35 : context_(context) {
40 reinterpret_cast<EmbedderTestContext*>(context)
41 ->PlatformMessageCallback(
message);
42 };
43
45
46#ifdef SHELL_ENABLE_GL
48 opengl_renderer_config_.make_current = [](void* context) -> bool {
49 return reinterpret_cast<EmbedderTestContextGL*>(context)->GLMakeCurrent();
50 };
51 opengl_renderer_config_.clear_current = [](void* context) -> bool {
52 return reinterpret_cast<EmbedderTestContextGL*>(context)->GLClearCurrent();
53 };
54 opengl_renderer_config_.present_with_info =
56 return reinterpret_cast<EmbedderTestContextGL*>(context)->GLPresent(
57 *present_info);
58 };
59 opengl_renderer_config_.fbo_with_frame_info_callback =
61 return reinterpret_cast<EmbedderTestContextGL*>(context)->GLGetFramebuffer(
62 *frame_info);
63 };
64 opengl_renderer_config_.populate_existing_damage = nullptr;
65 opengl_renderer_config_.make_resource_current = [](void* context) -> bool {
66 return reinterpret_cast<EmbedderTestContextGL*>(context)
67 ->GLMakeResourceCurrent();
68 };
69 opengl_renderer_config_.gl_proc_resolver = [](void* context,
70 const char*
name) ->
void* {
71 return reinterpret_cast<EmbedderTestContextGL*>(context)->GLGetProcAddress(
73 };
74 opengl_renderer_config_.fbo_reset_after_present = true;
75 opengl_renderer_config_.surface_transformation =
77 return reinterpret_cast<EmbedderTestContext*>(context)
78 ->GetRootSurfaceTransformation();
79 };
80#endif
81
82#ifdef SHELL_ENABLE_METAL
83 InitializeMetalRendererConfig();
84#endif
85
86#ifdef SHELL_ENABLE_VULKAN
87 InitializeVulkanRendererConfig();
88#endif
89
92 [](void* context, const void* allocation, size_t row_bytes,
94 auto image_info =
97 if (!
bitmap.installPixels(image_info,
const_cast<void*
>(allocation),
98 row_bytes)) {
99 FML_LOG(
ERROR) <<
"Could not copy pixels for the software "
100 "composition from the engine.";
101 return false;
102 }
104 return reinterpret_cast<EmbedderTestContextSoftware*>(context)->Present(
106 };
107
108
109
111
120
124 }
128 }
129 }
130}
void SetIsolateCreateCallbackHook()
void AddCommandLineArgument(std::string arg)
void SetLogMessageCallbackHook()
void SetChannelUpdateCallbackHook()
void SetSemanticsCallbackHooks()
void SetLocalizationCallbackHooks()
#define FML_LOG(severity)
SK_API sk_sp< SkImage > RasterFromBitmap(const SkBitmap &bitmap)
DEF_SWITCHES_START aot vmservice shared library name
size_t struct_size
The size of this struct. Must be sizeof(FlutterCustomTaskRunners).
FlutterPlatformMessageCallback platform_message_callback
size_t struct_size
The size of this struct. Must be sizeof(FlutterProjectArgs).
bool shutdown_dart_vm_when_done
size_t struct_size
The size of this struct. Must be sizeof(FlutterSoftwareRendererConfig).
SoftwareSurfacePresentCallback surface_present_callback
static constexpr SkISize Make(int32_t w, int32_t h)
static SkImageInfo MakeN32Premul(int width, int height)