Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
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
13
14namespace impeller {
15
17 : typographer_context_(TypographerContextSkia::Make()) {}
18
20
22 std::shared_ptr<TypographerContext> typographer_context) {
23 typographer_context_ = std::move(typographer_context);
24}
25
29
31 return true;
32}
33
35 const sk_sp<flutter::DisplayList>& list) {
36 return OpenPlaygroundHere([list]() { return list; });
37}
38
41 AiksContext renderer(GetContext(), typographer_context_);
42
43 if (!renderer.IsValid()) {
44 return false;
45 }
46
48 [&renderer, &callback](RenderTarget& render_target) -> bool {
49 return RenderToTarget(
50 renderer.GetContentContext(), //
51 render_target, //
52 callback(), //
54 render_target.GetRenderTargetSize().height), //
55 /*reset_host_buffer=*/true, //
56 /*is_onscreen=*/false);
57 });
58}
59
60} // namespace impeller
ContentContext & GetContentContext() const
std::function< sk_sp< flutter::DisplayList >()> AiksDlPlaygroundCallback
bool OpenPlaygroundHere(const AiksDlPlaygroundCallback &callback)
void SetTypographerContext(std::shared_ptr< TypographerContext > typographer_context)
bool IsGoldenTestSuite() const override
This method is overridden on a test suite basis and establishes whether a given set of tests is inten...
bool OpenPlaygroundHere(const RenderCallback &render_callback)
std::shared_ptr< Context > GetContext() const
ISize GetRenderTargetSize() const
FlutterDesktopBinaryReply callback
bool RenderToTarget(ContentContext &context, RenderTarget render_target, const sk_sp< flutter::DisplayList > &display_list, Rect cull_rect, bool reset_host_buffer, bool is_onscreen)
Render the provided display list to the render target.
static constexpr TRect MakeWH(Type width, Type height)
Definition rect.h:140
Type height
Definition size.h:29
Type width
Definition size.h:28