Flutter iOS Embedder
ios_context_noop.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 
6 #include "ios_context.h"
8 
10 
11 namespace flutter {
12 
14 
15 // |IOSContext|
17 
18 // |IOSContext|
19 sk_sp<GrDirectContext> IOSContextNoop::CreateResourceContext() {
20  return nullptr;
21 }
22 
23 // |IOSContext|
24 sk_sp<GrDirectContext> IOSContextNoop::GetMainContext() const {
25  return nullptr;
26 }
27 
28 // |IOSContext|
31 }
32 
33 // |IOSContext|
34 std::unique_ptr<GLContextResult> IOSContextNoop::MakeCurrent() {
35  // This only makes sense for context that need to be bound to a specific thread.
36  return std::make_unique<GLContextDefaultResult>(false);
37 }
38 
39 // |IOSContext|
40 std::unique_ptr<Texture> IOSContextNoop::CreateExternalTexture(
41  int64_t texture_id,
42  fml::scoped_nsobject<NSObject<FlutterTexture>> texture) {
43  // Don't use FML for logging as it will contain engine specific details. This is a user facing
44  // message.
45  NSLog(@"Flutter: Attempted to composite external texture sources using the noop backend. "
46  @"This backend is only used on simulators. This feature is only available on actual "
47  @"devices where Metal is used for rendering.");
48 
49  // Not supported in this backend.
50  return nullptr;
51 }
52 
53 } // namespace flutter
ios_context_noop.h
flutter::IOSContextNoop::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_noop.mm:40
flutter::IOSContextNoop::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_noop.mm:34
flutter::IOSContextNoop::GetBackend
IOSRenderingBackend GetBackend() const override
Get the rendering backend used by this context.
Definition: ios_context_noop.mm:29
flutter::IOSRenderingBackend
IOSRenderingBackend
Definition: rendering_api_selection.h:19
flutter::IOSContextNoop::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_noop.mm:19
flutter::IOSRenderingBackend::kImpeller
@ kImpeller
flutter::IOSContextNoop::IOSContextNoop
IOSContextNoop()
flutter
Definition: accessibility_bridge.h:28
rendering_api_selection.h
flutter::IOSContextNoop::~IOSContextNoop
~IOSContextNoop()
ios_context.h
texture_id
int64_t texture_id
Definition: texture_registrar_unittests.cc:24
FLUTTER_ASSERT_ARC
Definition: FlutterChannelKeyResponder.mm:13
flutter::IOSContextNoop::GetMainContext
sk_sp< GrDirectContext > GetMainContext() const override
Accessor for the Skia context associated with IOSSurfaces and the raster thread.
Definition: ios_context_noop.mm:24