#include <dl_test_surface_instance_impeller.h>
Public Member Functions | |
| DlSurfaceInstanceImpeller (std::shared_ptr< impeller::Context > context, std::shared_ptr< impeller::Surface > surface) | |
| DlSurfaceInstanceImpeller (std::shared_ptr< impeller::Context > context, std::shared_ptr< impeller::RenderTarget > surface) | |
| virtual | ~DlSurfaceInstanceImpeller () |
| 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. | |
Public Member Functions inherited from flutter::testing::DlSurfaceInstance | |
| virtual | ~DlSurfaceInstance ()=default |
| DlISize | GetSize () const |
| The size of the underlying surface. | |
| virtual sk_sp< SkSurface > | sk_surface () |
Definition at line 20 of file dl_test_surface_instance_impeller.h.
|
explicit |
Definition at line 51 of file dl_test_surface_instance_impeller.cc.
References surface.
|
explicit |
Definition at line 58 of file dl_test_surface_instance_impeller.cc.
|
virtualdefault |
|
overridevirtual |
Clear the entire surface to the indicated color.
Implements flutter::testing::DlSurfaceInstance.
Definition at line 78 of file dl_test_surface_instance_impeller.cc.
References flutter::DisplayListBuilder::Build(), flutter::DlCanvas::Clear(), and flutter::DisplayListBuilder::IsEmpty().
|
overridevirtual |
Ensure that all outstanding calls executed on the DlCanvas instance are rendered to the surface.
Implements flutter::testing::DlSurfaceInstance.
Definition at line 99 of file dl_test_surface_instance_impeller.cc.
References FML_LOG, and FML_UNREACHABLE.
|
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 89 of file dl_test_surface_instance_impeller.cc.
|
overridevirtual |
The height of the underlying surface.
Implements flutter::testing::DlSurfaceInstance.
Definition at line 164 of file dl_test_surface_instance_impeller.cc.
References impeller::RenderTarget::GetRenderTargetSize(), and impeller::TSize< T >::height.
|
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 93 of file dl_test_surface_instance_impeller.cc.
|
overridevirtual |
Store a snapshot of this Surface to the file indicated by the filename.
Implements flutter::testing::DlSurfaceInstance.
Definition at line 156 of file dl_test_surface_instance_impeller.cc.
|
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 133 of file dl_test_surface_instance_impeller.cc.
References impeller::RenderTarget::GetRenderTargetTexture(), flutter::kNearestNeighbor, impeller::DlImageImpeller::Make(), flutter::testing::DlSurfaceProviderImpeller::MakeOffscreenSurface(), and texture.
|
overridevirtual |
Read back the current contents of the surface and return it as a DlPixelData structure.
Implements flutter::testing::DlSurfaceInstance.
Definition at line 124 of file dl_test_surface_instance_impeller.cc.
References impeller::testing::MetalScreenshotter::MakeScreenshot().
|
overridevirtual |
The width of the underlying surface.
Implements flutter::testing::DlSurfaceInstance.
Definition at line 160 of file dl_test_surface_instance_impeller.cc.
References impeller::RenderTarget::GetRenderTargetSize(), and impeller::TSize< T >::width.