Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
impeller::ImpellerMetalCaptureManager Class Reference

Creates and manages a Metal capture scope that supports frame capture when using the FlutterMetalLayer backed drawable. More...

#include <context_mtl.h>

Public Member Functions

 ImpellerMetalCaptureManager (id< MTLDevice > device)
 Construct a new capture manager from the provided Metal device.
 
 ~ImpellerMetalCaptureManager ()=default
 
bool CaptureScopeActive () const
 
void StartCapture ()
 Begin a new capture scope, no-op if the scope has already started.
 
void FinishCapture ()
 End the current capture scope.
 

Detailed Description

Creates and manages a Metal capture scope that supports frame capture when using the FlutterMetalLayer backed drawable.

Definition at line 37 of file context_mtl.h.

Constructor & Destructor Documentation

◆ ImpellerMetalCaptureManager()

impeller::ImpellerMetalCaptureManager::ImpellerMetalCaptureManager ( id< MTLDevice >  device)
explicit

Construct a new capture manager from the provided Metal device.

Definition at line 530 of file context_mtl.mm.

530 {
531 current_capture_scope_ = [[MTLCaptureManager sharedCaptureManager]
532 newCaptureScopeWithDevice:device];
533 [current_capture_scope_ setLabel:@"Impeller Frame"];
534 [[MTLCaptureManager sharedCaptureManager]
535 setDefaultCaptureScope:current_capture_scope_];
536}
VkDevice device
Definition main.cc:69

References device.

◆ ~ImpellerMetalCaptureManager()

impeller::ImpellerMetalCaptureManager::~ImpellerMetalCaptureManager ( )
default

Member Function Documentation

◆ CaptureScopeActive()

bool impeller::ImpellerMetalCaptureManager::CaptureScopeActive ( ) const

Whether or not the Impeller capture scope is active.

This is distinct from whether or not there is a session recording the capture. That can be checked with [[MTLCaptureManager sharedCaptureManager] isCapturing].

Definition at line 538 of file context_mtl.mm.

538 {
539 return scope_active_;
540}

◆ FinishCapture()

void impeller::ImpellerMetalCaptureManager::FinishCapture ( )

End the current capture scope.

Definition at line 550 of file context_mtl.mm.

550 {
551 FML_DCHECK(scope_active_);
552 [current_capture_scope_ endScope];
553 scope_active_ = false;
554}
#define FML_DCHECK(condition)
Definition logging.h:122

References FML_DCHECK.

◆ StartCapture()

void impeller::ImpellerMetalCaptureManager::StartCapture ( )

Begin a new capture scope, no-op if the scope has already started.

Definition at line 542 of file context_mtl.mm.

542 {
543 if (scope_active_) {
544 return;
545 }
546 scope_active_ = true;
547 [current_capture_scope_ beginScope];
548}

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