Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
aiks_playground.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
6
7#include <memory>
8
12
13namespace impeller {
14
17
19
21 std::shared_ptr<TypographerContext> typographer_context) {
22 typographer_context_ = std::move(typographer_context);
23}
24
29
31 return OpenPlaygroundHere([&picture](AiksContext& renderer) -> Picture {
32 return std::move(picture);
33 });
34}
35
38 return true;
39 }
40
41 AiksContext renderer(GetContext(), typographer_context_);
42
43 if (!renderer.IsValid()) {
44 return false;
45 }
46
48 [this, &renderer, &callback](RenderTarget& render_target) -> bool {
49 const std::optional<Picture>& picture = inspector_.RenderInspector(
50 renderer, [&]() { return callback(renderer); });
51
52 if (!picture.has_value()) {
53 return false;
54 }
55 return renderer.Render(*picture, render_target, true);
56 });
57}
58
60 bool* p_open,
61 ImGuiWindowFlags flags) {
62 ImGui::Begin(name, p_open, flags);
63 return true;
64}
65
66} // namespace impeller
static std::unique_ptr< SkEncoder > Make(SkWStream *dst, const SkPixmap *src, const SkYUVAPixmaps *srcYUVA, const SkColorSpace *srcYUVAColorSpace, const SkJpegEncoder::Options &options)
const std::optional< Picture > & RenderInspector(AiksContext &aiks_context, const std::function< std::optional< Picture >()> &picture_callback)
void SetTypographerContext(std::shared_ptr< TypographerContext > typographer_context)
bool OpenPlaygroundHere(Picture picture)
static bool ImGuiBegin(const char *name, bool *p_open, ImGuiWindowFlags flags)
std::function< std::optional< Picture >(AiksContext &renderer)> AiksPlaygroundCallback
const PlaygroundSwitches switches_
Definition playground.h:120
std::shared_ptr< Context > GetContext() const
Definition playground.cc:89
bool OpenPlaygroundHere(const Renderer::RenderCallback &render_callback)
FlutterSemanticsFlag flags
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
const char * name
Definition fuchsia.cc:50