| Flutter Impeller |

Public Member Functions | List of all members
impeller::AiksContext Class Reference

`#include <aiks_context.h>`

## Public Member Functions
| AiksContext (std::shared_ptr< Context > context, std::shared_ptr< TypographerContext > typographer_context, std::optional< std::shared_ptr< RenderTargetAllocator >> render_target_allocator=std::nullopt)
| ~AiksContext ()
bool | IsValid () const
std::shared_ptr< Context > | GetContext () const
ContentContext & | GetContentContext () const

## Detailed Description

Definition at line 19 of file aiks_context.h.

## Constructor & Destructor Documentation

## ◆ AiksContext()

impeller::AiksContext::AiksContext | ( | std::shared_ptr< Context > | context,
|  | std::shared_ptr< TypographerContext > | typographer_context,
|  | std::optional< std::shared_ptr< RenderTargetAllocator >> | render_target_allocator = `std::nullopt`
| ) |  |

Construct a new AiksContext.

Parameters

  context | The Impeller context that Aiks should use for allocating resources and executing device commands. Required.
  typographer_context | The text backend to use for rendering text. If `nullptr` is supplied, then attempting to draw text with Aiks will result in validation errors.
  render_target_allocator | Injects a render target allocator or allocates its own if none is supplied.

Definition at line 11 of file aiks_context.cc.

16 : context_(std::move(context)) {
17 if (!context_ || !context_->IsValid()) {
18 return;
19 }
20
21 content_context_ = std::make_unique<ContentContext>(
22 context_, std::move(typographer_context),
23 render_target_allocator.has_value() ? render_target_allocator.value()
24 : nullptr);
25 if (!content_context_->IsValid()) {
26 return;
27 }
28
29 is_valid_ = true;
30 }

## ◆ ~AiksContext()

impeller::AiksContext::~AiksContext | ( |  | ) |
| default

## Member Function Documentation

## ◆ GetContentContext()

ContentContext & impeller::AiksContext::GetContentContext | ( |  | ) | const

Definition at line 42 of file aiks_context.cc.

42 {
43 return *content_context_;
44 }

Referenced by impeller::DisplayListToTexture(), impeller::DlImageImpeller::MakeFromYUVTextures(), impeller::AiksPlayground::OpenPlaygroundHere(), impeller::DlPlayground::OpenPlaygroundHere(), and impeller::testing::TEST_P().

## ◆ GetContext()

std::shared_ptr< Context > impeller::AiksContext::GetContext | ( |  | ) | const

Definition at line 38 of file aiks_context.cc.

38 {
39 return context_;
40 }

Referenced by impeller::DisplayListToTexture(), impeller::interop::Context::GetContext(), impeller::testing::VulkanScreenshotter::MakeScreenshot(), and impeller::testing::TEST_P().

## ◆ IsValid()

bool impeller::AiksContext::IsValid | ( |  | ) | const

Definition at line 34 of file aiks_context.cc.

34 {
35 return is_valid_;
36 }

Referenced by impeller::interop::Context::IsValid(), impeller::AiksPlayground::OpenPlaygroundHere(), and impeller::DlPlayground::OpenPlaygroundHere().

The documentation for this class was generated from the following files:

- impeller/display_list/aiks_context.h
- impeller/display_list/aiks_context.cc