Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
flutter::SnapshotControllerImpeller Class Reference

#include <snapshot_controller_impeller.h>

Inheritance diagram for flutter::SnapshotControllerImpeller:
flutter::SnapshotController

Public Member Functions

 SnapshotControllerImpeller (const SnapshotController::Delegate &delegate)
 
void MakeRasterSnapshot (sk_sp< DisplayList > display_list, SkISize picture_size, std::function< void(const sk_sp< DlImage > &)> callback) override
 
sk_sp< DlImageMakeRasterSnapshotSync (sk_sp< DisplayList > display_list, SkISize picture_size) override
 
sk_sp< SkImageConvertToRasterImage (sk_sp< SkImage > image) override
 
void CacheRuntimeStage (const std::shared_ptr< impeller::RuntimeStage > &runtime_stage) override
 
- Public Member Functions inherited from flutter::SnapshotController
virtual ~SnapshotController ()=default
 
virtual void MakeRasterSnapshot (sk_sp< DisplayList > display_list, SkISize picture_size, std::function< void(const sk_sp< DlImage > &)> callback)=0
 
virtual sk_sp< DlImageMakeRasterSnapshotSync (sk_sp< DisplayList > display_list, SkISize picture_size)=0
 
virtual sk_sp< SkImageConvertToRasterImage (sk_sp< SkImage > image)=0
 
virtual void CacheRuntimeStage (const std::shared_ptr< impeller::RuntimeStage > &runtime_stage)=0
 

Additional Inherited Members

- Static Public Member Functions inherited from flutter::SnapshotController
static std::unique_ptr< SnapshotControllerMake (const Delegate &delegate, const Settings &settings)
 
- Protected Member Functions inherited from flutter::SnapshotController
 SnapshotController (const Delegate &delegate)
 
const DelegateGetDelegate ()
 

Detailed Description

Definition at line 13 of file snapshot_controller_impeller.h.

Constructor & Destructor Documentation

◆ SnapshotControllerImpeller()

flutter::SnapshotControllerImpeller::SnapshotControllerImpeller ( const SnapshotController::Delegate delegate)
inlineexplicit

Definition at line 15 of file snapshot_controller_impeller.h.

17 : SnapshotController(delegate) {}
SnapshotController(const Delegate &delegate)

Member Function Documentation

◆ CacheRuntimeStage()

void flutter::SnapshotControllerImpeller::CacheRuntimeStage ( const std::shared_ptr< impeller::RuntimeStage > &  runtime_stage)
overridevirtual

Implements flutter::SnapshotController.

Definition at line 115 of file snapshot_controller_impeller.cc.

116 {
117 impeller::RuntimeEffectContents runtime_effect;
118 runtime_effect.SetRuntimeStage(runtime_stage);
119 auto context = GetDelegate().GetAiksContext();
120 if (!context) {
121 return;
122 }
123 runtime_effect.BootstrapShader(context->GetContentContext());
124}
virtual std::shared_ptr< impeller::AiksContext > GetAiksContext() const =0
bool BootstrapShader(const ContentContext &renderer) const
Load the runtime effect and ensure a default PSO is initialized.
void SetRuntimeStage(std::shared_ptr< RuntimeStage > runtime_stage)

◆ ConvertToRasterImage()

sk_sp< SkImage > flutter::SnapshotControllerImpeller::ConvertToRasterImage ( sk_sp< SkImage image)
overridevirtual

Implements flutter::SnapshotController.

Definition at line 126 of file snapshot_controller_impeller.cc.

127 {
129}
#define FML_UNREACHABLE()
Definition: logging.h:109

◆ MakeRasterSnapshot()

void flutter::SnapshotControllerImpeller::MakeRasterSnapshot ( sk_sp< DisplayList display_list,
SkISize  picture_size,
std::function< void(const sk_sp< DlImage > &)>  callback 
)
overridevirtual

Implements flutter::SnapshotController.

Definition at line 78 of file snapshot_controller_impeller.cc.

81 {
83 std::shared_ptr<const fml::SyncSwitch> sync_switch =
85 sync_switch->Execute(
87 .SetIfTrue([&] {
88 std::shared_ptr<impeller::AiksContext> context =
90 if (context) {
91 context->GetContext()->StoreTaskForGPU(
92 [context, sync_switch, display_list = std::move(display_list),
93 picture_size, callback = std::move(callback)] {
94 callback(DoMakeRasterSnapshot(display_list, picture_size,
95 sync_switch, context));
96 });
97 } else {
98 callback(nullptr);
99 }
100 })
101 .SetIfFalse([&] {
102 callback(DoMakeRasterSnapshot(display_list, picture_size,
103 GetDelegate().GetAiksContext()));
104 }));
105}
virtual std::shared_ptr< const fml::SyncSwitch > GetIsGpuDisabledSyncSwitch() const =0
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
GAsyncResult * result
Represents the 2 code paths available when calling |SyncSwitch::Execute|.
Definition: sync_switch.h:35

◆ MakeRasterSnapshotSync()

sk_sp< DlImage > flutter::SnapshotControllerImpeller::MakeRasterSnapshotSync ( sk_sp< DisplayList display_list,
SkISize  picture_size 
)
overridevirtual

Implements flutter::SnapshotController.

Definition at line 107 of file snapshot_controller_impeller.cc.

109 {
110 return DoMakeRasterSnapshot(display_list, picture_size,
111 GetDelegate().GetIsGpuDisabledSyncSwitch(),
112 GetDelegate().GetAiksContext());
113}

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