Flutter Engine
flutter::IOSContextSoftware Class Referencefinal

#include <ios_context_software.h>

Inheritance diagram for flutter::IOSContextSoftware:
flutter::IOSContext

Public Member Functions

 IOSContextSoftware ()
 
 ~IOSContextSoftware ()
 
sk_sp< GrDirectContext > CreateResourceContext () override
 Create a resource context for use on the IO task runner. This resource context is used by Skia to upload texture to asynchronously and collect resources that are no longer needed on the render task runner. More...
 
std::unique_ptr< GLContextResultMakeCurrent () override
 When using client rendering APIs whose contexts need to be bound to a specific thread, the engine will call this method to give the on-screen context a chance to bind to the current thread. More...
 
std::unique_ptr< TextureCreateExternalTexture (int64_t texture_id, fml::scoped_nsobject< NSObject< FlutterTexture >> texture) override
 Creates an external texture proxy of the appropriate client rendering API. More...
 
- Public Member Functions inherited from flutter::IOSContext
virtual ~IOSContext ()
 Collects the context object. This must happen on the thread on which this object was created. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from flutter::IOSContext
static std::unique_ptr< IOSContextCreate (IOSRenderingAPI rendering_api)
 Create an iOS context object capable of creating the on-screen and off-screen GPU context for use by Skia. More...
 
- Protected Member Functions inherited from flutter::IOSContext
 IOSContext ()
 

Detailed Description

Definition at line 13 of file ios_context_software.h.

Constructor & Destructor Documentation

◆ IOSContextSoftware()

flutter::IOSContextSoftware::IOSContextSoftware ( )
default

◆ ~IOSContextSoftware()

flutter::IOSContextSoftware::~IOSContextSoftware ( )
default

Member Function Documentation

◆ CreateExternalTexture()

std::unique_ptr< Texture > flutter::IOSContextSoftware::CreateExternalTexture ( int64_t  texture_id,
fml::scoped_nsobject< NSObject< FlutterTexture >>  texture 
)
overridevirtual

Creates an external texture proxy of the appropriate client rendering API.

Parameters
[in]texture_idThe texture identifier
[in]textureThe texture
Returns
The texture proxy if the rendering backend supports embedder provided external textures.

Implements flutter::IOSContext.

Definition at line 26 of file ios_context_software.mm.

28  {
29  // Don't use FML for logging as it will contain engine specific details. This is a user facing
30  // message.
31  NSLog(@"Flutter: Attempted to composite external texture sources using the software backend. "
32  @"This backend is only used on simulators. This feature is only available on actual "
33  @"devices where OpenGL or Metal is used for rendering.");
34 
35  // Not supported in this backend.
36  return nullptr;
37 }

◆ CreateResourceContext()

sk_sp< GrDirectContext > flutter::IOSContextSoftware::CreateResourceContext ( )
overridevirtual

Create a resource context for use on the IO task runner. This resource context is used by Skia to upload texture to asynchronously and collect resources that are no longer needed on the render task runner.

Attention
Client rendering APIs for which a GrDirectContext cannot be realized (software rendering), this method will always return null.
Returns
A non-null Skia context on success. nullptr on failure.

Implements flutter::IOSContext.

Definition at line 15 of file ios_context_software.mm.

15  {
16  return nullptr;
17 }

◆ MakeCurrent()

std::unique_ptr< GLContextResult > flutter::IOSContextSoftware::MakeCurrent ( )
overridevirtual

When using client rendering APIs whose contexts need to be bound to a specific thread, the engine will call this method to give the on-screen context a chance to bind to the current thread.

Attention
Client rendering APIs that have no-concept of thread local bindings (anything that is not OpenGL) will always return true.
Client rendering APIs for which a GrDirectContext cannot be created (software rendering) will always return false.
This binds the on-screen context to the current thread. To bind the off-screen context to the thread, use the ResoruceMakeCurrent method instead.
Only one context may be bound to a thread at any given time. Making a binding on a thread, clears the old binding.
Returns
A GLContextResult that represents the result of the method. The GetResult() returns a bool that indicates If the on-screen context could be bound to the current thread.

Implements flutter::IOSContext.

Definition at line 20 of file ios_context_software.mm.

20  {
21  // This only makes sense for context that need to be bound to a specific thread.
22  return std::make_unique<GLContextDefaultResult>(false);
23 }

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