Flutter Engine
The Flutter Engine
ios_context_metal_skia.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_SKIA_H_
6#define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_CONTEXT_METAL_SKIA_H_
7
8#if !SLIMPELLER
9
10#include <Metal/Metal.h>
11
12#include "flutter/fml/macros.h"
13#include "flutter/fml/platform/darwin/cf_utils.h"
14#include "flutter/fml/platform/darwin/scoped_nsobject.h"
15#import "flutter/shell/platform/darwin/graphics/FlutterDarwinContextMetalSkia.h"
16#import "flutter/shell/platform/darwin/ios/ios_context.h"
18
19namespace flutter {
20
21class IOSContextMetalSkia final : public IOSContext {
22 public:
23 explicit IOSContextMetalSkia();
24
26
28
29 // |IOSContext|
30 IOSRenderingBackend GetBackend() const override;
31
32 // |IOSContext|
34
36
37 private:
39
40 // |IOSContext|
41 sk_sp<GrDirectContext> CreateResourceContext() override;
42
43 // |IOSContext|
44 std::unique_ptr<GLContextResult> MakeCurrent() override;
45
46 // |IOSContext|
47 std::unique_ptr<Texture> CreateExternalTexture(
48 int64_t texture_id,
49 fml::scoped_nsobject<NSObject<FlutterTexture>> texture) override;
50
51 FML_DISALLOW_COPY_AND_ASSIGN(IOSContextMetalSkia);
52};
53
54} // namespace flutter
55
56#endif // !SLIMPELLER
57
58#endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_CONTEXT_METAL_SKIA_H_
IOSRenderingBackend GetBackend() const override
Get the rendering backend used by this context.
sk_sp< GrDirectContext > GetResourceContext() const
sk_sp< GrDirectContext > GetMainContext() const override
Accessor for the Skia context associated with IOSSurfaces and the raster thread.
fml::scoped_nsobject< FlutterDarwinContextMetalSkia > GetDarwinContext() const
Manages the lifetime of the on-screen and off-screen rendering contexts on iOS. On-screen contexts ar...
Definition: ios_context.h:39
FlTexture * texture
int64_t texture_id