Flutter Engine
 
Loading...
Searching...
No Matches
flutter::testing::EmbedderTestContextSoftware Class Reference

#include <embedder_test_context_software.h>

Inheritance diagram for flutter::testing::EmbedderTestContextSoftware:
flutter::testing::EmbedderTestContext

Public Member Functions

 EmbedderTestContextSoftware (std::string assets_path="")
 
 ~EmbedderTestContextSoftware () override
 
EmbedderTestContextType GetContextType () const override
 
size_t GetSurfacePresentCount () const override
 
bool Present (const sk_sp< SkImage > &image)
 
- Public Member Functions inherited from flutter::testing::EmbedderTestContext
 EmbedderTestContext (std::string assets_path="")
 
virtual ~EmbedderTestContext ()
 
const std::string & GetAssetsPath () const
 
const fml::MappingGetVMSnapshotData () const
 
const fml::MappingGetVMSnapshotInstructions () const
 
const fml::MappingGetIsolateSnapshotData () const
 
const fml::MappingGetIsolateSnapshotInstructions () const
 
FlutterEngineAOTData GetAOTData () const
 
void SetRootSurfaceTransformation (DlMatrix matrix)
 
FlutterRendererConfigGetRendererConfig ()
 
void AddIsolateCreateCallback (const fml::closure &closure)
 
void SetSemanticsUpdateCallback2 (SemanticsUpdateCallback2 update_semantics)
 
void SetSemanticsUpdateCallback (SemanticsUpdateCallback update_semantics)
 
void AddNativeCallback (const char *name, Dart_NativeFunction function)
 
void SetSemanticsNodeCallback (SemanticsNodeCallback update_semantics_node)
 
void SetSemanticsCustomActionCallback (SemanticsActionCallback semantics_custom_action)
 
void SetPlatformMessageCallback (const std::function< void(const FlutterPlatformMessage *)> &callback)
 
void SetLogMessageCallback (const LogMessageCallback &log_message_callback)
 
void SetChannelUpdateCallback (const ChannelUpdateCallback &callback)
 
void SetViewFocusChangeRequestCallback (const ViewFocusChangeRequestCallback &callback)
 
std::future< sk_sp< SkImage > > GetNextSceneImage ()
 
EmbedderTestCompositorGetCompositor ()
 
void SetVsyncCallback (std::function< void(intptr_t)> callback)
 
void RunVsyncCallback (intptr_t baton)
 

Additional Inherited Members

- Protected Types inherited from flutter::testing::EmbedderTestContext
using NextSceneCallback = std::function< void(sk_sp< SkImage > image)>
 
- Protected Member Functions inherited from flutter::testing::EmbedderTestContext
FlutterUpdateSemanticsCallback2 GetUpdateSemanticsCallback2Hook ()
 
FlutterUpdateSemanticsCallback GetUpdateSemanticsCallbackHook ()
 
FlutterUpdateSemanticsNodeCallback GetUpdateSemanticsNodeCallbackHook ()
 
FlutterUpdateSemanticsCustomActionCallback GetUpdateSemanticsCustomActionCallbackHook ()
 
FlutterChannelUpdateCallback GetChannelUpdateCallbackHook ()
 
FlutterViewFocusChangeRequestCallback GetViewFocusChangeRequestCallbackHook ()
 
void SetupAOTMappingsIfNecessary ()
 
void SetupAOTDataIfNecessary ()
 
void FireIsolateCreateCallbacks ()
 
void SetNativeResolver ()
 
FlutterTransformation GetRootSurfaceTransformation ()
 
void PlatformMessageCallback (const FlutterPlatformMessage *message)
 
void FireRootSurfacePresentCallbackIfPresent (const std::function< sk_sp< SkImage >(void)> &image_callback)
 
void SetNextSceneCallback (const NextSceneCallback &next_scene_callback)
 
 FML_DISALLOW_COPY_AND_ASSIGN (EmbedderTestContext)
 
- Static Protected Member Functions inherited from flutter::testing::EmbedderTestContext
static VoidCallback GetIsolateCreateCallbackHook ()
 
static FlutterLogMessageCallback GetLogMessageCallbackHook ()
 
static FlutterComputePlatformResolvedLocaleCallback GetComputePlatformResolvedLocaleCallbackHook ()
 
- Protected Attributes inherited from flutter::testing::EmbedderTestContext
std::string assets_path_
 
ELFAOTSymbols aot_symbols_
 
std::unique_ptr< fml::Mappingvm_snapshot_data_
 
std::unique_ptr< fml::Mappingvm_snapshot_instructions_
 
std::unique_ptr< fml::Mappingisolate_snapshot_data_
 
std::unique_ptr< fml::Mappingisolate_snapshot_instructions_
 
UniqueAOTData aot_data_
 
std::vector< fml::closureisolate_create_callbacks_
 
std::shared_ptr< TestDartNativeResolvernative_resolver_
 
FlutterRendererConfig renderer_config_ = {}
 
SemanticsUpdateCallback2 update_semantics_callback2_
 
SemanticsUpdateCallback update_semantics_callback_
 
SemanticsNodeCallback update_semantics_node_callback_
 
SemanticsActionCallback update_semantics_custom_action_callback_
 
ChannelUpdateCallback channel_update_callback_
 
ViewFocusChangeRequestCallback view_focus_change_request_callback_
 
std::function< void(const FlutterPlatformMessage *)> platform_message_callback_
 
LogMessageCallback log_message_callback_
 
std::unique_ptr< EmbedderTestCompositorcompositor_
 
NextSceneCallback next_scene_callback_
 
DlMatrix root_surface_transformation_
 
std::function< void(intptr_t)> vsync_callback_ = nullptr
 

Detailed Description

Definition at line 15 of file embedder_test_context_software.h.

Constructor & Destructor Documentation

◆ EmbedderTestContextSoftware()

flutter::testing::EmbedderTestContextSoftware::EmbedderTestContextSoftware ( std::string  assets_path = "")
explicit

Definition at line 21 of file embedder_test_context_software.cc.

23 : EmbedderTestContext(std::move(assets_path)) {
27 .surface_present_callback =
28 [](void* context, const void* allocation, size_t row_bytes,
29 size_t height) {
30 auto image_info = SkImageInfo::MakeN32Premul(
31 SkISize::Make(row_bytes / 4, height));
32 SkBitmap bitmap;
33 if (!bitmap.installPixels(image_info, const_cast<void*>(allocation),
34 row_bytes)) {
35 FML_LOG(ERROR) << "Could not copy pixels for the software "
36 "composition from the engine.";
37 return false;
38 }
39 bitmap.setImmutable();
40 return reinterpret_cast<EmbedderTestContextSoftware*>(context)
41 ->Present(SkImages::RasterFromBitmap(bitmap));
42 },
43 };
44}
EmbedderTestContext(std::string assets_path="")
@ kSoftware
Definition embedder.h:81
#define FML_LOG(severity)
Definition logging.h:101
int32_t height
FlutterSoftwareRendererConfig software
Definition embedder.h:1034
FlutterRendererType type
Definition embedder.h:1031
size_t struct_size
The size of this struct. Must be sizeof(FlutterSoftwareRendererConfig).
Definition embedder.h:1022

References FML_LOG, height, kSoftware, Present(), flutter::testing::EmbedderTestContext::renderer_config_, FlutterRendererConfig::software, FlutterSoftwareRendererConfig::struct_size, and FlutterRendererConfig::type.

◆ ~EmbedderTestContextSoftware()

flutter::testing::EmbedderTestContextSoftware::~EmbedderTestContextSoftware ( )
overridedefault

Member Function Documentation

◆ GetContextType()

EmbedderTestContextType flutter::testing::EmbedderTestContextSoftware::GetContextType ( ) const
overridevirtual

◆ GetSurfacePresentCount()

size_t flutter::testing::EmbedderTestContextSoftware::GetSurfacePresentCount ( ) const
overridevirtual

Implements flutter::testing::EmbedderTestContext.

Definition at line 61 of file embedder_test_context_software.cc.

61 {
62 return software_surface_present_count_;
63}

◆ Present()

bool flutter::testing::EmbedderTestContextSoftware::Present ( const sk_sp< SkImage > &  image)

Definition at line 65 of file embedder_test_context_software.cc.

65 {
66 software_surface_present_count_++;
68 return true;
69}
void FireRootSurfacePresentCallbackIfPresent(const std::function< sk_sp< SkImage >(void)> &image_callback)
FlutterVulkanImage * image

References flutter::testing::EmbedderTestContext::FireRootSurfacePresentCallbackIfPresent(), and image.

Referenced by EmbedderTestContextSoftware().


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