Flutter Engine
 
Loading...
Searching...
No Matches
android_context_dynamic_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_ANDROID_ANDROID_CONTEXT_DYNAMIC_IMPELLER_H_
6#define FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_CONTEXT_DYNAMIC_IMPELLER_H_
7
8#include <mutex>
9
10#include "flutter/fml/macros.h"
15
16namespace flutter {
17
18/// @brief An Impeller Android context that dynamically creates either an
19/// [AndroidContextGLImpeller] or an [AndroidContextVKImpeller].
20///
21/// The construction of these objects is deferred until [GetImpellerContext] is
22/// invoked. Up to this point, the reported backend will be kImpellerAutoselect.
24 public:
26 const AndroidContext::ContextSettings& settings);
27
29
30 // |AndroidContext|
31 bool IsValid() const override { return true; }
32
33 // |AndroidContext|
34 bool IsDynamicSelection() const override { return true; }
35
36 // |AndroidContext|
37 AndroidRenderingAPI RenderingApi() const override;
38
39 /// @brief Retrieve the GL Context if it was created, or nullptr.
40 std::shared_ptr<AndroidContextGLImpeller> GetGLContext() const;
41
42 /// @brief Retrieve the VK context if it was created, or nullptr.
43 std::shared_ptr<AndroidContextVKImpeller> GetVKContext() const;
44
45 // |AndroidContext|
46 void SetupImpellerContext() override;
47
48 std::shared_ptr<impeller::Context> GetImpellerContext() const override;
49
50 private:
51 const AndroidContext::ContextSettings settings_;
52 std::shared_ptr<AndroidContextGLImpeller> gl_context_;
53 std::shared_ptr<AndroidContextVKImpeller> vk_context_;
54
56};
57
58} // namespace flutter
59
60#endif // FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_CONTEXT_DYNAMIC_IMPELLER_H_
An Impeller Android context that dynamically creates either an [AndroidContextGLImpeller] or an [Andr...
void SetupImpellerContext() override
Perform deferred setup for the impeller Context.
std::shared_ptr< AndroidContextVKImpeller > GetVKContext() const
Retrieve the VK context if it was created, or nullptr.
std::shared_ptr< AndroidContextGLImpeller > GetGLContext() const
Retrieve the GL Context if it was created, or nullptr.
std::shared_ptr< impeller::Context > GetImpellerContext() const override
Accessor for the Impeller context associated with AndroidSurfaces and the raster thread.
Holds state that is shared across Android surfaces.
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition macros.h:27