Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
flutter::testing::DlSurfaceProviderImpeller Class Referenceabstract

#include <dl_test_surface_provider_impeller.h>

Inheritance diagram for flutter::testing::DlSurfaceProviderImpeller:
flutter::testing::DlSurfaceProvider flutter::testing::DlSurfaceProviderImpellerMetal flutter::testing::DlSurfaceProviderImpellerMetalSDF

Public Member Functions

virtual ~DlSurfaceProviderImpeller ()=default
 
bool InitializeSurface (size_t width, size_t height, PixelFormat format) override
 
std::shared_ptr< DlSurfaceInstanceGetPrimarySurface () const override
 
std::unique_ptr< DlSurfaceInstanceMakeOffscreenSurface (size_t width, size_t height, PixelFormat format) const override
 
bool SupportsPixelFormat (PixelFormat format) const override
 
bool TargetsImpeller () const override
 
- Public Member Functions inherited from flutter::testing::DlSurfaceProvider
virtual ~DlSurfaceProvider ()=default
 
virtual const std::string GetBackendName () const =0
 
virtual BackendType GetBackendType () const =0
 

Static Public Member Functions

static std::unique_ptr< DlSurfaceInstanceImpellerMakeOffscreenSurface (std::shared_ptr< impeller::Context > context, size_t width, size_t height, PixelFormat format)
 
- Static Public Member Functions inherited from flutter::testing::DlSurfaceProvider
static SkImageInfo MakeInfo (PixelFormat format, int w, int h)
 
static std::optional< BackendTypeNameToBackend (const std::string &name)
 
static std::string BackendName (BackendType type)
 
static std::unique_ptr< DlSurfaceProviderCreate (BackendType backend_type)
 

Protected Member Functions

 DlSurfaceProviderImpeller ()
 
virtual impeller::PlaygroundImplGetPlayground () const =0
 
- Protected Member Functions inherited from flutter::testing::DlSurfaceProvider
 DlSurfaceProvider ()=default
 

Static Protected Member Functions

static std::unique_ptr< impeller::PlaygroundImplMakePlayground (impeller::PlaygroundBackend backend, const impeller::PlaygroundSwitches &switches)
 

Additional Inherited Members

- Public Types inherited from flutter::testing::DlSurfaceProvider
enum  PixelFormat {
  kN32Premul ,
  k565
}
 
enum class  BackendType {
  kSkiaSoftware ,
  kSkiaOpenGL ,
  kSkiaMetal ,
  kImpellerMetal ,
  kImpellerMetalSDF
}
 

Detailed Description

Definition at line 15 of file dl_test_surface_provider_impeller.h.

Constructor & Destructor Documentation

◆ ~DlSurfaceProviderImpeller()

virtual flutter::testing::DlSurfaceProviderImpeller::~DlSurfaceProviderImpeller ( )
virtualdefault

◆ DlSurfaceProviderImpeller()

flutter::testing::DlSurfaceProviderImpeller::DlSurfaceProviderImpeller ( )
protected

Member Function Documentation

◆ GetPlayground()

virtual impeller::PlaygroundImpl * flutter::testing::DlSurfaceProviderImpeller::GetPlayground ( ) const
protectedpure virtual

◆ GetPrimarySurface()

std::shared_ptr< DlSurfaceInstance > flutter::testing::DlSurfaceProviderImpeller::GetPrimarySurface ( ) const
overridevirtual

Implements flutter::testing::DlSurfaceProvider.

Definition at line 31 of file dl_test_surface_provider_impeller.cc.

31 {
32 return primary_;
33}

◆ InitializeSurface()

bool flutter::testing::DlSurfaceProviderImpeller::InitializeSurface ( size_t  width,
size_t  height,
PixelFormat  format 
)
overridevirtual

Implements flutter::testing::DlSurfaceProvider.

Definition at line 19 of file dl_test_surface_provider_impeller.cc.

21 {
22 if (format != kN32Premul) {
23 // The caller didn't check our supported formats.
24 return false;
25 }
26 primary_ = MakeOffscreenSurface(width, height, format);
27 return true;
28}
std::unique_ptr< DlSurfaceInstance > MakeOffscreenSurface(size_t width, size_t height, PixelFormat format) const override
int32_t height
int32_t width

References format, height, flutter::testing::DlSurfaceProvider::kN32Premul, MakeOffscreenSurface(), and width.

◆ MakeOffscreenSurface() [1/2]

std::unique_ptr< DlSurfaceInstance > flutter::testing::DlSurfaceProviderImpeller::MakeOffscreenSurface ( size_t  width,
size_t  height,
PixelFormat  format 
) const
overridevirtual

◆ MakeOffscreenSurface() [2/2]

std::unique_ptr< DlSurfaceInstanceImpeller > flutter::testing::DlSurfaceProviderImpeller::MakeOffscreenSurface ( std::shared_ptr< impeller::Context context,
size_t  width,
size_t  height,
PixelFormat  format 
)
static

Definition at line 44 of file dl_test_surface_provider_impeller.cc.

48 {
49 if (format != kN32Premul) {
50 // The caller didn't check our supported formats.
51 return nullptr;
52 }
54 int mip_count = 1;
55
56 impeller::RenderTargetAllocator render_target_allocator =
57 impeller::RenderTargetAllocator(context->GetResourceAllocator());
58 std::shared_ptr<impeller::RenderTarget> target;
59 if (context->GetCapabilities()->SupportsOffscreenMSAA()) {
60 target = std::make_shared<impeller::RenderTarget>(
61 render_target_allocator.CreateOffscreenMSAA(
62 *context, // context
63 size, // size
64 /*mip_count=*/mip_count,
65 "Picture Snapshot MSAA", // label
67 kDefaultColorAttachmentConfigMSAA // color_attachment_config
68 ));
69 } else {
70 target = std::make_shared<impeller::RenderTarget>(
71 render_target_allocator.CreateOffscreen(
72 *context, // context
73 size, // size
74 /*mip_count=*/mip_count,
75 "Picture Snapshot", // label
77 kDefaultColorAttachmentConfig // color_attachment_config
78 ));
79 }
80 if (!target->IsValid()) {
81 return nullptr;
82 }
83 return std::make_unique<DlSurfaceInstanceImpeller>(std::move(context),
84 target);
85}
a wrapper around the impeller [Allocator] instance that can be used to provide caching of allocated r...
virtual RenderTarget CreateOffscreenMSAA(const Context &context, ISize size, int mip_count, std::string_view label="Offscreen MSAA", RenderTarget::AttachmentConfigMSAA color_attachment_config=RenderTarget::kDefaultColorAttachmentConfigMSAA, std::optional< RenderTarget::AttachmentConfig > stencil_attachment_config=RenderTarget::kDefaultStencilAttachmentConfig, const std::shared_ptr< Texture > &existing_color_msaa_texture=nullptr, const std::shared_ptr< Texture > &existing_color_resolve_texture=nullptr, const std::shared_ptr< Texture > &existing_depth_stencil_texture=nullptr, std::optional< PixelFormat > target_pixel_format=std::nullopt)
virtual RenderTarget CreateOffscreen(const Context &context, ISize size, int mip_count, std::string_view label="Offscreen", RenderTarget::AttachmentConfig color_attachment_config=RenderTarget::kDefaultColorAttachmentConfig, std::optional< RenderTarget::AttachmentConfig > stencil_attachment_config=RenderTarget::kDefaultStencilAttachmentConfig, const std::shared_ptr< Texture > &existing_color_texture=nullptr, const std::shared_ptr< Texture > &existing_depth_stencil_texture=nullptr, std::optional< PixelFormat > target_pixel_format=std::nullopt)
uint32_t * target
it will be possible to load the file into Perfetto s trace viewer use test Running tests that layout and measure text will not yield consistent results across various platforms Enabling this option will make font resolution default to the Ahem test font on all 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

References impeller::RenderTargetAllocator::CreateOffscreen(), impeller::RenderTargetAllocator::CreateOffscreenMSAA(), format, height, flutter::testing::DlSurfaceProvider::kN32Premul, flutter::size, target, and width.

◆ MakePlayground()

std::unique_ptr< impeller::PlaygroundImpl > flutter::testing::DlSurfaceProviderImpeller::MakePlayground ( impeller::PlaygroundBackend  backend,
const impeller::PlaygroundSwitches switches 
)
staticprotected

Definition at line 13 of file dl_test_surface_provider_impeller.cc.

15 {
16 return impeller::PlaygroundImpl::Create(backend, switches);
17}
static std::unique_ptr< PlaygroundImpl > Create(PlaygroundBackend backend, PlaygroundSwitches switches)

References impeller::PlaygroundImpl::Create().

Referenced by flutter::testing::DlSurfaceProviderImpellerMetal::GetPlayground(), and flutter::testing::DlSurfaceProviderImpellerMetalSDF::GetPlayground().

◆ SupportsPixelFormat()

bool flutter::testing::DlSurfaceProviderImpeller::SupportsPixelFormat ( PixelFormat  format) const
overridevirtual

Implements flutter::testing::DlSurfaceProvider.

Definition at line 87 of file dl_test_surface_provider_impeller.cc.

87 {
88 return format == kN32Premul;
89}
uint32_t uint32_t * format

References format, and flutter::testing::DlSurfaceProvider::kN32Premul.

◆ TargetsImpeller()

bool flutter::testing::DlSurfaceProviderImpeller::TargetsImpeller ( ) const
overridevirtual

Implements flutter::testing::DlSurfaceProvider.

Definition at line 91 of file dl_test_surface_provider_impeller.cc.

91 {
92 return true;
93}

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