Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | Friends | List of all members
impeller::AHBSwapchainVK Class Referencefinal

The implementation of a swapchain that uses hardware buffers presented to a given surface control on Android. More...

#include <ahb_swapchain_vk.h>

Inheritance diagram for impeller::AHBSwapchainVK:
impeller::SwapchainVK

Public Member Functions

 ~AHBSwapchainVK () override
 
 AHBSwapchainVK (const AHBSwapchainVK &)=delete
 
AHBSwapchainVKoperator= (const AHBSwapchainVK &)=delete
 
bool IsValid () const override
 
std::unique_ptr< SurfaceAcquireNextDrawable () override
 
vk::Format GetSurfaceFormat () const override
 
void UpdateSurfaceSize (const ISize &size) override
 Mark the current swapchain configuration as dirty, forcing it to be recreated on the next frame. More...
 
- Public Member Functions inherited from impeller::SwapchainVK
virtual ~SwapchainVK ()
 
 SwapchainVK (const SwapchainVK &)=delete
 
SwapchainVKoperator= (const SwapchainVK &)=delete
 
virtual bool IsValid () const =0
 
virtual std::unique_ptr< SurfaceAcquireNextDrawable ()=0
 
virtual vk::Format GetSurfaceFormat () const =0
 
virtual void UpdateSurfaceSize (const ISize &size)=0
 Mark the current swapchain configuration as dirty, forcing it to be recreated on the next frame. More...
 

Static Public Member Functions

static bool IsAvailableOnPlatform ()
 
- Static Public Member Functions inherited from impeller::SwapchainVK
static std::shared_ptr< SwapchainVKCreate (const std::shared_ptr< Context > &context, vk::UniqueSurfaceKHR surface, const ISize &size, bool enable_msaa=true)
 

Friends

class SwapchainVK
 

Additional Inherited Members

- Protected Member Functions inherited from impeller::SwapchainVK
 SwapchainVK ()
 

Detailed Description

The implementation of a swapchain that uses hardware buffers presented to a given surface control on Android.

Warning
This swapchain implementation is not available on all Android versions supported by Flutter. Perform the IsAvailableOnPlatform check and fallback to KHR swapchains if this type of swapchain cannot be created. The available building blocks for these kinds of swapchains are only available on Android API levels >= 29.

Definition at line 26 of file ahb_swapchain_vk.h.

Constructor & Destructor Documentation

◆ ~AHBSwapchainVK()

impeller::AHBSwapchainVK::~AHBSwapchainVK ( )
overridedefault

◆ AHBSwapchainVK()

impeller::AHBSwapchainVK::AHBSwapchainVK ( const AHBSwapchainVK )
delete

Member Function Documentation

◆ AcquireNextDrawable()

std::unique_ptr< Surface > impeller::AHBSwapchainVK::AcquireNextDrawable ( )
overridevirtual

Implements impeller::SwapchainVK.

Definition at line 53 of file ahb_swapchain_vk.cc.

53 {
54 if (!IsValid()) {
55 return nullptr;
56 }
57
58 TRACE_EVENT0("impeller", __FUNCTION__);
59 return impl_->AcquireNextDrawable();
60}
bool IsValid() const override
#define TRACE_EVENT0(category_group, name)
Definition: trace_event.h:131

◆ GetSurfaceFormat()

vk::Format impeller::AHBSwapchainVK::GetSurfaceFormat ( ) const
overridevirtual

Implements impeller::SwapchainVK.

Definition at line 63 of file ahb_swapchain_vk.cc.

63 {
64 return IsValid()
65 ? ToVKImageFormat(ToPixelFormat(impl_->GetDescriptor().format))
66 : vk::Format::eUndefined;
67}
constexpr vk::Format ToVKImageFormat(PixelFormat format)
Definition: formats_vk.h:133
static PixelFormat ToPixelFormat(AHardwareBuffer_Format format)
vk
Definition: malisc.py:42
def Format(template, **parameters)
Definition: emitter.py:13

◆ IsAvailableOnPlatform()

bool impeller::AHBSwapchainVK::IsAvailableOnPlatform ( )
static

◆ IsValid()

bool impeller::AHBSwapchainVK::IsValid ( ) const
overridevirtual

Implements impeller::SwapchainVK.

Definition at line 48 of file ahb_swapchain_vk.cc.

48 {
49 return impl_ ? impl_->IsValid() : false;
50}

◆ operator=()

AHBSwapchainVK & impeller::AHBSwapchainVK::operator= ( const AHBSwapchainVK )
delete

◆ UpdateSurfaceSize()

void impeller::AHBSwapchainVK::UpdateSurfaceSize ( const ISize size)
overridevirtual

Mark the current swapchain configuration as dirty, forcing it to be recreated on the next frame.

Implements impeller::SwapchainVK.

Definition at line 70 of file ahb_swapchain_vk.cc.

70 {
71 if (impl_ && impl_->GetSize() == size) {
72 return;
73 }
74 TRACE_EVENT0("impeller", __FUNCTION__);
75 auto impl = AHBSwapchainImplVK::Create(context_, //
76 surface_control_, //
77 size, //
78 enable_msaa_, //
79 swapchain_image_count_ //
80 );
81 if (!impl || !impl->IsValid()) {
82 VALIDATION_LOG << "Could not resize swapchain to size: " << size;
83 return;
84 }
85 impl_ = std::move(impl);
86}
static std::shared_ptr< AHBSwapchainImplVK > Create(const std::weak_ptr< Context > &context, std::weak_ptr< android::SurfaceControl > surface_control, const ISize &size, bool enable_msaa, size_t swapchain_image_count)
Create a swapchain of a specific size whose images will be presented to the provided surface control.
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259
#define VALIDATION_LOG
Definition: validation.h:73

Friends And Related Function Documentation

◆ SwapchainVK

friend class SwapchainVK
friend

Definition at line 50 of file ahb_swapchain_vk.h.


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