Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
FlutterDarwinContextMetalImpeller.mm File Reference
import "flutter/shell/platform/darwin/graphics/FlutterDarwinContextMetalImpeller.h"
#include "flutter/common/graphics/persistent_cache.h"
#include "flutter/fml/logging.h"
#include "flutter/impeller/renderer/backend/metal/context_mtl.h"
#include "flutter/shell/common/context_options.h"
import "flutter/shell/platform/darwin/common/framework/Headers/FlutterMacros.h"
#include "impeller/entity/mtl/entity_shaders.h"
#include "impeller/entity/mtl/framebuffer_blend_shaders.h"
#include "impeller/entity/mtl/modern_shaders.h"

Go to the source code of this file.

Functions

static FLUTTER_ASSERT_ARC std::shared_ptr< impeller::ContextMTLCreateImpellerContext (const std::shared_ptr< const fml::SyncSwitch > &is_gpu_disabled_sync_switch)
 

Function Documentation

◆ CreateImpellerContext()

static FLUTTER_ASSERT_ARC std::shared_ptr< impeller::ContextMTL > CreateImpellerContext ( const std::shared_ptr< const fml::SyncSwitch > &  is_gpu_disabled_sync_switch)
static

Definition at line 22 of file FlutterDarwinContextMetalImpeller.mm.

23 {
24 std::vector<std::shared_ptr<fml::Mapping>> shader_mappings = {
25 std::make_shared<fml::NonOwnedMapping>(impeller_entity_shaders_data,
26 impeller_entity_shaders_length),
27#if IMPELLER_ENABLE_3D
28 std::make_shared<fml::NonOwnedMapping>(impeller_scene_shaders_data,
29 impeller_scene_shaders_length),
30#endif // IMPELLER_ENABLE_3D
31 std::make_shared<fml::NonOwnedMapping>(impeller_modern_shaders_data,
32 impeller_modern_shaders_length),
33 std::make_shared<fml::NonOwnedMapping>(impeller_framebuffer_blend_shaders_data,
34 impeller_framebuffer_blend_shaders_length),
35 };
36 auto context = impeller::ContextMTL::Create(shader_mappings, is_gpu_disabled_sync_switch,
37 "Impeller Library");
38 if (!context) {
39 FML_LOG(ERROR) << "Could not create Metal Impeller Context.";
40 return nullptr;
41 }
42
43 return context;
44}
static std::shared_ptr< ContextMTL > Create(const std::vector< std::string > &shader_library_paths, std::shared_ptr< const fml::SyncSwitch > is_gpu_disabled_sync_switch)
#define FML_LOG(severity)
Definition logging.h:82
#define ERROR(message)