The seam between this package and a GPU that can serve
RenderBackend.residentGpu.
Why a registry, and not a dependency. The resident backend's GPU code
(ResidentGeometry, GpuDrawBackend, the flutter_scene shim they reach
the GPU through) lives in package jet_cad_2d_gpu, so that
flutter_scene and its build hook never enter the build of an app that
depends on this package and never asks for the GPU -- which is every
host. This package keeps everything GPU-free (the collection, the
rebuilder, the compositor, DraftCanvas) and asks the registry, at the
moment a canvas is attached, whether a GPU was installed:
resolveBackend(RenderBackend.residentGpu)givesresidentGpuonly when one is registered and available; otherwisevertices, andDraftCanvasreports the fallback once per process;DraftCanvas's default uploader is the registered one's upload.
An app installs the real one with installResidentGpu() from
package:jet_cad_2d_gpu/jet_cad_2d_gpu.dart, first thing in main.
Tests register a fake and clear it in tearDown.
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
upload(
ResidentCollection collection, Size viewport, {required FlutterTextMeasurer measurer, required TextStyleRecord textStyleOf(Handle)}) → Future< ResidentFramePainter?> -
Uploads
collectionand returns the painter the frame draws through, ornullwhen it cannot (the upload failed, or there is no GPU after all).viewportis the canvas's logical size, the ceiling for the patch targets.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited