#include <dl_test_surface_instance_skia.h>
Public Member Functions | |
| void | Clear (const DlColor &color) override |
| Clear the entire surface to the indicated color. | |
| DlCanvas * | GetCanvas () override |
| void | RenderDisplayList (const sk_sp< DisplayList > &display_list) override |
| void | FlushSubmitCpuSync () override |
| std::unique_ptr< DlPixelData > | SnapshotToPixelData () const override |
| sk_sp< DlImage > | SnapshotToImage () const override |
| bool | SnapshotToFile (std::string &filename) const override |
| Store a snapshot of this Surface to the file indicated by the filename. | |
| int | width () const override |
| The width of the underlying surface. | |
| int | height () const override |
| The height of the underlying surface. | |
| sk_sp< SkSurface > | sk_surface () override |
Public Member Functions inherited from flutter::testing::DlSurfaceInstance | |
| virtual | ~DlSurfaceInstance ()=default |
| DlISize | GetSize () const |
| The size of the underlying surface. | |
Protected Member Functions | |
| DlSurfaceInstanceSkiaBase () | |
| virtual | ~DlSurfaceInstanceSkiaBase () |
| virtual sk_sp< SkSurface > | GetSurface () const =0 |
Definition at line 13 of file dl_test_surface_instance_skia.h.
|
explicitprotected |
Definition at line 99 of file dl_test_surface_instance_skia.cc.
|
protectedvirtualdefault |
|
overridevirtual |
Clear the entire surface to the indicated color.
Implements flutter::testing::DlSurfaceInstance.
Definition at line 108 of file dl_test_surface_instance_skia.cc.
References flutter::DlCanvas::Clear(), and GetCanvas().
|
overridevirtual |
Ensure that all outstanding calls executed on the DlCanvas instance are rendered to the surface.
Implements flutter::testing::DlSurfaceInstance.
Definition at line 125 of file dl_test_surface_instance_skia.cc.
References flutter::DlSkCanvasAdapter::canvas(), GetSurface(), and surface.
|
overridevirtual |
Return a DlCanvas instance that renders to this surface. Note that actual execution of the rendering calls are not guaranteed until the FlushSubmitCpuSync method is called. The DlCanvas will also be reset by the operations of the sync method so transform and clip state will not be carried over to subsequent calls.
Rendering to this canvas does not necessarily render the commands immediately in all backends, some backends accumulate the commands into a DisplayList and only flush that DisplayList when the FlushSubmitCpuSync is called. Tests should strongly prefer using RenderDisplayList instead of multiple calls on this canvas object.
Implements flutter::testing::DlSurfaceInstance.
Definition at line 112 of file dl_test_surface_instance_skia.cc.
References flutter::DlSkCanvasAdapter::canvas(), GetSurface(), and flutter::DlSkCanvasAdapter::set_canvas().
Referenced by Clear(), and RenderDisplayList().
|
protectedpure virtual |
Implemented in flutter::testing::DlSurfaceInstanceSkia, and flutter::testing::DlMetalSurfaceInstance.
Referenced by FlushSubmitCpuSync(), GetCanvas(), height(), sk_surface(), and width().
|
overridevirtual |
The height of the underlying surface.
Implements flutter::testing::DlSurfaceInstance.
Definition at line 167 of file dl_test_surface_instance_skia.cc.
References GetSurface().
|
overridevirtual |
Render the indicated DisplayList to the surface. Note that the commands may be enqueued by this call and will be rendered at some time in the future, but the caller must call FlushSubmitCpuSync to be sure they are done being rendered.
In some cases this may be faster than using: GetCanvas().DrawDisplayList(display_list);
Implements flutter::testing::DlSurfaceInstance.
Definition at line 120 of file dl_test_surface_instance_skia.cc.
References flutter::DlCanvas::DrawDisplayList(), and GetCanvas().
|
inlineoverridevirtual |
Return a pointer to an underlying SkSurface if the image instance has one. THIS METHOD IS DEPRECATED AND ONLY USED IN DL_RENDERING_UNITTESTS.
Reimplemented from flutter::testing::DlSurfaceInstance.
Definition at line 43 of file dl_test_surface_instance_skia.h.
References GetSurface().
|
overridevirtual |
Store a snapshot of this Surface to the file indicated by the filename.
Implements flutter::testing::DlSurfaceInstance.
Definition at line 138 of file dl_test_surface_instance_skia.cc.
References flutter::data, and flutter::testing::OpenFixturesDirectory().
|
overridevirtual |
Return the current contents of the surface as a DlImage compatible with the DlCanvas that it provides.
Implements flutter::testing::DlSurfaceInstance.
Definition at line 159 of file dl_test_surface_instance_skia.cc.
References flutter::DlImageSkia::Make().
|
overridevirtual |
Read back the current contents of the surface and return it as a DlPixelData structure.
Implements flutter::testing::DlSurfaceInstance.
Definition at line 152 of file dl_test_surface_instance_skia.cc.
|
overridevirtual |
The width of the underlying surface.
Implements flutter::testing::DlSurfaceInstance.
Definition at line 163 of file dl_test_surface_instance_skia.cc.
References GetSurface().