Jason Simmons
acdca87356
Reland "Update all uses of mutable SkPath methods to use SkPathBuilder" ( #178142 )
...
This is a reland of https://github.com/flutter/flutter/pull/177738 with
a fix to the `Op` function in `tools/path_ops`.
To match the previous behavior, `Op` will use `SkPathBuilder::operator=`
to copy the result path so that attributes like the fill type will be
copied.
---------
Co-authored-by: Kaylee Lubick <kjlubick@users.noreply.github.com>
2025-11-07 16:36:27 +00:00
auto-submit[bot]
1d7845ae00
Reverts "Update all uses of mutable SkPath methods to use SkPathBuilder ( #177738 )" ( #178125 )
...
<!-- start_original_pr_link -->
Reverts: flutter/flutter#177738
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: chingjun
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: Broke internal tests. Some shapes are not drawn.
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: kjlubick
<!-- end_original_pr_author -->
<!-- start_reviewers -->
Reviewed By: {jason-simmons}
<!-- end_reviewers -->
<!-- start_revert_body -->
This change reverts the following previous change:
Skia is removing the APIs that allow changing an SkPath. This updates
those callsites to use SkPathBuilder where appropriate.
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code ).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
<!-- end_revert_body -->
Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
2025-11-06 19:50:19 +00:00
Kaylee Lubick
6925f8b815
Update all uses of mutable SkPath methods to use SkPathBuilder ( #177738 )
...
Skia is removing the APIs that allow changing an SkPath. This updates
those callsites to use SkPathBuilder where appropriate.
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code ).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-11-06 14:46:25 +00:00
Kaylee Lubick
96fe3e27c7
Change Flutter APIs to use spans ( #177272 )
...
Some old APIs are currently guarded by `SK_SUPPORT_UNSPANNED_APIS` and
Skia plans to delete them (for example in this
[CL](https://skia-review.googlesource.com/c/skia/+/1073616 )). This
updates Flutter calls to use the new APIs (by wrapping the pointers and
counts together) and removes the define to avoid backsliding.
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code ).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-10-23 19:08:18 +00:00
Jason Simmons
879d0fbc44
Manual roll Skia to c501c727a007 ( #177015 )
...
Includes updates for the removal of SkApplyPerspectiveClip
2025-10-15 21:17:08 +00:00
Jason Simmons
fc4c9b93ce
Roll GN to 81b24e01 ( #176119 )
...
This version contains a change that adds support for the hpp11 file
suffix (see
https://gn.googlesource.com/gn/+/487f8353f15456474437df32bb186187b0940b45 )
The change is needed when using current versions of the vulkan-deps
SPIR-V headers.
2025-09-30 00:57:09 +00:00
Jim Graham
dc56bc26bb
Revert "[Impeller] Optimize scale translate rectangle transforms" ( #176161 )
...
Reverts flutter/flutter#176123
2025-09-28 13:41:39 +00:00
Jim Graham
987d01d28c
[Impeller] Optimize scale translate rectangle transforms ( #176123 )
...
Taken partially from https://github.com/flutter/flutter/pull/170446 with
only the changes to add a ScaleTranslate rectangle transform method
brought over. Unlike the original PR, this PR will apply that optimized
method for any caller who transforms a rectangle rather than just the
matrix/clip tracker for the engine layer tree code.
A benchmark for the new methods is also provided to verify their
improved performance.
2025-09-27 18:49:16 +00:00
Jim Graham
1feda71ccd
Revert "[Impeller] Optimize scale translate rectangle transforms" ( #176061 )
...
Reverts flutter/flutter#171841
There appear to have been some golden file changes that disappeared as
the change was further tested and are now causing problems.
2025-09-26 00:46:44 +00:00
Jim Graham
6cc976ec26
[Impeller] Optimize scale translate rectangle transforms ( #171841 )
...
Taken partially from https://github.com/flutter/flutter/pull/170446 with
only the changes to add a ScaleTranslate rectangle transform method
brought over. Unlike the original PR, this PR will apply that optimized
method for any caller who transforms a rectangle rather than just the
matrix/clip tracker for the engine layer tree code.
A benchmark for the new methods is also provided to verify their
improved performance.
2025-09-25 19:50:09 +00:00
Chinmay Garde
df8e02d5b8
Depend on operator overload synthesis for three-way and equality comparisons. ( #174892 )
...
This depends on the implicitly generated `operator!=` from `operator==`
in a few cases (see the exceptions below) and add `operator<=>` in some
of the more obvious instances.
I've tried to be extremely conservative in this first pass. There are a
few more candidates that were not converted because:
* `operator!=` was different from `!operator=.` For instance, if it had
early returns. Not sure how the compiler generated those and didn't want
the behavior or performance characteristics to change.
* They were virtual.
* `operator==` didn't actually compare all struct members. Dubious but I
didn't want to change existing behavior.
* There were template parameters.
2025-09-08 19:15:26 +00:00
Chinmay Garde
c6f2de7aba
Build engine TUs with C++20. ( #174471 )
...
The changes:
* Creating a bit-mask with different enum values is now a warning. Fixed
offending instances.
* `char8_t` is a different type. Fixed those instances.
* Disabling modules in Objective-C requires bypassing the driver.
* Aggregate initialization fails when there are other constructors for
structs. Added explicit constructors.
* `gn format` doesn't seem to be run on erstwhile buildroot GN files.
Fixes the formatting. But can back this out since it is technically
unrelated to C++20.
2025-09-02 18:31:21 +00:00
Jackson Gardner
3340caed81
[skwasm] Port to DisplayList objects ( #172314 )
...
This PR refactors the skwasm renderer to use `DisplayList` objects as
its main model objects instead of using Skia objects directly. Then, at
render time, we dispatch the display list commands to the skia surface.
This is a preparatory step for impeller on web.
* Some build rules were reworked in order to allow `DisplayList` to
compile via emscripten
* Some pieces of the display list library were further refactored to
allow us to compile it without actually building and linking the
impeller shaders. The two major classes that needed to be separated out
were `DlRuntimeEffect` and the text drawing system.
* `SkPath` and `SkImage` are still used as the main model objects in
skwasm. As of right now, `DisplayList` just thinly wraps these objects,
so this is the minimal possible change for now. I will have to refactor
this somewhat further when preparing for actual impeller adoption.
* Several special cased code paths in skwasm were removed, as they are
taken care of by `DisplayList` itself. This includes shadow drawing,
determining when to enable dithering, and determining the right clamp
value for filters.
2025-08-25 16:08:33 +00:00
Jackson Gardner
a24dbd551f
Refactor text and runtime effect to separate skia and impeller implementations. ( #174219 )
...
This makes two refactors to the display list architecture:
* The concrete implementations of `DlRuntimeEffect` for skia and
impeller are separated, and the impeller implementation put into the
`impeller/display_list` target. This makes sure that a client can link
against the main `display_list` library without actually pulling in all
of impeller. (This is needed for
https://github.com/flutter/flutter/pull/172314 )
* The `DrawTextBlob` and `DrawTextFrame` methods are consolidated into
one `DrawText` call, and that takes a `DlText` object. The `DlText`
object has two implementations, one for skia and one for impeller, and
the impeller one is moved into `impeller/display_list` for the same
reason mentioned above.
2025-08-22 19:53:39 +00:00
Jason Simmons
f45a8f8b71
Roll Clang to 8c7a2ce01a77c96028fe2c8566f65c45ad9408d3 ( #173429 )
...
This version is currently used by Dart.
2025-08-12 17:21:53 +00:00
Florin Malita
d3ecde6575
Remove a couple of asserts from display_list_unittest ( #173381 )
...
Skia is updating some of the semantics around SkPath simple shape
inference [1]. Specifically, degenerate rounded rects are to be
reflected as simple rects instead of rrects.
The display list assertions should be sufficient for these tests.
This PR unblocks the Skia-side change.
[1] https://skia-review.googlesource.com/c/skia/+/1031900
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
2025-08-07 20:55:23 +00:00
Jim Graham
37736df671
Migrate surface frame shell code to DisplayList/Impeller geometry classes ( #173086 )
...
Converting a large variety of classes involved in tracking surfaces,
frames, surface damage, etc. to using the DisplayList/Impeller geometry
classes.
Addresses a bullet item in
https://github.com/flutter/flutter/issues/161456
---------
Co-authored-by: Reid Baker <1063596+reidbaker@users.noreply.github.com>
2025-08-04 19:20:19 +00:00
Jim Graham
9e82be4b15
Migrate Embedder code to impeller/DL geometry classes ( #172804 )
...
Ticks off another checkbox in
https://github.com/flutter/flutter/issues/161456
2025-07-29 00:21:10 +00:00
Jim Graham
3deedd23cd
[DisplayList] implement shadow bounds without relying on Skia utilities ( #172572 )
...
Right now DisplayList defers to Skia to compute the bounds of shadow
operations, but we really need to own this code now that we are doing
our own rendering so I ported it over and simplified it to just deal
with the cases we care about.
Eliminates a bullet item in
https://github.com/flutter/flutter/issues/161456
2025-07-23 15:20:31 +00:00
Kaylee Lubick
81e1d5ec26
[skia] Add missing param to makeRasterImage calls ( #172122 )
...
Skia's makeRasterImage takes a (now required) `GrDirectContext` param.
This updates Flutter to provide something there - either nullptr or a
context that seemed to be related.
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-07-15 22:16:00 +00:00
Jason Simmons
5285cbb750
Clamp the alpha channel to the valid range in the DlColor constructor ( #171203 )
2025-06-26 20:58:55 +00:00
Jason Simmons
12e4a898dc
Support wide gamut colors when applying a DlColor to an SkPaint ( #170613 )
...
Fixes https://github.com/flutter/flutter/issues/170203
2025-06-24 17:06:07 +00:00
Jonah Williams
85824038d0
[ui] npot display_list allocation. ( #170447 )
...
Split off of https://github.com/flutter/flutter/pull/168019/
Worst case allocation performance for dl is fairly bad as we end up
copying the data many more times than something like an STL vector
would. At the cost of more memory usage, we can improve the case where
the display list grows quite large.
2025-06-17 22:06:32 +00:00
Jim Graham
ba56e065a9
[Impeller] eliminate PathReceiver::PathEnd which is only used in one case ( #170500 )
...
Fixes: https://github.com/flutter/flutter/issues/169719
2025-06-14 21:01:09 +00:00
Tong Mu
a686424995
[Impeller] Use StrokePathSourceGeometry to stroke RoundSuperellipse ( #169704 )
...
This PR creates a new class, `StrokeRoundSuperellipseGeometry`, which
reuses the `StrokePathSourceGeometry` class to stroke rounded
superellipses.
Fixes https://github.com/flutter/flutter/issues/168419 .
Filling is unchanged. I could have used `FillPathSourceGeometry` for
non-uniform filling just like RRect, but I've decided not to after some
experimentation, mostly because the `RoundSuperellipseGeometry` class
wouldn't be simplified from uniformity as much as we hope for. This
might be worthwhile if one day we move the filling code to `Tessellator`
(just like `FilledRoundRect`), which reuses much existing code. But
that's out of the scope for now.
## Pre-launch Checklist
- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-06-03 23:27:21 +00:00
Chinmay Garde
d2e4017f81
Add support for arm64 QNX toolchains. ( #168699 )
...
The pattern is similar to the recently added WASM (and previously NACL)
toolchains.
The major change is the engines use of functions that became constexpr
in C++26 (such as
[sqrt](https://en.cppreference.com/w/cpp/numeric/math/sqrt )) as if they
were already constexpr. I have attempted to keep the linkage the same
and am investigating how to enable this form of checking with our own
toolchain.
2025-06-03 16:13:12 +00:00
Jim Graham
cdd6be4798
[Impeller] Delete redundant impeller path classes ( #168760 )
...
Nearly all parts of the Impeller rendering pipeline now rely on DlPath
and PathSource objects for their path description needs. The impeller
path only exists for impeller's unit tests and benchmarks to have a
local way to construct paths. We implement path construction for the
DlPath object via DlPathBuilder which makes the impeller family of path
objects functionally obsolete and so they are now deleted.
2025-05-15 18:42:23 +00:00
Jonah Williams
b443c2a97a
[display_list] paint cleanup. ( #168082 )
...
Reduce the number of places where we convert flutter paint to DLpaint
and remove unused tonic overrides. Also does a pass on dl_paint/builder
to remove places we accidentally incremented/decrement shared_ptr ref
counts
2025-05-15 01:53:18 +00:00
Jim Graham
8ee8eaa66e
delete stale references/includes to classes no longer used ( #168616 )
...
Simple code pruning. While scanning the sources for unused code I found
a few stale references to classes that were already no longer being
used.
2025-05-10 09:02:17 +00:00
Jim Graham
e7e19fb5bd
Impeller will stroke paths directly from the original path via iteration ( #167422 )
...
Currently stroking paths in Impeller goes through a few steps:
- [Once per path object, if reused] If necessary, convert a source Skia
path to an Impeller path
- Ask the Impeller path object to create a polyline, with only line
segments each potentially marked as "coming from a curve"
- Widen the polyline treating curves specially
- render the widened vertex list
This PR attempts to streamline that process by iterating the original
curve and widening the strokes from that. It will require no conversion
of the path from SkPath to impeller::Path (if it was created as an
SkPath as is done for all ui.Path objects). It also avoids the
intermediate polyline stage. It will also produce fewer outline vertices
since it attempts to recognize which vertices are produced by the prior
and future line segments and avoid duplicating them.
2025-04-25 18:18:09 +00:00
Tong Mu
83483976ec
[Impeller] Adds oval shortcut to DisplayListMatrixClipState::clip{RRect,RSuperellipse} ( #164519 )
...
Fixes https://github.com/flutter/flutter/issues/163717
## Pre-launch Checklist
- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-04-24 21:00:56 +00:00
gaaclarke
90b37bf053
Broke cyclical dependency with dlpath and typographer. ( #167293 )
...
fixes https://github.com/flutter/flutter/issues/166593
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-04-16 20:12:32 +00:00
Jim Graham
06c572c730
[Impeller] Tessellate paths directly using PathReceiver ( #166759 )
...
Currently Impeller asks incoming paths to convert themselves into the
impeller::Path class before tessellating their outlines. This wastes
conversion time when the path is only needed to iterate the path
segments. We now tessellate them directly from a path segment dispatcher
saving the conversion cost.
2025-04-09 22:11:16 +00:00
Jim Graham
790d1b1d9a
Relands "[Impeller] Render conics without conversion from Flutter apps ( #166305 )" ( #166598 )
...
Reverts flutter/flutter#166591
Golden diffs were not discovered the first time this was submitted.
Re-submitting to double check the goldens.
2025-04-04 20:47:09 +00:00
Jonah Williams
f00d387cb8
[Impeller] if drawTextFrame scale is massive, convert to Path. ( #166234 )
...
Fixes https://github.com/flutter/flutter/issues/165583
Fixes https://github.com/flutter/flutter/issues/136112
If the text scale gets too big, its faster (and higher res) to switch to
path rendering than to keep using the glyph atlas cache.
2025-04-04 20:28:25 +00:00
auto-submit[bot]
b1c08092d0
Reverts "[Impeller] Render conics without conversion from Flutter apps ( #166305 )" ( #166591 )
...
<!-- start_original_pr_link -->
Reverts: flutter/flutter#166305
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: gaaclarke
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: Integration golden test failures. Please reland it
this and address golden diffs.
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: flar
<!-- end_original_pr_author -->
<!-- start_reviewers -->
Reviewed By: {jonahwilliams}
<!-- end_reviewers -->
<!-- start_revert_body -->
This change reverts the following previous change:
Now that Impeller performs high fidelity tessellation of Conic curves we
will no longer convert Flutter app's conic curves into approximated
quadratic curves.
<!-- end_revert_body -->
Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
2025-04-04 17:10:47 +00:00
Jim Graham
cb0e649e78
[Impeller] Render conics without conversion from Flutter apps ( #166305 )
...
Now that Impeller performs high fidelity tessellation of Conic curves we
will no longer convert Flutter app's conic curves into approximated
quadratic curves.
2025-04-03 20:06:23 +00:00
gaaclarke
25f7c15dd7
Started pixel aligning hairlines ( #166351 )
...
fixes https://github.com/flutter/flutter/issues/162378
builds from: https://github.com/flutter/flutter/pull/165079
gets rid of the line artifacts in
https://github.com/flutter/flutter/issues/165689
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-04-02 21:28:58 +00:00
Tong Mu
f2e0a2afb3
[dart:ui] Add Path.addRSuperellipse ( #166045 )
...
This PR adds `Path.addRSuperellipse` to `dart:ui`. This is needed to
implement a parity class to `RoundedRectangleBorder` as discussed
[here](https://github.com/flutter/flutter/pull/164857#issuecomment-2715637356 ).
<details>
<summary>
Obsolete description, no longer applicable
</summary>
I want to reuse the existing algorithm created for impeller stroking.
The existing algorithm is moved from `path_builder.cc` to
`round_superellipse_param.cc`, and a delegated is added so that the same
algorithm can output for different path classes.
I'm not 100% sure this is _the_ best way to implement this, but I've
tried some methods in vain.
* `DlPathReceiver` added in
https://github.com/flutter/flutter/pull/164753 sounds like a similar
concept as the delegate created in this PR. I tried to use that but not
only are the methods private, they're neither in an accessible
directory.
* I also thought of converting an impeller `Path` to a skia path, but it
seems that the impeller path isn't designed to be traversed.
* Another possibility is that we refactor impeller stroking to be based
on the triangles instead of path, a direction we agreed to eventually
move toward, which allows avoiding code share at all. I've briefly read
the code in `StrokePathGeometry` and have some ideas but also something
uncertain, so I didn't choose this path for now.
</details>
## Pre-launch Checklist
- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-04-02 21:27:08 +00:00
gaaclarke
84cd384682
Implements anti-aliased lines ( #164734 )
...
issue: https://github.com/flutter/flutter/issues/138682
design doc:
https://docs.google.com/document/d/19I6ToHCMlSgSava-niFWzMLGJEAd-rYiBQEGOMu8IJg/edit?tab=t.0
This puts an experimental line drawing approach behind the following
flags:
- iOS: `FLTAntialiasLines` boolean, default NO
- Android: `io.flutter.embedding.android.ImpellerAntialiasLines`
boolean, default false
Right now they just support DrawLines and don't support line caps.
A test was added that works as a playground for vulkan, opengles and
metal. Only the Metal version was turned into a golden test though here.
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-03-24 17:32:11 +00:00
Jim Graham
e6fbc63d37
[Impeller][DisplayList] Consolidate BlendMode definitions ( #165450 )
...
The 2 enum classes `impeller::BlendMode` and `flutter::DlBlendMode` were
essentially identical so they were merged.
The names were consolidated to the ui.BlendMode/DlBlendMode versions and
the implementation is shared from Impeller to DisplayList via a `using`
directive. No conversion is needed any more to describe blend modes
between DisplayList and Impeller.
2025-03-20 05:34:06 +00:00
Jim Graham
c4d8870f50
[DisplayList] DlPath supports generic path dispatching ( #164753 )
...
There are different ways to iterate over an SkPath or an impeller::Path
and various points in the engine source tree we have boilerplate
duplicates of this code to transfer the contents of the DlPath wrapper
object into some platform-specific path. This PR adds a
dispatch/receiver mechanism to read back the contents of a DlPath -
independent of whether it is backed by an SkPath or an impeller::Path -
in a simpler form that avoids potential mistakes in the various
conversion methods.
See DlPathReceiver and DlPath::Dispatch in the dl_path.h file
2025-03-18 20:42:06 +00:00
Jim Graham
c5d4edfe9c
[DisplayList] Use internal conversion for opacity->alpha ( #165349 )
...
Removing an unnecessary dependence on an external library for doing
opacity->alpha conversions in DlPaint.
2025-03-18 01:09:13 +00:00
Jim Graham
66e910d27e
Migrate Mutators to DisplayList/Impeller geometry ( #164258 )
...
Mutator types and MutatorsStack will now use DisplayList/Impeller
geometry objects.
2025-03-06 21:27:51 +00:00
Jason Simmons
47a710ba99
Move flutter/third_party/txt into flutter/txt ( #164248 )
...
The flutter/txt library does not currently contain any third-party code.
2025-03-04 16:13:40 +00:00
Jim Graham
f825cccda2
[DisplayList] Delete all legacy Skia-oriented method overloads in DlCanvas ( #164054 )
...
Delete remaining DlCanvas method overloads that were allowing the use of
Skia geometry objects in rendering code.
The only remaining uses of Skia classes in the DlCanvas interface are
SkImageInfo and SkTextBlob.
2025-02-26 00:44:27 +00:00
Tong Mu
5b7a3c8b20
[Engine] Add RoundSuperellipse to drawing OP ( #160883 )
...
This PR adds support for clipping round superellipse to the engine.
For what a rounded superellipse is, see [this design
doc](https://docs.google.com/document/d/1CJXULKJGQt22FOFsrlm2TKVjKBtif1yU4U50cMfL6Kc/edit?tab=t.0 ).
Video demos can be found at https://github.com/flutter/engine/pull/56726
and https://github.com/flutter/flutter/pull/161409 .
Only impeller can actually render it. On Skia and Web, this shape falls
back to `RRect`.
Part of https://github.com/flutter/flutter/issues/139321 and
https://github.com/flutter/flutter/issues/13914 , also related to
https://github.com/flutter/flutter/issues/91523 .
## Pre-launch Checklist
- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-02-21 23:58:26 +00:00
Jim Graham
d0e2fc72bc
[DisplayList] Migrate rendering tests and benchmarks to DL geometry ( #163766 )
...
Migrating the benchmark and rendering tests to using DL geometry with DL
rendering calls.
2025-02-21 00:15:39 +00:00
Jim Graham
99ac47897e
Reland "[Impeller] add support for rational bezier conics to Path ( #63282 )" ( #163645 )
...
Reverts flutter/flutter#163624
Relands https://github.com/flutter/flutter/pull/163282
Add basic support for storing rational bezier conics in impeller::Path.
The support is very thin and just degrades the conics into a pair of
quadratic curves just as Impeller has always done for the conic segments
that it receives via SkPath objects, but it puts in place the framework
for eventually handling the conics more directly and allows the unit
tests to be rewritten on top of Impeller paths rather than SkPaths,
paving the way for reduced internal API dependencies.
2025-02-19 21:54:08 +00:00
Matan Lurey
485c9105fc
Revert "[Impeller] add support for rational bezier conics to Path ( #63282 )" ( #163624 )
...
This reverts commit db0bdfd117077a69f79ce0d4c03ab387a78ef7dd to fix a
tree breakage.
2025-02-19 18:51:42 +00:00