| 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" |
| 10 | #include "impeller/entity/contents/content_context.h" |
| 11 | #include "impeller/renderer/context.h" |
| 12 | #include "impeller/renderer/render_target.h" |
| 13 | |
| 14 | namespace impeller { |
| 15 | |
| 16 | struct Picture; |
| 17 | class RenderPass; |
| 18 | |
| 19 | class AiksContext { |
| 20 | public: |
| 21 | AiksContext(std::shared_ptr<Context> context); |
| 22 | |
| 23 | ~AiksContext(); |
| 24 | |
| 25 | bool IsValid() const; |
| 26 | |
| 27 | std::shared_ptr<Context> GetContext() const; |
| 28 | |
| 29 | ContentContext& GetContentContext() const; |
| 30 | |
| 31 | bool Render(const Picture& picture, RenderTarget& render_target); |
| 32 | |
| 33 | private: |
| 34 | std::shared_ptr<Context> context_; |
| 35 | std::unique_ptr<ContentContext> content_context_; |
| 36 | bool is_valid_ = false; |
| 37 | |
| 38 | FML_DISALLOW_COPY_AND_ASSIGN(AiksContext); |
| 39 | }; |
| 40 | |
| 41 | } // namespace impeller |
| 42 |
