| Flutter Impeller |

aiks_context.cc
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 #include "impeller/display_list/aiks_context.h"
6
7 #include "impeller/typographer/typographer_context.h"
8
9 namespace impeller {
10
11 AiksContext::AiksContext(
12 std::shared_ptr<Context> context,
13 std::shared_ptr<TypographerContext> typographer_context,
14 std::optional<std::shared_ptr<RenderTargetAllocator>>
15 render_target_allocator)
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 }
31
32 AiksContext::~AiksContext() = default;
33
34 bool AiksContext::IsValid() const {
35 return is_valid_;
36 }
37
38 std::shared_ptr<Context> AiksContext::GetContext() const {
39 return context_;
40 }
41
42 ContentContext& AiksContext::GetContentContext() const {
43 return *content_context_;
44 }
45
46 } // namespace impeller
aiks_context.h
impeller::AiksContext::GetContentContext
ContentContext & GetContentContext() const
Definition: aiks_context.cc:42
impeller::AiksContext::AiksContext
AiksContext(std::shared_ptr< Context > context, std::shared_ptr< TypographerContext > typographer_context, std::optional< std::shared_ptr< RenderTargetAllocator >> render_target_allocator=std::nullopt)
Definition: aiks_context.cc:11
impeller::AiksContext::~AiksContext
~AiksContext()
impeller::AiksContext::IsValid
bool IsValid() const
Definition: aiks_context.cc:34
impeller::AiksContext::GetContext
std::shared_ptr< Context > GetContext() const
Definition: aiks_context.cc:38
impeller::ContentContext
Definition: content_context.h:138
impeller
Definition: allocation.cc:12
std
Definition: comparable.h:95
typographer_context.h