Flutter Engine
FlutterEngine.mm File Reference
#import "flutter/shell/platform/darwin/macos/framework/Headers/FlutterEngine.h"
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterEngine_Internal.h"
#include <algorithm>
#include <vector>
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterDartProject_Internal.h"
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterExternalTextureGL.h"
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterViewController_Internal.h"
#import "flutter/shell/platform/embedder/embedder.h"

Go to the source code of this file.

Classes

class  FlutterEngineRegistrar
 

Functions

static FlutterLocale FlutterLocaleFromNSLocale (NSLocale *locale)
 
static bool OnMakeCurrent (FlutterEngine *engine)
 
static bool OnClearCurrent (FlutterEngine *engine)
 
static bool OnPresent (FlutterEngine *engine)
 
static uint32_t OnFBO (FlutterEngine *engine)
 
static bool OnMakeResourceCurrent (FlutterEngine *engine)
 
static void OnPlatformMessage (const FlutterPlatformMessage *message, FlutterEngine *engine)
 
static bool OnAcquireExternalTexture (FlutterEngine *engine, int64_t texture_identifier, size_t width, size_t height, FlutterOpenGLTexture *open_gl_texture)
 

Variables

FlutterEngine_flutterEngine
 
FlutterDartProject_project
 
NSOpenGLContext * _resourceContext
 
NSOpenGLContext * _mainOpenGLContext
 
NSMutableDictionary< NSString *, FlutterBinaryMessageHandler > * _messageHandlers
 
BOOL _allowHeadlessExecution
 
NSMutableDictionary< NSNumber *, FlutterExternalTextureGL * > * _textures
 
UniqueAotDataPtr _aotData
 

Function Documentation

◆ FlutterLocaleFromNSLocale()

static FlutterLocale FlutterLocaleFromNSLocale ( NSLocale *  locale)
static

Constructs and returns a FlutterLocale struct corresponding to |locale|, which must outlive the returned struct.

Definition at line 20 of file FlutterEngine.mm.

References FlutterLocale::country_code, FlutterEngineRegistrar::flutterEngine, FlutterEngineCollectAOTData(), FlutterLocale::language_code, FlutterLocale::script_code, FlutterLocale::struct_size, and FlutterLocale::variant_code.

20  {
21  FlutterLocale flutterLocale = {};
22  flutterLocale.struct_size = sizeof(FlutterLocale);
23  flutterLocale.language_code = [[locale objectForKey:NSLocaleLanguageCode] UTF8String];
24  flutterLocale.country_code = [[locale objectForKey:NSLocaleCountryCode] UTF8String];
25  flutterLocale.script_code = [[locale objectForKey:NSLocaleScriptCode] UTF8String];
26  flutterLocale.variant_code = [[locale objectForKey:NSLocaleVariantCode] UTF8String];
27  return flutterLocale;
28 }
size_t struct_size
This size of this struct. Must be sizeof(FlutterLocale).
Definition: embedder.h:944
const char * variant_code
Definition: embedder.h:963
const char * script_code
Definition: embedder.h:958
const char * country_code
Definition: embedder.h:953
const char * language_code
Definition: embedder.h:948

◆ OnAcquireExternalTexture()

static bool OnAcquireExternalTexture ( FlutterEngine engine,
int64_t  texture_identifier,
size_t  width,
size_t  height,
FlutterOpenGLTexture open_gl_texture 
)
static

Definition at line 170 of file FlutterEngine.mm.

174  {
175  return [engine populateTextureWithIdentifier:texture_identifier openGLTexture:open_gl_texture];
176 }

◆ OnClearCurrent()

static bool OnClearCurrent ( FlutterEngine engine)
static

Definition at line 149 of file FlutterEngine.mm.

149  {
150  return [engine engineCallbackOnClearCurrent];
151 }

◆ OnFBO()

static uint32_t OnFBO ( FlutterEngine engine)
static

Definition at line 157 of file FlutterEngine.mm.

157  {
158  // There is currently no case where a different FBO is used, so no need to forward.
159  return 0;
160 }

◆ OnMakeCurrent()

static bool OnMakeCurrent ( FlutterEngine engine)
static

Definition at line 145 of file FlutterEngine.mm.

145  {
146  return [engine engineCallbackOnMakeCurrent];
147 }

◆ OnMakeResourceCurrent()

static bool OnMakeResourceCurrent ( FlutterEngine engine)
static

Definition at line 162 of file FlutterEngine.mm.

162  {
163  return [engine engineCallbackOnMakeResourceCurrent];
164 }

◆ OnPlatformMessage()

static void OnPlatformMessage ( const FlutterPlatformMessage message,
FlutterEngine engine 
)
static

Definition at line 166 of file FlutterEngine.mm.

166  {
167  [engine engineCallbackOnPlatformMessage:message];
168 }

◆ OnPresent()

static bool OnPresent ( FlutterEngine engine)
static

Definition at line 153 of file FlutterEngine.mm.

153  {
154  return [engine engineCallbackOnPresent];
155 }

Variable Documentation

◆ _allowHeadlessExecution

BOOL _allowHeadlessExecution

Definition at line 198 of file FlutterEngine.mm.

◆ _aotData

UniqueAotDataPtr _aotData

Definition at line 204 of file FlutterEngine.mm.

◆ _flutterEngine

FlutterEngine* _flutterEngine
Initial value:
{
NSString* _pluginKey

Definition at line 105 of file FlutterEngine.mm.

Referenced by FlutterEngineRegistrar::initWithPlugin:flutterEngine:.

◆ _mainOpenGLContext

NSOpenGLContext* _mainOpenGLContext

Definition at line 192 of file FlutterEngine.mm.

◆ _messageHandlers

NSMutableDictionary<NSString*, FlutterBinaryMessageHandler>* _messageHandlers

Definition at line 195 of file FlutterEngine.mm.

Referenced by FlutterEngine::shutDownEngine.

◆ _project

FlutterDartProject* _project
Initial value:
{
struct _FlutterEngine * FLUTTER_API_SYMBOL(FlutterEngine)
Definition: embedder.h:220
fml::scoped_nsobject< FlutterEngine > _engine

Definition at line 180 of file FlutterEngine.mm.

Referenced by FlutterViewController::initWithProject:.

◆ _resourceContext

NSOpenGLContext* _resourceContext

Definition at line 188 of file FlutterEngine.mm.

◆ _textures

NSMutableDictionary<NSNumber*, FlutterExternalTextureGL*>* _textures

Definition at line 201 of file FlutterEngine.mm.

Referenced by FlutterEngine::shutDownEngine.