107 Commits

Author SHA1 Message Date
Jason Simmons
220c7b0618 Build display lists from SkParagraph output using the ParagraphPainter interface (flutter/engine#37087)
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.
2022-11-11 16:39:23 +00:00
Jonah Williams
326f54412c [Impeller] null check samplers (flutter/engine#37489)
* [Impeller] null check sampler and assert in Paint

* ++

* ++

* ++

* ++

* Update fragment_shader_test.dart

* ++

* TESTING

* ++

* TESTING

* ++

* ++

* ++

* ++

* ++

* ++

* ++

* ++

* ++

* ++

* ++

* ++

* remove debugging code

* ++

* ++
2022-11-11 01:27:18 +00:00
Kaushik Iska
5b9e42523e [Reland] Add rects to accumulator rather than bounds (#37435) (flutter/engine#37451)
* [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
2022-11-09 10:57:29 +00:00
Kaushik Iska
2155c6ce00 Revert "Add rects to accumulator rather than bounds (#37435)" (flutter/engine#37444)
This reverts commit 10da0743a513f0ae3ae5afb5a6bd99350b881989.
2022-11-08 18:10:14 -05:00
Kaushik Iska
10da0743a5 Add rects to accumulator rather than bounds (flutter/engine#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
2022-11-08 19:09:49 +00:00
Michael Ludwig
83e1fc90e2 Update display_list_image_filter_unittests to be permit Skia roll (flutter/engine#37327)
* 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.
2022-11-08 02:22:00 +00:00
Dan Field
21cc000359 Revert "Reland layer state stack" (flutter/engine#37178) 2022-10-31 18:56:18 +00:00
Jim Graham
df85a4f401 Reland layer state stack (flutter/engine#37135) 2022-10-30 18:30:22 +00:00
Jim Graham
8ed073eb54 Revert layer state stack (flutter/engine#37090)
* 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.
2022-10-27 15:29:58 -07:00
Jason Simmons
709c6735fc Fix a clang-tidy warning in display_list_canvas_unittests.cc (flutter/engine#37062) 2022-10-26 17:31:03 -07:00
Jim Graham
501916deb1 Create a mechanism to manage layer state (flutter/engine#36458) 2022-10-26 21:43:10 +00:00
gaaclarke
cb4c9f4727 Clang-tidy: made verbose print out commands and fixed quoting problem for warnings as errors (flutter/engine#37015) 2022-10-26 08:19:12 +00:00
Jonah Williams
ffff2c1c37 Remove expensive trace events (flutter/engine#36989) 2022-10-25 21:13:14 +00:00
Brandon DeRosier
b280eb4777 [Impeller] Copy uniforms before appending them to the DisplayList (flutter/engine#36981) 2022-10-25 03:58:23 -07:00
Jason Simmons
993c84dfcb Remove use of SkFunctionWrapper from display_list (flutter/engine#36931) 2022-10-21 19:14:23 +00:00
Brandon DeRosier
05cdbafd70 [Impeller] Add DlRuntimeEffect, pipe RuntimeStage through the DL (flutter/engine#36708) 2022-10-14 14:46:28 -07:00
Jason Simmons
0faaa9756f Apply path effects from a DlPaint to a DisplayListBuilder (flutter/engine#36669) 2022-10-10 22:29:19 +00:00
Jason Simmons
f763f1b96f Convert a dart:ui Paint to a DisplayList DlPaint (flutter/engine#36629) 2022-10-07 17:29:49 +00:00
gaaclarke
e41c775200 Removed instances of unnecessary values (flutter/engine#36221) 2022-09-26 21:28:04 +00:00
Brandon DeRosier
3dda74eed7 Implement local matrix filter (flutter/engine#36309) 2022-09-21 13:12:19 -07:00
Chris Bracken
b84473ce93 [lint] Update local variable names in display_list (flutter/engine#36097)
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.
2022-09-12 17:33:22 -07:00
Dan Field
08312a825e Lint and fix bugprone-use-after-move violations (flutter/engine#35978) 2022-09-09 02:41:03 +00:00
Callum Moffat
ce10462a1d Fix crash on ImageFilter.blur with very small sigma (flutter/engine#35890) 2022-09-09 00:14:57 +00:00
xiaomiao
56505ea5ef Add function restoreToCount to Canvas. (flutter/engine#35798) 2022-09-01 13:09:02 +00:00
Dan Field
fd9fdbf6b8 Support deferred GPU images in ImageShaders (flutter/engine#35323) 2022-08-18 23:12:11 +00:00
JsouLiang
924a207dde Use DlImageFilter for ImageFilterLayer (flutter/engine#34837) 2022-08-16 19:24:48 +00:00
Jim Graham
5f9579eae8 Display list multiplexer (flutter/engine#35421) 2022-08-16 05:34:52 +00:00
Jim Graham
6dc961e278 add missing break statements in makeWithLocalMatrix (flutter/engine#35346) 2022-08-11 18:26:16 +00:00
JsouLiang
35e4972207 optimize out unnecessary save restore pairs (flutter/engine#34967)
* 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
2022-08-11 15:48:40 +08:00
JsouLiang
073693e034 Create DlLocalMatrixImageFilter (flutter/engine#34878) 2022-08-11 07:44:51 +00:00
ColdPaleLight
2077ba5ed2 Make 'DlImageColorSource' work with 'DlImage's (flutter/engine#35258) 2022-08-10 05:47:06 +00:00
ColdPaleLight
0589683136 Change the time unit of 'DisplayListBuilderBenchmarks' to 'kMicrosecond' (flutter/engine#35228) 2022-08-08 17:32:05 +00:00
Jim Graham
e41e8bd0c7 add check to prevent using DLCanvasRecorder after Build (flutter/engine#35172) 2022-08-08 06:09:04 +00:00
Jim Graham
74e390f3d4 fix typos buider -> builder (flutter/engine#35104) 2022-08-02 22:58:03 +00:00
ColdPaleLight
cbda16b4b4 Create benchmarks for DisplayListBuilder (flutter/engine#34910) 2022-07-29 18:56:02 +00:00
Jason Simmons
eeaa43b4ba Roll Clang and Abseil (flutter/engine#34953) 2022-07-28 22:08:04 +00:00
Jim Graham
7af36e613b Fix the best guess results from DlComposeImageFilter with unbounded children (flutter/engine#34956) 2022-07-28 04:48:03 +00:00
ColdPaleLight
b204f9ddbe Make ui.Canvas.getDestinationClipBounds works with matrix (flutter/engine#34835) 2022-07-28 03:23:04 +00:00
Jim Graham
0f8e7ddf2a Rtree from displaylist (flutter/engine#34809) 2022-07-21 19:56:04 +00:00
Brandon DeRosier
b14c460a7a [Impeller] Copy user indices directly into buffer for DrawVertices (flutter/engine#34792) 2022-07-20 21:04:04 +00:00
Jim Graham
178d113afe move definition of DLOpFlags to matching .cc file (flutter/engine#34674) 2022-07-19 22:02:03 +00:00
Kaushik Iska
9103a4992e [impeller] Fix linkage issue when impeller_enable_vulkan = true (flutter/engine#34763) 2022-07-19 18:54:03 +00:00
Jim Graham
acc31da24e Remove canvas render test skia bug workarounds (flutter/engine#34513) 2022-07-13 19:46:05 +00:00
Jim Graham
f30c24ccb3 fix empty bounds for flat sets of drawPoints (flutter/engine#34430) 2022-07-01 21:09:04 +00:00
Jim Graham
8168381dad Reland "render BackdropFilter layers directly to DisplayListBuilder" (flutter/engine#34381) 2022-06-29 22:26:04 +00:00
Jim Graham
fda51f006d Revert "Reland "render BackdropFilter layers directly to DisplayListBuilder"" (flutter/engine#34367) 2022-06-29 18:42:06 +00:00
Jim Graham
8986613de1 Reland "render BackdropFilter layers directly to DisplayListBuilder" (flutter/engine#34337) 2022-06-27 23:44:03 +00:00
Jim Graham
33f417d7d8 Revert "render BackdropFilter layers directly to DisplayListBuilder (#34146)" (flutter/engine#34334)
This reverts commit 7dffa322971112332579563b5df97186010a06c2. Landing on red to fix the build.
2022-06-27 14:46:52 -07:00
Jim Graham
7dffa32297 render BackdropFilter layers directly to DisplayListBuilder (flutter/engine#34146) 2022-06-27 20:44:09 +00:00
Dan Field
3724bc6427 Implement toGpuImage, a synchronous, GPU-resident version of (flutter/engine#33736)
* 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.
2022-06-24 16:14:42 -07:00