Flutter Engine
The Flutter Engine
Public Types | Public Member Functions | List of all members
flutter::testing::EmbedderConfigBuilder Class Reference

#include <embedder_config_builder.h>

Public Types

enum class  InitializationPreference { kSnapshotsInitialize , kAOTDataInitialize , kMultiAOTInitialize , kNoInitialize }
 

Public Member Functions

 EmbedderConfigBuilder (EmbedderTestContext &context, InitializationPreference preference=InitializationPreference::kSnapshotsInitialize)
 
 ~EmbedderConfigBuilder ()
 
FlutterProjectArgsGetProjectArgs ()
 
void SetRendererConfig (EmbedderTestContextType type, SkISize surface_size)
 
void SetSoftwareRendererConfig (SkISize surface_size=SkISize::Make(1, 1))
 
void SetOpenGLRendererConfig (SkISize surface_size)
 
void SetMetalRendererConfig (SkISize surface_size)
 
void SetVulkanRendererConfig (SkISize surface_size, std::optional< FlutterVulkanInstanceProcAddressCallback > instance_proc_address_callback={})
 
void SetOpenGLFBOCallBack ()
 
void SetOpenGLPresentCallBack ()
 
void SetAssetsPath ()
 
void SetSnapshots ()
 
void SetAOTDataElf ()
 
void SetIsolateCreateCallbackHook ()
 
void SetSemanticsCallbackHooks ()
 
void SetLogMessageCallbackHook ()
 
void SetChannelUpdateCallbackHook ()
 
void SetLogTag (std::string tag)
 
void SetLocalizationCallbackHooks ()
 
void SetExecutableName (std::string executable_name)
 
void SetDartEntrypoint (std::string entrypoint)
 
void AddCommandLineArgument (std::string arg)
 
void AddDartEntrypointArgument (std::string arg)
 
void SetPlatformTaskRunner (const FlutterTaskRunnerDescription *runner)
 
void SetRenderTaskRunner (const FlutterTaskRunnerDescription *runner)
 
void SetPlatformMessageCallback (const std::function< void(const FlutterPlatformMessage *)> &callback)
 
void SetCompositor (bool avoid_backing_store_cache=false, bool use_present_layers_callback=false)
 
FlutterCompositorGetCompositor ()
 
FlutterRendererConfigGetRendererConfig ()
 
void SetRenderTargetType (EmbedderTestBackingStoreProducer::RenderTargetType type, FlutterSoftwarePixelFormat software_pixfmt=kFlutterSoftwarePixelFormatNative32)
 
UniqueEngine LaunchEngine () const
 
UniqueEngine InitializeEngine () const
 
void SetupVsyncCallback ()
 

Detailed Description

Definition at line 30 of file embedder_config_builder.h.

Member Enumeration Documentation

◆ InitializationPreference

Enumerator
kSnapshotsInitialize 
kAOTDataInitialize 
kMultiAOTInitialize 
kNoInitialize 

Definition at line 32 of file embedder_config_builder.h.

32 {
33 kSnapshotsInitialize,
34 kAOTDataInitialize,
35 kMultiAOTInitialize,
36 kNoInitialize,
37 };

Constructor & Destructor Documentation

◆ EmbedderConfigBuilder()

flutter::testing::EmbedderConfigBuilder::EmbedderConfigBuilder ( EmbedderTestContext context,
InitializationPreference  preference = InitializationPreference::kSnapshotsInitialize 
)
explicit

Definition at line 32 of file embedder_config_builder.cc.

35 : context_(context) {
36 project_args_.struct_size = sizeof(project_args_);
37 project_args_.shutdown_dart_vm_when_done = true;
38 project_args_.platform_message_callback =
39 [](const FlutterPlatformMessage* message, void* context) {
40 reinterpret_cast<EmbedderTestContext*>(context)
41 ->PlatformMessageCallback(message);
42 };
43
44 custom_task_runners_.struct_size = sizeof(FlutterCustomTaskRunners);
45
46#ifdef SHELL_ENABLE_GL
47 opengl_renderer_config_.struct_size = sizeof(FlutterOpenGLRendererConfig);
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 =
55 [](void* context, const FlutterPresentInfo* present_info) -> bool {
56 return reinterpret_cast<EmbedderTestContextGL*>(context)->GLPresent(
57 *present_info);
58 };
59 opengl_renderer_config_.fbo_with_frame_info_callback =
60 [](void* context, const FlutterFrameInfo* frame_info) -> uint32_t {
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(
72 name);
73 };
74 opengl_renderer_config_.fbo_reset_after_present = true;
75 opengl_renderer_config_.surface_transformation =
76 [](void* context) -> FlutterTransformation {
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
90 software_renderer_config_.struct_size = sizeof(FlutterSoftwareRendererConfig);
91 software_renderer_config_.surface_present_callback =
92 [](void* context, const void* allocation, size_t row_bytes,
93 size_t height) {
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 }
103 bitmap.setImmutable();
104 return reinterpret_cast<EmbedderTestContextSoftware*>(context)->Present(
106 };
107
108 // The first argument is always the executable name. Don't make tests have to
109 // do this manually.
110 AddCommandLineArgument("embedder_unittest");
111
112 if (preference != InitializationPreference::kNoInitialize) {
119 AddCommandLineArgument("--disable-vm-service");
120
123 SetSnapshots();
124 }
128 }
129 }
130}
#define FML_LOG(severity)
Definition: logging.h:82
Win32Message message
SK_API sk_sp< SkImage > RasterFromBitmap(const SkBitmap &bitmap)
Definition: bitmap.py:1
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32
int32_t height
size_t struct_size
The size of this struct. Must be sizeof(FlutterCustomTaskRunners).
Definition: embedder.h:1591
FlutterPlatformMessageCallback platform_message_callback
Definition: embedder.h:2192
size_t struct_size
The size of this struct. Must be sizeof(FlutterProjectArgs).
Definition: embedder.h:2140
bool shutdown_dart_vm_when_done
Definition: embedder.h:2322
size_t struct_size
The size of this struct. Must be sizeof(FlutterSoftwareRendererConfig).
Definition: embedder.h:818
SoftwareSurfacePresentCallback surface_present_callback
Definition: embedder.h:823
static constexpr SkISize Make(int32_t w, int32_t h)
Definition: SkSize.h:20
static SkImageInfo MakeN32Premul(int width, int height)
#define ERROR(message)
Definition: elf_loader.cc:260

◆ ~EmbedderConfigBuilder()

flutter::testing::EmbedderConfigBuilder::~EmbedderConfigBuilder ( )
default

Member Function Documentation

◆ AddCommandLineArgument()

void flutter::testing::EmbedderConfigBuilder::AddCommandLineArgument ( std::string  arg)

Definition at line 307 of file embedder_config_builder.cc.

307 {
308 if (arg.empty()) {
309 return;
310 }
311
312 command_line_arguments_.emplace_back(std::move(arg));
313}

◆ AddDartEntrypointArgument()

void flutter::testing::EmbedderConfigBuilder::AddDartEntrypointArgument ( std::string  arg)

Definition at line 315 of file embedder_config_builder.cc.

315 {
316 if (arg.empty()) {
317 return;
318 }
319
320 dart_entrypoint_arguments_.emplace_back(std::move(arg));
321}

◆ GetCompositor()

FlutterCompositor & flutter::testing::EmbedderConfigBuilder::GetCompositor ( )

Definition at line 402 of file embedder_config_builder.cc.

402 {
403 return compositor_;
404}

◆ GetProjectArgs()

FlutterProjectArgs & flutter::testing::EmbedderConfigBuilder::GetProjectArgs ( )

Definition at line 134 of file embedder_config_builder.cc.

134 {
135 return project_args_;
136}

◆ GetRendererConfig()

FlutterRendererConfig & flutter::testing::EmbedderConfigBuilder::GetRendererConfig ( )

Definition at line 339 of file embedder_config_builder.cc.

339 {
340 return renderer_config_;
341}

◆ InitializeEngine()

UniqueEngine flutter::testing::EmbedderConfigBuilder::InitializeEngine ( ) const

Definition at line 421 of file embedder_config_builder.cc.

421 {
422 return SetupEngine(false);
423}

◆ LaunchEngine()

UniqueEngine flutter::testing::EmbedderConfigBuilder::LaunchEngine ( ) const

Definition at line 417 of file embedder_config_builder.cc.

417 {
418 return SetupEngine(true);
419}

◆ SetAOTDataElf()

void flutter::testing::EmbedderConfigBuilder::SetAOTDataElf ( )

Definition at line 251 of file embedder_config_builder.cc.

251 {
252 project_args_.aot_data = context_.GetAOTData();
253}
FlutterEngineAOTData GetAOTData() const
FlutterEngineAOTData aot_data
Definition: embedder.h:2353

◆ SetAssetsPath()

void flutter::testing::EmbedderConfigBuilder::SetAssetsPath ( )

Definition at line 225 of file embedder_config_builder.cc.

225 {
226 project_args_.assets_path = context_.GetAssetsPath().c_str();
227}
const std::string & GetAssetsPath() const
const char * assets_path
Definition: embedder.h:2144

◆ SetChannelUpdateCallbackHook()

void flutter::testing::EmbedderConfigBuilder::SetChannelUpdateCallbackHook ( )

Definition at line 276 of file embedder_config_builder.cc.

276 {
277 project_args_.channel_update_callback =
279}
FlutterChannelUpdateCallback GetChannelUpdateCallbackHook()
FlutterChannelUpdateCallback channel_update_callback
Definition: embedder.h:2436

◆ SetCompositor()

void flutter::testing::EmbedderConfigBuilder::SetCompositor ( bool  avoid_backing_store_cache = false,
bool  use_present_layers_callback = false 
)

Definition at line 358 of file embedder_config_builder.cc.

359 {
360 context_.SetupCompositor();
361 auto& compositor = context_.GetCompositor();
362 compositor_.struct_size = sizeof(compositor_);
363 compositor_.user_data = &compositor;
364 compositor_.create_backing_store_callback =
365 [](const FlutterBackingStoreConfig* config, //
366 FlutterBackingStore* backing_store_out, //
367 void* user_data //
368 ) {
369 return reinterpret_cast<EmbedderTestCompositor*>(user_data)
370 ->CreateBackingStore(config, backing_store_out);
371 };
372 compositor_.collect_backing_store_callback =
373 [](const FlutterBackingStore* backing_store, //
374 void* user_data //
375 ) {
376 return reinterpret_cast<EmbedderTestCompositor*>(user_data)
377 ->CollectBackingStore(backing_store);
378 };
379 if (use_present_layers_callback) {
380 compositor_.present_layers_callback = [](const FlutterLayer** layers,
381 size_t layers_count,
382 void* user_data) {
383 auto compositor = reinterpret_cast<EmbedderTestCompositor*>(user_data);
384
385 // The present layers callback is incompatible with multiple views;
386 // it can only be used to render the implicit view.
387 return compositor->Present(kFlutterImplicitViewId, layers, layers_count);
388 };
389 } else {
390 compositor_.present_view_callback = [](const FlutterPresentViewInfo* info) {
391 auto compositor =
392 reinterpret_cast<EmbedderTestCompositor*>(info->user_data);
393
394 return compositor->Present(info->view_id, info->layers,
395 info->layers_count);
396 };
397 }
398 compositor_.avoid_backing_store_cache = avoid_backing_store_cache;
399 project_args_.compositor = &compositor_;
400}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
bool Present(FlutterViewIdentifier view_id, const FlutterLayer **layers, size_t layers_count)
constexpr int64_t kFlutterImplicitViewId
Definition: constants.h:35
const FlutterCompositor * compositor
Definition: embedder.h:2338
void * user_data

◆ SetDartEntrypoint()

void flutter::testing::EmbedderConfigBuilder::SetDartEntrypoint ( std::string  entrypoint)

Definition at line 298 of file embedder_config_builder.cc.

298 {
299 if (entrypoint.empty()) {
300 return;
301 }
302
303 dart_entrypoint_ = std::move(entrypoint);
304 project_args_.custom_dart_entrypoint = dart_entrypoint_.c_str();
305}
const char * custom_dart_entrypoint
Definition: embedder.h:2298

◆ SetExecutableName()

void flutter::testing::EmbedderConfigBuilder::SetExecutableName ( std::string  executable_name)

Definition at line 291 of file embedder_config_builder.cc.

291 {
292 if (executable_name.empty()) {
293 return;
294 }
295 command_line_arguments_[0] = std::move(executable_name);
296}

◆ SetIsolateCreateCallbackHook()

void flutter::testing::EmbedderConfigBuilder::SetIsolateCreateCallbackHook ( )

Definition at line 255 of file embedder_config_builder.cc.

255 {
256 project_args_.root_isolate_create_callback =
258}
VoidCallback root_isolate_create_callback
Definition: embedder.h:2227

◆ SetLocalizationCallbackHooks()

void flutter::testing::EmbedderConfigBuilder::SetLocalizationCallbackHooks ( )

Definition at line 286 of file embedder_config_builder.cc.

286 {
289}
static FlutterComputePlatformResolvedLocaleCallback GetComputePlatformResolvedLocaleCallbackHook()
FlutterComputePlatformResolvedLocaleCallback compute_platform_resolved_locale_callback
Definition: embedder.h:2364

◆ SetLogMessageCallbackHook()

void flutter::testing::EmbedderConfigBuilder::SetLogMessageCallbackHook ( )

Definition at line 271 of file embedder_config_builder.cc.

271 {
272 project_args_.log_message_callback =
274}
static FlutterLogMessageCallback GetLogMessageCallbackHook()
FlutterLogMessageCallback log_message_callback
Definition: embedder.h:2384

◆ SetLogTag()

void flutter::testing::EmbedderConfigBuilder::SetLogTag ( std::string  tag)

Definition at line 281 of file embedder_config_builder.cc.

281 {
282 log_tag_ = std::move(tag);
283 project_args_.log_tag = log_tag_.c_str();
284}
const char * log_tag
Definition: embedder.h:2391

◆ SetMetalRendererConfig()

void flutter::testing::EmbedderConfigBuilder::SetMetalRendererConfig ( SkISize  surface_size)

Definition at line 201 of file embedder_config_builder.cc.

201 {
202#ifdef SHELL_ENABLE_METAL
203 renderer_config_.type = FlutterRendererType::kMetal;
204 renderer_config_.metal = metal_renderer_config_;
205 context_.SetupSurface(surface_size);
206#endif
207}
virtual void SetupSurface(SkISize surface_size)=0
@ kMetal
Definition: embedder.h:85
FlutterMetalRendererConfig metal
Definition: embedder.h:831
FlutterRendererType type
Definition: embedder.h:827

◆ SetOpenGLFBOCallBack()

void flutter::testing::EmbedderConfigBuilder::SetOpenGLFBOCallBack ( )

Definition at line 144 of file embedder_config_builder.cc.

144 {
145#ifdef SHELL_ENABLE_GL
146 // SetOpenGLRendererConfig must be called before this.
147 FML_CHECK(renderer_config_.type == FlutterRendererType::kOpenGL);
148 renderer_config_.open_gl.fbo_callback = [](void* context) -> uint32_t {
149 FlutterFrameInfo frame_info = {};
150 // fbo_callback doesn't use the frame size information, only
151 // fbo_callback_with_frame_info does.
152 frame_info.struct_size = sizeof(FlutterFrameInfo);
153 frame_info.size.width = 0;
154 frame_info.size.height = 0;
155 return reinterpret_cast<EmbedderTestContextGL*>(context)->GLGetFramebuffer(
156 frame_info);
157 };
158#endif
159}
@ kOpenGL
Definition: embedder.h:80
#define FML_CHECK(condition)
Definition: logging.h:85
size_t struct_size
The size of this struct. Must be sizeof(FlutterFrameInfo).
Definition: embedder.h:477
FlutterUIntSize size
The size of the surface that will be backed by the fbo.
Definition: embedder.h:479
UIntCallback fbo_callback
Definition: embedder.h:530
FlutterOpenGLRendererConfig open_gl
Definition: embedder.h:829
uint32_t height
Definition: embedder.h:433
uint32_t width
Definition: embedder.h:432

◆ SetOpenGLPresentCallBack()

void flutter::testing::EmbedderConfigBuilder::SetOpenGLPresentCallBack ( )

Definition at line 161 of file embedder_config_builder.cc.

161 {
162#ifdef SHELL_ENABLE_GL
163 // SetOpenGLRendererConfig must be called before this.
164 FML_CHECK(renderer_config_.type == FlutterRendererType::kOpenGL);
165 renderer_config_.open_gl.present = [](void* context) -> bool {
166 // passing a placeholder fbo_id.
167 return reinterpret_cast<EmbedderTestContextGL*>(context)->GLPresent(
169 .fbo_id = 0,
170 });
171 };
172#endif
173}
uint32_t fbo_id
Id of the fbo backing the surface that was presented.
Definition: embedder.h:501

◆ SetOpenGLRendererConfig()

void flutter::testing::EmbedderConfigBuilder::SetOpenGLRendererConfig ( SkISize  surface_size)

Definition at line 193 of file embedder_config_builder.cc.

193 {
194#ifdef SHELL_ENABLE_GL
195 renderer_config_.type = FlutterRendererType::kOpenGL;
196 renderer_config_.open_gl = opengl_renderer_config_;
197 context_.SetupSurface(surface_size);
198#endif
199}

◆ SetPlatformMessageCallback()

void flutter::testing::EmbedderConfigBuilder::SetPlatformMessageCallback ( const std::function< void(const FlutterPlatformMessage *)> &  callback)

Definition at line 353 of file embedder_config_builder.cc.

354 {
356}
void SetPlatformMessageCallback(const std::function< void(const FlutterPlatformMessage *)> &callback)
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback

◆ SetPlatformTaskRunner()

void flutter::testing::EmbedderConfigBuilder::SetPlatformTaskRunner ( const FlutterTaskRunnerDescription runner)

Definition at line 323 of file embedder_config_builder.cc.

324 {
325 if (runner == nullptr) {
326 return;
327 }
328 custom_task_runners_.platform_task_runner = runner;
329 project_args_.custom_task_runners = &custom_task_runners_;
330}
const FlutterTaskRunnerDescription * platform_task_runner
Definition: embedder.h:1596
const FlutterCustomTaskRunners * custom_task_runners
Definition: embedder.h:2303

◆ SetRendererConfig()

void flutter::testing::EmbedderConfigBuilder::SetRendererConfig ( EmbedderTestContextType  type,
SkISize  surface_size 
)

Definition at line 175 of file embedder_config_builder.cc.

176 {
177 switch (type) {
179 SetOpenGLRendererConfig(surface_size);
180 break;
182 SetMetalRendererConfig(surface_size);
183 break;
185 SetVulkanRendererConfig(surface_size);
186 break;
188 SetSoftwareRendererConfig(surface_size);
189 break;
190 }
191}
GLenum type
void SetSoftwareRendererConfig(SkISize surface_size=SkISize::Make(1, 1))
void SetVulkanRendererConfig(SkISize surface_size, std::optional< FlutterVulkanInstanceProcAddressCallback > instance_proc_address_callback={})

◆ SetRenderTargetType()

void flutter::testing::EmbedderConfigBuilder::SetRenderTargetType ( EmbedderTestBackingStoreProducer::RenderTargetType  type,
FlutterSoftwarePixelFormat  software_pixfmt = kFlutterSoftwarePixelFormatNative32 
)

Definition at line 406 of file embedder_config_builder.cc.

408 {
409 auto& compositor = context_.GetCompositor();
410 // TODO(wrightgeorge): figure out a better way of plumbing through the
411 // GrDirectContext
412 compositor.SetBackingStoreProducer(
413 std::make_unique<EmbedderTestBackingStoreProducer>(
414 compositor.GetGrContext(), type, software_pixfmt));
415}
void SetBackingStoreProducer(std::unique_ptr< EmbedderTestBackingStoreProducer > backingstore_producer)

◆ SetRenderTaskRunner()

void flutter::testing::EmbedderConfigBuilder::SetRenderTaskRunner ( const FlutterTaskRunnerDescription runner)

Definition at line 343 of file embedder_config_builder.cc.

344 {
345 if (runner == nullptr) {
346 return;
347 }
348
349 custom_task_runners_.render_task_runner = runner;
350 project_args_.custom_task_runners = &custom_task_runners_;
351}
const FlutterTaskRunnerDescription * render_task_runner
Definition: embedder.h:1601

◆ SetSemanticsCallbackHooks()

void flutter::testing::EmbedderConfigBuilder::SetSemanticsCallbackHooks ( )

Definition at line 260 of file embedder_config_builder.cc.

260 {
261 project_args_.update_semantics_callback2 =
263 project_args_.update_semantics_callback =
265 project_args_.update_semantics_node_callback =
269}
FlutterUpdateSemanticsNodeCallback GetUpdateSemanticsNodeCallbackHook()
FlutterUpdateSemanticsCustomActionCallback GetUpdateSemanticsCustomActionCallbackHook()
FlutterUpdateSemanticsCallback2 GetUpdateSemanticsCallback2Hook()
FlutterUpdateSemanticsCallback GetUpdateSemanticsCallbackHook()
FlutterUpdateSemanticsCallback update_semantics_callback
Definition: embedder.h:2419
FlutterUpdateSemanticsCallback2 update_semantics_callback2
Definition: embedder.h:2431
FlutterUpdateSemanticsCustomActionCallback update_semantics_custom_action_callback
Definition: embedder.h:2267
FlutterUpdateSemanticsNodeCallback update_semantics_node_callback
Definition: embedder.h:2246

◆ SetSnapshots()

void flutter::testing::EmbedderConfigBuilder::SetSnapshots ( )

Definition at line 229 of file embedder_config_builder.cc.

229 {
230 if (auto mapping = context_.GetVMSnapshotData()) {
231 project_args_.vm_snapshot_data = mapping->GetMapping();
232 project_args_.vm_snapshot_data_size = mapping->GetSize();
233 }
234
235 if (auto mapping = context_.GetVMSnapshotInstructions()) {
236 project_args_.vm_snapshot_instructions = mapping->GetMapping();
237 project_args_.vm_snapshot_instructions_size = mapping->GetSize();
238 }
239
240 if (auto mapping = context_.GetIsolateSnapshotData()) {
241 project_args_.isolate_snapshot_data = mapping->GetMapping();
242 project_args_.isolate_snapshot_data_size = mapping->GetSize();
243 }
244
245 if (auto mapping = context_.GetIsolateSnapshotInstructions()) {
246 project_args_.isolate_snapshot_instructions = mapping->GetMapping();
247 project_args_.isolate_snapshot_instructions_size = mapping->GetSize();
248 }
249}
const fml::Mapping * GetIsolateSnapshotData() const
const fml::Mapping * GetVMSnapshotInstructions() const
const fml::Mapping * GetIsolateSnapshotInstructions() const
const fml::Mapping * GetVMSnapshotData() const
const uint8_t * isolate_snapshot_data
Definition: embedder.h:2213
const uint8_t * vm_snapshot_data
Definition: embedder.h:2197
size_t isolate_snapshot_instructions_size
Definition: embedder.h:2224
const uint8_t * vm_snapshot_instructions
Definition: embedder.h:2205
size_t isolate_snapshot_data_size
Definition: embedder.h:2216
size_t vm_snapshot_instructions_size
Definition: embedder.h:2208
size_t vm_snapshot_data_size
Definition: embedder.h:2200
const uint8_t * isolate_snapshot_instructions
Definition: embedder.h:2221

◆ SetSoftwareRendererConfig()

void flutter::testing::EmbedderConfigBuilder::SetSoftwareRendererConfig ( SkISize  surface_size = SkISize::Make(1, 1))

Definition at line 138 of file embedder_config_builder.cc.

138 {
139 renderer_config_.type = FlutterRendererType::kSoftware;
140 renderer_config_.software = software_renderer_config_;
141 context_.SetupSurface(surface_size);
142}
@ kSoftware
Definition: embedder.h:81
FlutterSoftwareRendererConfig software
Definition: embedder.h:830

◆ SetupVsyncCallback()

void flutter::testing::EmbedderConfigBuilder::SetupVsyncCallback ( )

Definition at line 332 of file embedder_config_builder.cc.

332 {
333 project_args_.vsync_callback = [](void* user_data, intptr_t baton) {
334 auto context = reinterpret_cast<EmbedderTestContext*>(user_data);
335 context->RunVsyncCallback(baton);
336 };
337}
VsyncCallback vsync_callback
Definition: embedder.h:2289

◆ SetVulkanRendererConfig()

void flutter::testing::EmbedderConfigBuilder::SetVulkanRendererConfig ( SkISize  surface_size,
std::optional< FlutterVulkanInstanceProcAddressCallback instance_proc_address_callback = {} 
)

Definition at line 209 of file embedder_config_builder.cc.

212 {
213#ifdef SHELL_ENABLE_VULKAN
214 renderer_config_.type = FlutterRendererType::kVulkan;
215 FlutterVulkanRendererConfig vulkan_renderer_config = vulkan_renderer_config_;
216 if (instance_proc_address_callback.has_value()) {
217 vulkan_renderer_config.get_instance_proc_address_callback =
218 instance_proc_address_callback.value();
219 }
220 renderer_config_.vulkan = vulkan_renderer_config;
221 context_.SetupSurface(surface_size);
222#endif
223}
@ kVulkan
Definition: embedder.h:86
FlutterVulkanRendererConfig vulkan
Definition: embedder.h:832
FlutterVulkanInstanceProcAddressCallback get_instance_proc_address_callback
Definition: embedder.h:802

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