Flutter Engine
ios_context.mm
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #import "flutter/shell/platform/darwin/ios/ios_context.h"
6 
7 #include "flutter/fml/logging.h"
8 #import "flutter/shell/platform/darwin/ios/ios_context_gl.h"
9 #import "flutter/shell/platform/darwin/ios/ios_context_software.h"
10 
11 #if FLUTTER_SHELL_ENABLE_METAL
12 #import "flutter/shell/platform/darwin/ios/ios_context_metal.h"
13 #endif // FLUTTER_SHELL_ENABLE_METAL
14 
15 namespace flutter {
16 
17 IOSContext::IOSContext() = default;
18 
19 IOSContext::~IOSContext() = default;
20 
21 std::unique_ptr<IOSContext> IOSContext::Create(IOSRenderingAPI rendering_api) {
22  switch (rendering_api) {
24  return std::make_unique<IOSContextGL>();
26  return std::make_unique<IOSContextSoftware>();
27 #if FLUTTER_SHELL_ENABLE_METAL
29  return std::make_unique<IOSContextMetal>();
30 #endif // FLUTTER_SHELL_ENABLE_METAL
31  default:
32  break;
33  }
34  FML_CHECK(false);
35  return nullptr;
36 }
37 
38 } // namespace flutter
static std::unique_ptr< IOSContext > Create(IOSRenderingAPI rendering_api)
Create an iOS context object capable of creating the on-screen and off-screen GPU context for use by ...
Definition: ios_context.mm:21
virtual ~IOSContext()
Collects the context object. This must happen on the thread on which this object was created...
#define FML_CHECK(condition)
Definition: logging.h:68