Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | Friends | List of all members
flutter::testing::EmbedderTestContextVulkan Class Reference

#include <embedder_test_context_vulkan.h>

Inheritance diagram for flutter::testing::EmbedderTestContextVulkan:
flutter::testing::EmbedderTestContext

Public Member Functions

 EmbedderTestContextVulkan (std::string assets_path="")
 
 ~EmbedderTestContextVulkan () override
 
EmbedderTestContextType GetContextType () const override
 
size_t GetSurfacePresentCount () const override
 
void SetupCompositor () override
 
VkImage GetNextImage (const SkISize &size)
 
bool PresentImage (VkImage 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 (SkMatrix matrix)
 
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)
 
std::future< sk_sp< SkImage > > GetNextSceneImage ()
 
EmbedderTestCompositorGetCompositor ()
 
virtual size_t GetSurfacePresentCount () const =0
 
virtual EmbedderTestContextType GetContextType () const =0
 
void SetVsyncCallback (std::function< void(intptr_t)> callback)
 
void RunVsyncCallback (intptr_t baton)
 

Static Public Member Functions

static void * InstanceProcAddr (void *user_data, FlutterVulkanInstanceHandle instance, const char *name)
 

Friends

class EmbedderConfigBuilder
 

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 ()
 
void SetupAOTMappingsIfNecessary ()
 
void SetupAOTDataIfNecessary ()
 
virtual void SetupCompositor ()=0
 
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)
 
virtual void SetupSurface (SkISize surface_size)=0
 
 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_
 
SemanticsUpdateCallback2 update_semantics_callback2_
 
SemanticsUpdateCallback update_semantics_callback_
 
SemanticsNodeCallback update_semantics_node_callback_
 
SemanticsActionCallback update_semantics_custom_action_callback_
 
ChannelUpdateCallback channel_update_callback_
 
std::function< void(const FlutterPlatformMessage *)> platform_message_callback_
 
LogMessageCallback log_message_callback_
 
std::unique_ptr< EmbedderTestCompositorcompositor_
 
NextSceneCallback next_scene_callback_
 
SkMatrix root_surface_transformation_
 
std::function< void(intptr_t)> vsync_callback_ = nullptr
 

Detailed Description

Definition at line 17 of file embedder_test_context_vulkan.h.

Constructor & Destructor Documentation

◆ EmbedderTestContextVulkan()

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

Definition at line 21 of file embedder_test_context_vulkan.cc.

22 : EmbedderTestContext(std::move(assets_path)), surface_() {
23 vulkan_context_ = fml::MakeRefCounted<TestVulkanContext>();
24}
EmbedderTestContext(std::string assets_path="")

◆ ~EmbedderTestContextVulkan()

flutter::testing::EmbedderTestContextVulkan::~EmbedderTestContextVulkan ( )
override

Definition at line 26 of file embedder_test_context_vulkan.cc.

26{}

Member Function Documentation

◆ GetContextType()

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

◆ GetNextImage()

VkImage flutter::testing::EmbedderTestContextVulkan::GetNextImage ( const SkISize size)

Definition at line 38 of file embedder_test_context_vulkan.cc.

38 {
39 return surface_->GetImage();
40}

◆ GetSurfacePresentCount()

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

Implements flutter::testing::EmbedderTestContext.

Definition at line 34 of file embedder_test_context_vulkan.cc.

34 {
35 return present_count_;
36}

◆ InstanceProcAddr()

void * flutter::testing::EmbedderTestContextVulkan::InstanceProcAddr ( void *  user_data,
FlutterVulkanInstanceHandle  instance,
const char *  name 
)
static

Definition at line 61 of file embedder_test_context_vulkan.cc.

64 {
65 auto proc_addr = reinterpret_cast<EmbedderTestContextVulkan*>(user_data)
66 ->vulkan_context_->vk_->GetInstanceProcAddr(
67 reinterpret_cast<VkInstance>(instance), name);
68 return reinterpret_cast<void*>(proc_addr);
69}
VkInstance instance
Definition: main.cc:48
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32
void * user_data

◆ PresentImage()

bool flutter::testing::EmbedderTestContextVulkan::PresentImage ( VkImage  image)

Definition at line 42 of file embedder_test_context_vulkan.cc.

42 {
44 [&]() { return surface_->GetSurfaceSnapshot(); });
45 present_count_++;
46 return true;
47}
void FireRootSurfacePresentCallbackIfPresent(const std::function< sk_sp< SkImage >(void)> &image_callback)

◆ SetupCompositor()

void flutter::testing::EmbedderTestContextVulkan::SetupCompositor ( )
overridevirtual

Implements flutter::testing::EmbedderTestContext.

Definition at line 53 of file embedder_test_context_vulkan.cc.

53 {
54 FML_CHECK(!compositor_) << "Already set up a compositor in this context.";
55 FML_CHECK(surface_)
56 << "Set up the Vulkan surface before setting up a compositor.";
57 compositor_ = std::make_unique<EmbedderTestCompositorVulkan>(
58 surface_size_, vulkan_context_->GetGrDirectContext());
59}
std::unique_ptr< EmbedderTestCompositor > compositor_
#define FML_CHECK(condition)
Definition: logging.h:85

Friends And Related Function Documentation

◆ EmbedderConfigBuilder

friend class EmbedderConfigBuilder
friend

Definition at line 48 of file embedder_test_context_vulkan.h.


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