Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
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 std::shared_ptr<fml::BasicTaskRunner> io_task_runner);
28
30
31 // |AndroidContext|
32 bool IsValid() const override { return true; }
33
34 // |AndroidContext|
35 bool IsDynamicSelection() const override { return true; }
36
37 // |AndroidContext|
38 AndroidRenderingAPI RenderingApi() const override;
39
40 /// @brief Retrieve the GL Context if it was created, or nullptr.
41 std::shared_ptr<AndroidContextGLImpeller> GetGLContext() const;
42
43 /// @brief Retrieve the VK context if it was created, or nullptr.
44 std::shared_ptr<AndroidContextVKImpeller> GetVKContext() const;
45
46 // |AndroidContext|
47 void SetupImpellerContext() override;
48
49 std::shared_ptr<impeller::Context> GetImpellerContext() const override;
50
51 private:
52 const AndroidContext::ContextSettings settings_;
53 std::shared_ptr<AndroidContextGLImpeller> gl_context_;
54 std::shared_ptr<AndroidContextVKImpeller> vk_context_;
55 std::shared_ptr<fml::BasicTaskRunner> io_task_runner_;
56
58};
59
60} // namespace flutter
61
62#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