[Impeller] Supply surface cull rect for Vulkan & GLES dispatchers (flutter/engine#43152)

Similar to Metal, have the DL cull entities early that lie entirely
outside the surface texture.
This commit is contained in:
Brandon DeRosier
2023-06-24 15:46:14 -07:00
committed by GitHub
parent 2b036c1e4e
commit c85223dc95
2 changed files with 12 additions and 2 deletions

View File

@@ -103,8 +103,13 @@ std::unique_ptr<SurfaceFrame> GPUSurfaceGLImpeller::AcquireFrame(
return false;
}
auto cull_rect =
surface->GetTargetRenderPassDescriptor().GetRenderTargetSize();
impeller::DlDispatcher impeller_dispatcher;
display_list->Dispatch(impeller_dispatcher);
display_list->Dispatch(
impeller_dispatcher,
SkIRect::MakeWH(cull_rect.width, cull_rect.height));
auto picture = impeller_dispatcher.EndRecordingAsPicture();
return renderer->Render(

View File

@@ -72,8 +72,13 @@ std::unique_ptr<SurfaceFrame> GPUSurfaceVulkanImpeller::AcquireFrame(
return false;
}
auto cull_rect =
surface->GetTargetRenderPassDescriptor().GetRenderTargetSize();
impeller::DlDispatcher impeller_dispatcher;
display_list->Dispatch(impeller_dispatcher);
display_list->Dispatch(
impeller_dispatcher,
SkIRect::MakeWH(cull_rect.width, cull_rect.height));
auto picture = impeller_dispatcher.EndRecordingAsPicture();
return renderer->Render(