SkPaint does not provide APIs for extracting the definitions of some
attributes such as filters. The engine will instead use DlPaint
to describe how text foregrounds and backgrounds will be painted.
The DlPaint objects will be represented as PaintIDs in SkParagraph text
styles. The ParagraphPainter will then map the PaintIDs back to the
original DlPaint objects.
* [Reland] Add rects to accumulator rather than bounds (#37435)
When the accumulator is an `RTreeBoundsAccumulator` rather than a `RectBoundsAccumulator` just accumulating the bounds results in incorrect results as the `rtree` would need to be aware of the constituent non-overlapping rectangles. This would work fine for `RectBoundsAccumulator` as it would just adjust its bounds based on the passed rects.
Fixes: https://github.com/flutter/flutter/issues/113251
* Add a test for nested display list rtree
When the accumulator is an `RTreeBoundsAccumulator` rather than a `RectBoundsAccumulator` just accumulating the bounds results in incorrect results as the `rtree` would need to be aware of the constituent non-overlapping rectangles. This would work fine for `RectBoundsAccumulator` as it would just adjust its bounds based on the passed rects.
Fixes: https://github.com/flutter/flutter/issues/113251
* Update display_list_image_filter_unittests to be permit Skia roll
https://skia-review.googlesource.com/c/skia/+/571798 had to be reverted because it causes DisplayListImageFilter.LocalImageFilterBounds to fail. With SkMatrixTransformImageFilter (returned by SkImageFilters::MatrixTransform) supporting complex matrices, makeWithLocalMatrix(rotation) will no longer return null.
This is at odds with the behavior of DlImageFilter's implementation which tries to mimic the existing behavior of image filters. This relaxes the test case so that Skia can improve its implementation without breaking Flutter's tests. Flutter can then update DlImageFilter to match out-of-band.
* Update comment to reference flutter issue.
* Revert "Fix a clang-tidy warning in display_list_canvas_unittests.cc (#37062)"
This reverts commit 709c6735fc7ed34df36cee23805bdaa7f6969774.
* Revert "Create a mechanism to manage layer state (#36458)"
This reverts commit 501916deb19a8303ca2a3a9bb37692a873d4679e.
This updates local variable names to use clang `lower_case` style in the
display_list directory. This is one of several patches to update our
variable names to a consistent style before enabling enforcement in our
clang-tidy rules.
This is a formatting-only change with no intended semantic change.
* drafting the solution to optimize out unnecessary save restore pairs
* remove unnecessary save/restore pairs
* delete the calculator change;
* fix some logic; Add some testcases
* Add test for set DlPaint
* update test cases
* Prune TranslateTriggersDeferredSave unittest
* Implement toGpuImage, a synchronous, GPU-resident version of
Picture.toImage.
This method kicks off asynchronous work on the raster task runner.
If it fails to rasterize, it will synchronously throw later when
the user attempts to draw to a canvas.
This supports several use cases:
- Quickly snapping off an expensive-to-rasterize image for reuse
across multiple frames.
- Applying multi-pass filters to a render target.
This patch amends flutter_tester so that it can produce an image
object, but that image will always be a grey and white four square checkerboard.
Adds support for CanvasKit on Web, which basically already used
this method for its Picture.toImage implementation.
Throws an UnsupportedError for HTML on Web, since any implementation
there would almost certainly be slower than drawPicture.