Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
dl_test_surface_instance_skia.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_SKIA_DL_TEST_SURFACE_INSTANCE_SKIA_H_
6#define FLUTTER_DISPLAY_LIST_TESTING_SKIA_DL_TEST_SURFACE_INSTANCE_SKIA_H_
7
9
10namespace flutter {
11namespace testing {
12
14 public:
15 // |DlSurfaceInstance|
16 void Clear(const DlColor& color) override;
17
18 // |DlSurfaceInstance|
19 DlCanvas* GetCanvas() override;
20
21 // |DlSurfaceInstance|
22 void RenderDisplayList(const sk_sp<DisplayList>& display_list) override;
23
24 // |DlSurfaceInstance|
25 void FlushSubmitCpuSync() override;
26
27 // |DlSurfaceInstance|
28 std::unique_ptr<DlPixelData> SnapshotToPixelData() const override;
29
30 // |DlSurfaceInstance|
31 sk_sp<DlImage> SnapshotToImage() const override;
32
33 // |DlSurfaceInstance|
34 bool SnapshotToFile(std::string& filename) const override;
35
36 // |DlSurfaceInstance|
37 int width() const override;
38
39 // |DlSurfaceInstance|
40 int height() const override;
41
42 // |DlSurfaceInstance|
43 sk_sp<SkSurface> sk_surface() override { return GetSurface(); }
44
45 protected:
48
49 virtual sk_sp<SkSurface> GetSurface() const = 0;
50
51 private:
52 DlSkCanvasAdapter adapter_;
53
54 sk_sp<SkImage> GetRasterImage() const;
55};
56
58 public:
59 explicit DlSurfaceInstanceSkia(sk_sp<SkSurface> surface);
61
62 protected:
63 sk_sp<SkSurface> GetSurface() const override;
64
65 private:
66 sk_sp<SkSurface> surface_;
67};
68
69} // namespace testing
70} // namespace flutter
71
72#endif // FLUTTER_DISPLAY_LIST_TESTING_SKIA_DL_TEST_SURFACE_INSTANCE_SKIA_H_
Developer-facing API for rendering anything within the engine.
Definition dl_canvas.h:32
Backend implementation of |DlCanvas| for |SkCanvas|.
std::unique_ptr< DlPixelData > SnapshotToPixelData() const override
virtual sk_sp< SkSurface > GetSurface() const =0
void RenderDisplayList(const sk_sp< DisplayList > &display_list) override
bool SnapshotToFile(std::string &filename) const override
Store a snapshot of this Surface to the file indicated by the filename.
int height() const override
The height of the underlying surface.
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