Flutter Impeller
aiks_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 #pragma once
6 
7 #include <memory>
8 
9 #include "flutter/fml/macros.h"
14 
15 namespace impeller {
16 
17 struct Picture;
18 class RenderPass;
19 
20 class AiksContext {
21  public:
22  /// Construct a new AiksContext.
23  ///
24  /// @param context The Impeller context that Aiks should use for
25  /// allocating resources and executing device
26  /// commands. Required.
27  /// @param typographer_context The text backend to use for rendering text. If
28  /// `nullptr` is supplied, then attempting to draw
29  /// text with Aiks will result in validation
30  /// errors.
31  AiksContext(std::shared_ptr<Context> context,
32  std::shared_ptr<TypographerContext> typographer_context);
33 
34  ~AiksContext();
35 
36  bool IsValid() const;
37 
38  std::shared_ptr<Context> GetContext() const;
39 
41 
42  bool Render(const Picture& picture, RenderTarget& render_target);
43 
44  private:
45  std::shared_ptr<Context> context_;
46  std::unique_ptr<ContentContext> content_context_;
47  bool is_valid_ = false;
48 
49  FML_DISALLOW_COPY_AND_ASSIGN(AiksContext);
50 };
51 
52 } // namespace impeller
impeller::AiksContext
Definition: aiks_context.h:20
impeller::AiksContext::GetContentContext
ContentContext & GetContentContext() const
Definition: aiks_context.cc:39
impeller::AiksContext::~AiksContext
~AiksContext()
typographer_context.h
impeller::AiksContext::AiksContext
AiksContext(std::shared_ptr< Context > context, std::shared_ptr< TypographerContext > typographer_context)
Definition: aiks_context.cc:12
impeller::Picture
Definition: picture.h:19
impeller::RenderTarget
Definition: render_target.h:48
impeller::AiksContext::GetContext
std::shared_ptr< Context > GetContext() const
Definition: aiks_context.cc:35
impeller::AiksContext::Render
bool Render(const Picture &picture, RenderTarget &render_target)
Definition: aiks_context.cc:43
content_context.h
context.h
render_target.h
impeller
Definition: aiks_context.cc:10
impeller::ContentContext
Definition: content_context.h:344
impeller::AiksContext::IsValid
bool IsValid() const
Definition: aiks_context.cc:31