#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 53 of file dl_test_surface_instance_impeller.cc.
References surface.
|
explicit |
Definition at line 60 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 80 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 101 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 91 of file dl_test_surface_instance_impeller.cc.
|
overridevirtual |
The height of the underlying surface.
Implements flutter::testing::DlSurfaceInstance.
Definition at line 167 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 95 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 159 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 136 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 126 of file dl_test_surface_instance_impeller.cc.
References context, impeller::AiksContext::GetContext(), and impeller::testing::Screenshotter::MakeScreenshot().
|
overridevirtual |
The width of the underlying surface.
Implements flutter::testing::DlSurfaceInstance.
Definition at line 163 of file dl_test_surface_instance_impeller.cc.
References impeller::RenderTarget::GetRenderTargetSize(), and impeller::TSize< T >::width.