| Flutter Impeller |

dl_playground.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 #ifndef FLUTTER_IMPELLER_DISPLAY_LIST_DL_PLAYGROUND_H_
6 #define FLUTTER_IMPELLER_DISPLAY_LIST_DL_PLAYGROUND_H_
7
8 #include "flutter/display_list/display_list.h"
9 #include "flutter/display_list/dl_builder.h"
10 #include "flutter/impeller/golden_tests/screenshot.h"
11 #include "impeller/playground/playground_test.h"
12 #include "third_party/skia/include/core/SkFont.h"
13
14 namespace impeller {
15
16 class DlPlayground : public PlaygroundTest {
17 public:
18 using DisplayListPlaygroundCallback =
19 std::function<sk_sp<flutter::DisplayList>()>;
20
21 DlPlayground();
22
23 ~DlPlayground();
24
25 bool OpenPlaygroundHere(flutter::DisplayListBuilder& builder);
26
27 bool OpenPlaygroundHere(sk_sp<flutter::DisplayList> list);
28
29 bool OpenPlaygroundHere(DisplayListPlaygroundCallback callback);
30
31 std::unique_ptr<testing::Screenshot> MakeScreenshot(
32 const sk_sp<flutter::DisplayList>& list);
33
34 SkFont CreateTestFontOfSize(Scalar scalar);
35
36 SkFont CreateTestFont();
37
38 sk_sp<flutter::DlImage> CreateDlImageForFixture(
39 const char* fixture_name,
40 bool enable_mipmapping = false) const;
41
42 private:
43 DlPlayground(const DlPlayground&) = delete;
44
45 DlPlayground& operator=(const DlPlayground&) = delete;
46 };
47
48 } // namespace impeller
49
50 #endif // FLUTTER_IMPELLER_DISPLAY_LIST_DL_PLAYGROUND_H_
impeller::DlPlayground
Definition: dl_playground.h:16
impeller::DlPlayground::CreateTestFontOfSize
SkFont CreateTestFontOfSize(Scalar scalar)
Definition: dl_playground.cc:60
impeller::DlPlayground::~DlPlayground
~DlPlayground()
impeller::DlPlayground::OpenPlaygroundHere
bool OpenPlaygroundHere(flutter::DisplayListBuilder &builder)
Definition: dl_playground.cc:24
impeller::DlPlayground::DlPlayground
DlPlayground()
impeller::DlPlayground::MakeScreenshot
std::unique_ptr< testing::Screenshot > MakeScreenshot(const sk_sp< flutter::DisplayList > &list)
Definition: dl_playground.cc:55
impeller::DlPlayground::CreateTestFont
SkFont CreateTestFont()
Definition: dl_playground.cc:68
impeller::DlPlayground::CreateDlImageForFixture
sk_sp< flutter::DlImage > CreateDlImageForFixture(const char *fixture_name, bool enable_mipmapping=false) const
Definition: dl_playground.cc:72
impeller::DlPlayground::DisplayListPlaygroundCallback
std::function< sk_sp< flutter::DisplayList >()> DisplayListPlaygroundCallback
Definition: dl_playground.h:19
impeller::PlaygroundTest
Definition: playground_test.h:23
impeller
Definition: allocation.cc:12
impeller::Scalar
float Scalar
Definition: scalar.h:19
playground_test.h
screenshot.h