#include <surface_mtl.h>
Public Member Functions | |
| ~SurfaceMTL () override | |
| id< MTLDrawable > | drawable () const |
| IRect | coverage () const |
| void | PresentWithTransaction (bool present_with_transaction) |
| bool | PreparePresent () const |
| Perform the final blit and trigger end of frame workloads. More... | |
| bool | Present () const override |
| void | SetFrameBoundary (bool frame_boundary) |
Public Member Functions inherited from impeller::Surface | |
| Surface () | |
| Surface (const RenderTarget &target_desc) | |
| virtual | ~Surface () |
| const ISize & | GetSize () const |
| bool | IsValid () const |
| const RenderTarget & | GetRenderTarget () const |
Static Public Member Functions | |
| static id< CAMetalDrawable > | GetMetalDrawableAndValidate (const std::shared_ptr< Context > &context, CAMetalLayer *layer) |
| Wraps the current drawable of the given Metal layer to create a surface Impeller can render to. The surface must be created as late as possible and discarded immediately after rendering to it. More... | |
| static std::unique_ptr< SurfaceMTL > | MakeFromMetalLayerDrawable (const std::shared_ptr< Context > &context, id< CAMetalDrawable > drawable, const std::shared_ptr< SwapchainTransientsMTL > &transients, std::optional< IRect > clip_rect=std::nullopt) |
| static std::unique_ptr< SurfaceMTL > | MakeFromTexture (const std::shared_ptr< Context > &context, id< MTLTexture > texture, const std::shared_ptr< SwapchainTransientsMTL > &transients, std::optional< IRect > clip_rect, id< CAMetalDrawable > drawable=nil) |
Definition at line 18 of file surface_mtl.h.
|
overridedefault |
| IRect impeller::SurfaceMTL::coverage | ( | ) | const |
Definition at line 212 of file surface_mtl.mm.
References impeller::TRect< T >::MakeSize().
|
inline |
Definition at line 59 of file surface_mtl.h.
Referenced by MakeFromMetalLayerDrawable(), MakeFromTexture(), and Present().
|
static |
Wraps the current drawable of the given Metal layer to create a surface Impeller can render to. The surface must be created as late as possible and discarded immediately after rendering to it.
| [in] | context | The context |
| [in] | layer | The layer whose current drawable to wrap to create a surface. |
Definition at line 29 of file surface_mtl.mm.
References VALIDATION_LOG.
|
static |
Definition at line 113 of file surface_mtl.mm.
References drawable(), and MakeFromTexture().
|
static |
Definition at line 122 of file surface_mtl.mm.
References drawable(), impeller::TextureMTL::Wrapper(), and impeller::WrapTextureWithRenderTarget().
Referenced by MakeFromMetalLayerDrawable().
| bool impeller::SurfaceMTL::PreparePresent | ( | ) | const |
Perform the final blit and trigger end of frame workloads.
Definition at line 216 of file surface_mtl.mm.
References impeller::BackendCast< ContextMTL, Context >::Cast(), impeller::ContextMTL::CreateCommandBuffer(), and VALIDATION_LOG.
Referenced by Present().
|
overridevirtual |
Reimplemented from impeller::Surface.
Definition at line 258 of file surface_mtl.mm.
References impeller::BackendCast< ContextMTL, Context >::Cast(), impeller::ContextMTL::CreateMTLCommandBuffer(), drawable(), and PreparePresent().
|
inline |
Mark this surface as presenting with a transaction.
If true, [Present] will block on the scheduling of a command buffer.
Definition at line 67 of file surface_mtl.h.
|
inline |
Definition at line 77 of file surface_mtl.h.