Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
dl_test_surface_instance_impeller.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_DISPLAY_LIST_TESTING_IMPELLER_DL_TEST_SURFACE_INSTANCE_IMPELLER_H_
6#define FLUTTER_DISPLAY_LIST_TESTING_IMPELLER_DL_TEST_SURFACE_INSTANCE_IMPELLER_H_
7
9
16
17namespace flutter {
18namespace testing {
19
21 public:
23 std::shared_ptr<impeller::Context> context,
24 std::shared_ptr<impeller::Surface> surface);
25
27 std::shared_ptr<impeller::Context> context,
28 std::shared_ptr<impeller::RenderTarget> surface);
29
31
32 // |DlSurfaceInstance|
33 void Clear(const DlColor& color) override;
34
35 // |DlSurfaceInstance|
36 DlCanvas* GetCanvas() override;
37
38 // |DlSurfaceInstance|
39 void RenderDisplayList(const sk_sp<DisplayList>& display_list) override;
40
41 // |DlSurfaceInstance|
42 void FlushSubmitCpuSync() override;
43
44 // |DlSurfaceInstance|
45 std::unique_ptr<DlPixelData> SnapshotToPixelData() const override;
46
47 // |DlSurfaceInstance|
48 sk_sp<DlImage> SnapshotToImage() const override;
49
50 // |DlSurfaceInstance|
51 bool SnapshotToFile(std::string& filename) const override;
52
53 // |DlSurfaceInstance|
54 int width() const override;
55
56 // |DlSurfaceInstance|
57 int height() const override;
58
59 private:
60 DisplayListBuilder builder_;
61 std::shared_ptr<impeller::Context> context_;
62 std::shared_ptr<impeller::Surface> surface_;
63 std::shared_ptr<impeller::RenderTarget> target_holder_;
64 impeller::AiksContext aiks_context_;
65
66 inline const impeller::RenderTarget& GetRenderTarget() const;
67
68 inline void Flush();
69
70 void DoRenderDisplayList(const sk_sp<DisplayList>& display_list);
71
72 static std::shared_ptr<impeller::TypographerContext> typographer_context_;
73 static impeller::testing::MetalScreenshotter snapshotter_;
74};
75
76} // namespace testing
77} // namespace flutter
78
79#endif // FLUTTER_DISPLAY_LIST_TESTING_IMPELLER_DL_TEST_SURFACE_INSTANCE_IMPELLER_H_
Developer-facing API for rendering anything within the engine.
Definition dl_canvas.h:32
void RenderDisplayList(const sk_sp< DisplayList > &display_list) override
int height() const override
The height of the underlying surface.
bool SnapshotToFile(std::string &filename) const override
Store a snapshot of this Surface to the file indicated by the filename.
std::unique_ptr< DlPixelData > SnapshotToPixelData() const override
void Clear(const DlColor &color) override
Clear the entire surface to the indicated color.
int width() const override
The width of the underlying surface.
VkSurfaceKHR surface
Definition main.cc:65