| Flutter iOS Embedder |

ios_context_metal_impeller.h
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 #ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_CONTEXT_METAL_IMPELER_H_
6 #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_CONTEXT_METAL_IMPELER_H_
7
8 #include "flutter/fml/macros.h"
9 #include "flutter/shell/platform/darwin/graphics/FlutterDarwinContextMetalImpeller.h"
10 #include "flutter/shell/platform/darwin/graphics/FlutterDarwinContextMetalSkia.h"
11 #include "flutter/shell/platform/darwin/ios/ios_context.h"
12
13 namespace impeller {
14
15 class Context;
16
17 } // namespace impeller
18
19 namespace flutter {
20
21 class IOSContextMetalImpeller final : public IOSContext {
22 public:
23 IOSContextMetalImpeller(std::shared_ptr<const fml::SyncSwitch> is_gpu_disabled_sync_switch);
24
25 ~IOSContextMetalImpeller();
26
27 fml::scoped_nsobject<FlutterDarwinContextMetalSkia> GetDarwinContext() const;
28
29 IOSRenderingBackend GetBackend() const override;
30
31 // |IOSContext|
32 sk_sp<GrDirectContext> GetMainContext() const override;
33
34 sk_sp<GrDirectContext> GetResourceContext() const;
35
36 private:
37 fml::scoped_nsobject<FlutterDarwinContextMetalImpeller> darwin_context_metal_impeller_;
38
39 // |IOSContext|
40 sk_sp<GrDirectContext> CreateResourceContext() override;
41
42 // |IOSContext|
43 std::unique_ptr<GLContextResult> MakeCurrent() override;
44
45 // |IOSContext|
46 std::unique_ptr<Texture> CreateExternalTexture(
47 int64_t texture_id,
48 fml::scoped_nsobject<NSObject<FlutterTexture>> texture) override;
49
50 // |IOSContext|
51 std::shared_ptr<impeller::Context> GetImpellerContext() const override;
52
53 FML_DISALLOW_COPY_AND_ASSIGN(IOSContextMetalImpeller);
54 };
55
56 } // namespace flutter
57
58 #endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_CONTEXT_METAL_IMPELER_H_
flutter::IOSContextMetalImpeller
Definition: ios_context_metal_impeller.h:21
flutter::IOSContextMetalImpeller::~IOSContextMetalImpeller
~IOSContextMetalImpeller()
flutter::IOSContextMetalImpeller::GetResourceContext
sk_sp< GrDirectContext > GetResourceContext() const
flutter::IOSContextMetalImpeller::GetMainContext
sk_sp< GrDirectContext > GetMainContext() const override
Accessor for the Skia context associated with IOSSurfaces and the raster thread.
flutter::IOSContextMetalImpeller::GetDarwinContext
fml::scoped_nsobject< FlutterDarwinContextMetalSkia > GetDarwinContext() const
flutter::IOSContextMetalImpeller::IOSContextMetalImpeller
IOSContextMetalImpeller(std::shared_ptr< const fml::SyncSwitch > is_gpu_disabled_sync_switch)
flutter::IOSContext
Manages the lifetime of the on-screen and off-screen rendering contexts on iOS. On-screen contexts ar...
Definition: ios_context.h:40
flutter::IOSRenderingBackend
IOSRenderingBackend
Definition: rendering_api_selection.h:19
flutter
Definition: accessibility_bridge.h:28
ios_context.h
texture_id
int64_t texture_id
Definition: texture_registrar_unittests.cc:24
impeller
Definition: ios_context.h:21
flutter::IOSContextMetalImpeller::GetBackend
IOSRenderingBackend GetBackend() const override
Get the rendering backend used by this context.