Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
shell
platform
darwin
ios
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
#include <Metal/Metal.h>
9
10
#include "flutter/fml/macros.h"
11
#include "flutter/fml/platform/darwin/cf_utils.h"
12
#include "flutter/fml/platform/darwin/scoped_nsobject.h"
13
#import "flutter/shell/platform/darwin/graphics/FlutterDarwinContextMetalSkia.h"
14
#import "flutter/shell/platform/darwin/ios/ios_context.h"
15
#include "
third_party/skia/include/gpu/GrDirectContext.h
"
16
17
namespace
flutter
{
18
19
class
IOSContextMetalSkia
final :
public
IOSContext
{
20
public
:
21
explicit
IOSContextMetalSkia
(
MsaaSampleCount
msaa_samples);
22
23
~IOSContextMetalSkia
();
24
25
fml::scoped_nsobject<FlutterDarwinContextMetalSkia>
GetDarwinContext
()
const
;
26
27
// |IOSContext|
28
IOSRenderingBackend
GetBackend
()
const override
;
29
30
// |IOSContext|
31
sk_sp<GrDirectContext>
GetMainContext
()
const override
;
32
33
sk_sp<GrDirectContext>
GetResourceContext
()
const
;
34
35
private
:
36
fml::scoped_nsobject<FlutterDarwinContextMetalSkia>
darwin_context_metal_;
37
38
// |IOSContext|
39
sk_sp<GrDirectContext>
CreateResourceContext
()
override
;
40
41
// |IOSContext|
42
std::unique_ptr<GLContextResult>
MakeCurrent
()
override
;
43
44
// |IOSContext|
45
std::unique_ptr<Texture>
CreateExternalTexture
(
46
int64_t
texture_id
,
47
fml::scoped_nsobject
<NSObject<FlutterTexture>>
texture
)
override
;
48
49
FML_DISALLOW_COPY_AND_ASSIGN
(
IOSContextMetalSkia
);
50
};
51
52
}
// namespace flutter
53
54
#endif
// FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_CONTEXT_METAL_SKIA_H_
GrDirectContext.h
flutter::IOSContextMetalSkia
Definition
ios_context_metal_skia.h:19
flutter::IOSContextMetalSkia::GetBackend
IOSRenderingBackend GetBackend() const override
Get the rendering backend used by this context.
Definition
ios_context_metal_skia.mm:28
flutter::IOSContextMetalSkia::~IOSContextMetalSkia
~IOSContextMetalSkia()
flutter::IOSContextMetalSkia::CreateResourceContext
sk_sp< GrDirectContext > CreateResourceContext() override
Create a resource context for use on the IO task runner. This resource context is used by Skia to upl...
Definition
ios_context_metal_skia.mm:41
flutter::IOSContextMetalSkia::MakeCurrent
std::unique_ptr< GLContextResult > MakeCurrent() override
When using client rendering APIs whose contexts need to be bound to a specific thread,...
Definition
ios_context_metal_skia.mm:46
flutter::IOSContextMetalSkia::GetResourceContext
sk_sp< GrDirectContext > GetResourceContext() const
Definition
ios_context_metal_skia.mm:36
flutter::IOSContextMetalSkia::CreateExternalTexture
std::unique_ptr< Texture > CreateExternalTexture(int64_t texture_id, fml::scoped_nsobject< NSObject< FlutterTexture > > texture) override
Creates an external texture proxy of the appropriate client rendering API.
Definition
ios_context_metal_skia.mm:52
flutter::IOSContextMetalSkia::GetMainContext
sk_sp< GrDirectContext > GetMainContext() const override
Accessor for the Skia context associated with IOSSurfaces and the raster thread.
Definition
ios_context_metal_skia.mm:32
flutter::IOSContextMetalSkia::GetDarwinContext
fml::scoped_nsobject< FlutterDarwinContextMetalSkia > GetDarwinContext() const
Definition
ios_context_metal_skia.mm:24
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
fml::scoped_nsobject
Definition
scoped_nsobject.h:152
sk_sp
Definition
SkRefCnt.h:220
FML_DISALLOW_COPY_AND_ASSIGN
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition
macros.h:27
texture
FlTexture * texture
Definition
mock_texture_registrar.cc:24
MsaaSampleCount
MsaaSampleCount
Definition
msaa_sample_count.h:9
flutter
Definition
asset_manager.cc:10
flutter::IOSRenderingBackend
IOSRenderingBackend
Definition
rendering_api_selection.h:19
texture_id
int64_t texture_id
Definition
texture_registrar_unittests.cc:24
Generated on Fri Apr 26 2024 06:14:25 for Flutter Engine by
1.9.8