| Flutter Impeller |

context.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_IMPELLER_TOOLKIT_INTEROP_CONTEXT_H_
6 #define FLUTTER_IMPELLER_TOOLKIT_INTEROP_CONTEXT_H_
7
8 #include <functional>
9
10 #include "impeller/display_list/aiks_context.h"
11 #include "impeller/renderer/context.h"
12 #include "impeller/toolkit/interop/impeller.h"
13 #include "impeller/toolkit/interop/object.h"
14
15 namespace impeller::interop {
16
17 class Context final
18 : public Object<Context, IMPELLER_INTERNAL_HANDLE_NAME(ImpellerContext)> {
19 public:
20 class BackendData;
21
22 static ScopedObject<Context> CreateOpenGLES(
23 std::function<void*(const char* gl_proc_name)> proc_address_callback);
24
25 explicit Context(std::shared_ptr<impeller::Context> context,
26 std::shared_ptr<BackendData> backend_data);
27
28 ~Context() override;
29
30 Context(const Context&) = delete;
31
32 Context& operator=(const Context&) = delete;
33
34 bool IsValid() const;
35
36 std::shared_ptr<impeller::Context> GetContext() const;
37
38 AiksContext& GetAiksContext();
39
40 private:
41 impeller::AiksContext context_;
42 std::shared_ptr<BackendData> backend_data_;
43 };
44
45 } // namespace impeller::interop
46
47 #endif // FLUTTER_IMPELLER_TOOLKIT_INTEROP_CONTEXT_H_
impeller.h
impeller::interop::Object
Definition: object.h:56
impeller::AiksContext
Definition: aiks_context.h:19
impeller::interop::Context::operator=
Context & operator=(const Context &)=delete
impeller::interop::ScopedObject
Definition: object.h:67
aiks_context.h
impeller::interop::Context::GetAiksContext
AiksContext & GetAiksContext()
Definition: context.cc:107
impeller::interop::Context::GetContext
std::shared_ptr< impeller::Context > GetContext() const
Definition: context.cc:37
impeller::interop
Definition: color_filter.cc:7
impeller::interop::Context::IsValid
bool IsValid() const
Definition: context.cc:33
impeller::interop::Context
Definition: context.h:17
impeller::interop::Context::~Context
~Context() override
impeller::interop::Context::Context
Context(std::shared_ptr< impeller::Context > context, std::shared_ptr< BackendData > backend_data)
Definition: context.cc:26
impeller::interop::Context::CreateOpenGLES
static ScopedObject< Context > CreateOpenGLES(std::function< void *(const char *gl_proc_name)> proc_address_callback)
Definition: context.cc:65
context.h
object.h
impeller::interop::Context::BackendData
Definition: context.cc:21