2595 Commits

Author SHA1 Message Date
Chinmay Garde
08b52b491b [Impeller] libImpeller: Tinker on the README to cross reference the SDK and the example. (flutter/engine#56623) 2024-11-15 20:21:17 +00:00
gaaclarke
11123f1bbf Added assert for opengles thread safety (flutter/engine#56585)
This assert would have blocked the following bug:
https://github.com/flutter/flutter/issues/158535

This shouldn't be landed until
https://github.com/flutter/engine/pull/56573 lands.

## 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] and the [C++,
Objective-C, Java style guides].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [ ] I added new tests to check the change I am making or feature I am
adding, or the PR is [test-exempt]. See [testing the engine] for
instructions on writing and running engine tests.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I signed the [CLA].
- [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/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2024-11-15 10:22:46 -08:00
Jason Simmons
6e15260a8c [Impeller] Maintain separate queues of GLES operations for each thread in the reactor (flutter/engine#56573)
Threads that add operations to the ReactorGLES assume that those operations will be executed serially.

But prior to this change, the ReactorGLES added all operations into one queue.  The reactor would then execute those operations on any thread that can react. This could cause operations that were added to the reactor on the raster thread to be submitted to the GPU on the IO thread (or vice versa).
The reactor does not wait for the GPU to finish execution of those operations.  So other operations added on the raster thread could be submitted by a reaction before the GPU has completed the operation that was submitted on the IO thread.

This PR ensures that operations added to the reactor on a given thread will be executed during a reaction on that same thread.  If the thread can not currently react, then the operations will be queued until the thread enables reactions.

This also adds a call to CommandBuffer::WaitUntilScheduled to ImageDecoderImpeller.  This ensures that the command buffer submitted on the IO thread is flushed before the image is returned.

Fixes https://github.com/flutter/flutter/issues/158535
Fixes https://github.com/flutter/flutter/issues/158388
Fixes https://github.com/flutter/flutter/issues/158390
2024-11-15 16:19:56 +00:00
Chinmay Garde
1c9aa9544f [Impeller] Don't enable KHR_debug on Angle. (flutter/engine#56601)
All it does it log the calls and overwhelms the output for no utility.

<img width="651" alt="Screenshot 2024-11-14 at 3 53 54 PM" src="https://github.com/user-attachments/assets/b2de0d71-6263-4f00-94a0-73a5c0d0135d">
2024-11-15 01:33:32 +00:00
Chinmay Garde
3c5bf78a62 [Impeller] libImpeller: Reset the GL state when transitioning control back to the embedder. (flutter/engine#56597)
Impeller is resilient to OpenGL state being trampled upon when accessing the GL context. But the embedder may not necessarily be. Ideally, we'd be using saving the state and restoring it. But that might be too involved. For now, this sets the GL state to a sane "clean" state.

We could, in theory, do this after each render pass but that unnecessarily increases API traffic. For now, I have added it at the transition of the embedder boundary.
2024-11-15 00:14:23 +00:00
Chinmay Garde
bd53bd0671 [Impeller] Put test components in the testing namespace. (flutter/engine#56594)
Minor change for clarity. I went looking for how we used the recording render pass since it was not in the testing namespace.
2024-11-14 23:52:19 +00:00
Chinmay Garde
6b172110e6 [Impeller] libImpeller: Add a warning about OpenGL state being trampled. (flutter/engine#56599) 2024-11-14 23:40:07 +00:00
Jonah Williams
bf4d90a46b [Android] choose 24 bit depth buffer. (flutter/engine#56553)
Fixes https://github.com/flutter/flutter/issues/158531

Make sure the onscreen framebuffer has a depth attachment that matches the depth24_s8 format expected.
2024-11-14 02:28:05 +00:00
Jonah Williams
9442880f22 [Impeller] force software resize usage for GLES backend. (flutter/engine#56511)
Should fix some of the wonderous bugs by avoiding the usage of gl blitframebuffer altogether.

Fixes https://github.com/flutter/flutter/issues/158391
2024-11-14 02:10:54 +00:00
Chinmay Garde
655a5d5947 [Impeller] Wrap provided FBO instead of defaulting to FBO0 and cleanup/document the texture API. (flutter/engine#56543)
Previously, the FBO argument was dropped on the floor.

The API was also confusing as the Android subsystems were using the IsWrapped call to sidestep texture contents initialization without actually performing any wrapping.

Now, there are separate and documented calls to wrap a texture, wrap a framebuffer (as a texture), and to create a placeholder texture.

Callers can also mark any texture as being initialized out of band instead of depending on overloading the meaning of IsWrapped.

Fixes https://github.com/flutter/flutter/issues/158486
2024-11-13 00:59:18 +00:00
Jason Simmons
f03f05b51a [Impeller] In canvas_unittests, only create an MSAA offscreen texture if the platform supports MSAA (flutter/engine#56542) 2024-11-12 21:09:50 +00:00
Chinmay Garde
e6c61d2570 [Impeller] Add OpenGL debugging utilities. (flutter/engine#56515)
* CheckFramebufferStatus needs to be called with the enum for the target type and not the target itself.
* Fix dumping the framebuffer type and object name.

The results should be the following for the default FBO0.
```
[IMPORTANT:flutter/impeller/renderer/backend/gles/render_pass_gles.cc(281)] The default framebuffer (FBO0) was bound.
```

and the following for an offscreen framebuffer:
```
[IMPORTANT:flutter/impeller/renderer/backend/gles/render_pass_gles.cc(281)] The default framebuffer (FBO0) was bound.
[IMPORTANT:flutter/impeller/renderer/backend/gles/render_pass_gles.cc(281)] FBO 1: GL_FRAMEBUFFER_COMPLETE
Framebuffer is complete.
Description: 
Color Attachment: GL_TEXTURE(5)
Depth Attachment: GL_RENDERBUFFER(1)
Stencil Attachment: GL_RENDERBUFFER(1)

```

cc @lyceel
2024-11-12 04:58:26 +00:00
Jonah Williams
6bef907a09 [Impeller] geometry changes to support line/point style. (flutter/engine#56340)
Split off from https://github.com/flutter/engine/pull/55230 . Adds getter that tracks if a Path is a single contour.

################################

https://github.com/flutter/flutter/issues/152702
2024-11-11 21:11:07 +00:00
Jonah Williams
c93a57dfd0 [Impeller] dont unnecessarily copy point data out of display list. (flutter/engine#56492)
Display list now stores impeller::Point objects, so have the PointFieldGeometry reference these points directly. As the dispatching/recording is immediate, there is no need to copy to secondary storage.
2024-11-11 21:07:11 +00:00
Jonah Williams
0489b6bbab [Impeller] fix line/polygon depth and GLES scissor state. (flutter/engine#56494)
Two problems:

1. We were incorrectly clearing scissor state in the GLES render pass. I suspect this is the cause of all of the clipping problems in wonderous.

2. We were incrementing the depth value in drawPoints with line/polygon mode: these actually need to use the same depth values.

Fixed in the same PR because the golden actually demonstrates both problems with GLES, and luckily I found 2. when I noticed 1.

## Before

### Metal/Vulkan

![image](https://github.com/user-attachments/assets/a5541a51-bdf6-4a47-9638-610d9562df6f)

### GLES

![image](https://github.com/user-attachments/assets/9f3ad7e1-8193-405d-98c0-49141c8ab662)
2024-11-11 19:59:53 +00:00
Chris Bracken
b6b45b19a6 iOS: Use fml::CFRef in place of Scoped (flutter/engine#56463)
`fml::CFRef` implements the bulk of the operations implemented in the one-off `Scoped` class except with better safety guarantees such as `[[nodiscard]]` on the `Release` method. It doesn't implement the `handle()` method that allows direct writing into the internal storage of the wrapper, but that method is effectively an escape hatch for all the safety guarantees provided by the wrapper, so it seems safer to avoid adding it.

No changes to tests since this includes no semantic changes.

Issue: https://github.com/flutter/flutter/issues/137801

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-11-09 00:51:34 +00:00
Chris Bracken
88185e0b3e fml: Use CFRef where possible and add docs (flutter/engine#56436)
Document where CFRef takes over or hands back ownership of the underlying CoreFoundation object memory.

Migrates manual CoreFoundation object management to CFRef in:
* impeller/golden_tests/metal_screenshot.mm
* shell/platform/darwin/graphics/FlutterDarwinContextMetalSkia.mm
* shell/platform/darwin/graphics/FlutterDarwinExternalTextureMetal.mm
* shell/platform/darwin/ios/framework/Source/FlutterView.mm
* shell/platform/darwin/macos/framework/Source/FlutterSurface.mm

Adds a `Retain()` method to take shared ownership of the underlying object, as opposed to Reset, where ownership is transferred to the CFRef wrapper.

Adds a `Get()` method to make dealing with bridged Objective-C casts more convenient:
```objc
  fml::CFRef<CFStringRef> cfString(...);
  NSString* aString = (__bridge NSString*)cfString.Get();
```
as opposed to:
```objc
  fml::CFRef<CFStringRef> cfString(...);
  NSString* aString = (__bridge NSString*)static_cast<CFStringRef>(cfString);
```

I considered making use of `fml::scoped_policy::OwnershipPolicy` to add a second parameter to the ctor and `Reset` but, but I think documentation and addition of a `Retain()` method makes things a little clearer at the call site. It's also more consistent with `sk_cfp`, which we use in some Skia bits of the codebase.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-11-08 20:55:23 +00:00
Jim Graham
2fb2e3e70a [Impeller] Switch to uniform arrays for gradient data on non-SSBO hardware (flutter/engine#56441)
Currently the most generalized form of the Impeller gradient shaders uses an SSBO to store the gradient information, but SSBO data is not supported on older platforms. To make the capability more general we introduce variants of the gradient shaders that uses uniform arrays which are more widely supported.
2024-11-08 18:18:05 +00:00
Jonah Williams
bc59375978 [Impeller] Add support for ImageFilter.shader (flutter/engine#53490)
Copy-pasta docs:

```
  /// Creates an image filter from a [FragmentShader].
  ///
  /// The fragment shader provided here has additional requirements to be used
  /// by the engine for filtering. The first uniform value must be a vec2, this
  /// will be set by the engine to the size of the bound texture. There must
  /// also be at least one sampler2D uniform, the first of which will be set by
  /// the engine to contain the filter input.
  ///
  /// For example, the following is a valid fragment shader that can be used
  /// with this API. Note that the uniform names are not required to have any
  /// particular value.
  ///
  /// ```glsl
  /// #include <flutter/runtime_effect.glsl>
  ///
  /// uniform vec2 u_size;
  /// uniform float u_time;
  ///
  /// uniform sampler2D u_texture_input;
  ///
  /// out vec4 frag_color;
  ///
  /// void main() {
  ///   frag_color = texture(u_texture_input, FlutterFragCoord().xy / u_size) * u_time;
  ///
  /// }
  ///
  /// ```
  ///
  /// This API is only supported when using the Impeller rendering engine. On
  /// other backends a [UnsupportedError] will be thrown. This error can be
  /// caught and used for feature detection.
  ```

Fixes https://github.com/jonahwilliams/flutter_shaders/issues/34
Fixes https://github.com/jonahwilliams/flutter_shaders/issues/26
Fixes https://github.com/flutter/flutter/issues/132099
2024-11-08 01:15:22 +00:00
Jason Simmons
73f6b6562a [Impeller] Use Matrix::MakeTranslateScale to compute the source-to-destination mapping in DrawImageRect (flutter/engine#56433) 2024-11-07 20:41:16 +00:00
Jonah Williams
7f0892aaeb [Impeller] disable overdraw prevention for source draws. (flutter/engine#56403)
Overdraw prevention prevents overlapping triangles in the stroke tessellator from being visible with partially opaque draws. For fully opaque draws (or usage of src blend mode) I do not believe this will be an issue - so we can disable this to speed things up a tiny bit.

This code runs after we covert opaque draws to src blend mode, so checking for src blend mode should be sufficient.
2024-11-07 16:59:21 +00:00
Jonah Williams
2edc85cc0f [Impeller] make sure binding nullptr texture does not crash. (flutter/engine#56381)
Fixes https://github.com/flutter/flutter/issues/158074

binding a nullptr texture should fail but not crash.
2024-11-06 22:14:15 +00:00
Jonah Williams
d0bb78ccaf [Impeller] keep imgui hostbuffer alive. (flutter/engine#56409)
Fixes https://github.com/flutter/flutter/issues/158275

We are now counting on the content context to keep the host buffer alive. the imgui overlay does not use a content context, so it has to manage the lifetime of the host buffer correctly, keeping it alive for as many frames as needed and destroying it in the correct order (before context destruction).
2024-11-06 21:53:55 +00:00
Jonah Williams
e673b6fb32 [Impeller] generate stroke vertices into point arena. (flutter/engine#56390)
Heap allocation is extremely expensive on Android.

We can speed up the stroke tessellation by allocation a large arena and using that to write vertices. If the vertices would overflow, we switch to a dynamically allocated vector.
2024-11-06 21:17:07 +00:00
Jason Simmons
440ee21267 [Impeller] Do not capture the temporary ImpellerMapping struct pointer when storing release callbacks in libImpeller (flutter/engine#56411)
Fixes https://github.com/flutter/flutter/issues/158285
2024-11-06 21:13:46 +00:00
Chris Bracken
5a3f245710 iOS,macOS: Add Obj-C cflags to all Obj-C targets (flutter/engine#56386)
Ensure that all Objective-C code in the codebase is being built with the standard set of Flutter Objective-C compiler flags with ARC enabled.

Also bumps the cflags config up to the top of the first block within each target in which Objective-C sources appear, so that the location is consistent.

Migrates The following targets to ARC, which had been missed in previous passes since they didn't declare the standard Flutter Obj-C[++] cflags:
* `//flutter/fml:fml_unittests`
* `//flutter/impeller/golden_tests:metal_screenshot`
* `//flutter/impeller/playground:playground`
* `//flutter/impeller/backend/metal:metal`
* `//flutter/impeller/backend/metal:metal_unittests`
* `//shell/gpu:gpu_surface_metal_unittests`
* `//flutter/shell/platform/embedder:embedder_unittests`

This patch includes no semantic changes.

Issue: https://github.com/flutter/flutter/issues/137801

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-11-06 20:17:08 +00:00
Chinmay Garde
bcb04a6ea8 [Impeller] Avoid errors due to triangle fans usage on Molten. (flutter/engine#56321)
Added the test case for https://github.com/flutter/flutter/issues/157885 to the corpus but Jonah fixed it in https://github.com/flutter/engine/pull/56310.

Fixes https://github.com/flutter/flutter/issues/158024 which is more of an inconvenience on macOS.
2024-11-06 18:36:48 +00:00
Jonah Williams
b2c59ea5fe [Impeller] split downsample shader into GLES variant. (flutter/engine#56376)
This fixes a crash reported on a moto g4 where the on device shader compiler fails to process the ifdef.
2024-11-06 15:56:17 +00:00
Jason Simmons
eae69f89fe [Impeller] Delete any remaining GL objects during destruction of the ReactorGLES (flutter/engine#56361)
At shutdown time the ReactorGLES may still be holding handles of GL objects.  These objects should be cleaned up when the reactor is deleted.

This leak can be seen by running DlGoldenTest.ShimmerTest, which takes a series of screenshots.  Each screenshot creates an AiksContext. Without this change, the textures in the AiksContext's ReactorGLES will be leaked after the AiksContext is destroyed.
2024-11-05 20:56:13 +00:00
Jonah Williams
2604f3a406 [Impeller] exploit content context options' perfect hash function. (flutter/engine#56360)
The content context options hash function is pefect - meaning a distinct hash guarantees a distinct value and vice versa. We can replace the hashing entirely with an equality check of the hash function.

Additionally, we can remove the hashmap. As most of these maps have fewer than a dozen entries (often just 2 or 3) and the linear search is much faster.
2024-11-05 18:32:00 +00:00
Jonah Williams
bf0dacbeb3 [Impeller] match Skia's old VMA default block size. (flutter/engine#56368)
The unspecified default is 256 MiB which is ... big. 4Mb value is the default that Skia used to use, and results in less memory usage at least in local testing.

benchmarks will determine if this has a positive or negative impact on performance.

https://github.com/flutter/flutter/issues/157497
2024-11-05 18:04:58 +00:00
Jonah Williams
fa745a13cf remove mock vulkan memory test. (flutter/engine#56367)
This test is flakey despite using the mocked vulkan backend. This likely
indicates that VMA is still performing some real initialization work in
a way that is not consistently passing or failing.

It may not be safe to use VMA with mock vulkan.
2024-11-04 19:39:02 -08:00
Jonah Williams
574bb3b0f4 [Impeller] check if memory type is host coherent, avoid flush. (flutter/engine#56350)
Fixes https://github.com/flutter/flutter/issues/137454

Host coherent memory does not need to be flushed. Almost all mobile devices will have host coherent memory for us to write to, but we still need check because of swiftshader and/or desktop at some point.
2024-11-04 21:13:37 +00:00
Jonah Williams
38a225b1ce [Impeller] combine translate* scale mat mul when computing shader transform. (flutter/engine#56352)
For each draw we do 4 matrix multiplications, which isn't slow but does show up in CPU profiles at a few % of a frame. We can cut the number of multiplications down to 3 by constructing the translate*scale matrix in one go. The translate * scale matrix construction is much simpler than a full multiplication as we can ignore all of the known zero values.
2024-11-04 19:24:49 +00:00
Jonah Williams
b1bf47b924 [Impeller] faster descriptor type mapping. (flutter/engine#56351)
This is a dumb performance optimization. because we only use the DescriptorType enum to represent vk descriptor types, lets just make the enum values match. Then we can static cast instead of switch.

I do see this function showing up in profiles, though a very small slice.
2024-11-04 17:55:19 +00:00
Jonah Williams
deaddd1ed9 [Impeller] implement external texture gl for embedder. (flutter/engine#56277)
Fixes https://github.com/flutter/flutter/issues/143809
2024-11-01 23:04:06 +00:00
Jonah Williams
57c3c6af5d [Impeller] fix downsample with decal tile mode. (flutter/engine#56316)
Fixes https://github.com/flutter/flutter/issues/157956
Fixes https://github.com/flutter/flutter/issues/157959

Decal tile mode needs to be emulated on platforms that don't support it.
2024-11-01 22:45:14 +00:00
Jonah Williams
1351637b59 [impeller] use greater equal rather than greater depth compare. (flutter/engine#56310)
Marking ready for review for golden testing

Fixes https://github.com/flutter/flutter/issues/153504
Fixes some other ones too?

It seems like metal and vulkan are already behaving like they are using greater equal depth compare. GL behaves correctly like greater compare, but that leads to rendering bugs. Just switch it to greater equal
2024-11-01 21:03:19 +00:00
Jason Simmons
09c811781d [Impeller] Fix handling of destination opacity in advanced blends (flutter/engine#56251)
The framebuffer blend pipeline needs to support a dst_input_alpha parameter in order to implement the AbsorbOpacity flag.

Also, dst_input_alpha should only be applied to the alpha channel of the unpremultiplied destination color.

Fixes https://github.com/flutter/flutter/issues/157716
2024-11-01 01:02:10 +00:00
gaaclarke
f81ed55e63 reland: Allow BufferViews to have non-owning references to DeviceBuffers (flutter/engine#56286)
relands https://github.com/flutter/engine/pull/56224

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-10-31 23:46:55 +00:00
auto-submit[bot]
528967bfae Reverts "Allow BufferViews to have non-owning references to DeviceBuffers (#56224)" (flutter/engine#56285)
Reverts: flutter/engine#56224
Initiated by: jonahwilliams
Reason for reverting: merge issue.
Original PR Author: gaaclarke

Reviewed By: {jonahwilliams}

This change reverts the following previous change:
issue: https://github.com/flutter/flutter/issues/157538

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-10-31 22:48:46 +00:00
gaaclarke
1d90823917 Allow BufferViews to have non-owning references to DeviceBuffers (flutter/engine#56224)
issue: https://github.com/flutter/flutter/issues/157538

## 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] and the [C++,
Objective-C, Java style guides].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I added new tests to check the change I am making or feature I am
adding, or the PR is [test-exempt]. See [testing the engine] for
instructions on writing and running engine tests.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I signed the [CLA].
- [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/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2024-10-31 15:28:10 -07:00
Jim Graham
861a9a4ac8 [Impeller] Do not use fast mask blur for stroked shapes (flutter/engine#56247)
A compound test for whether to use the fast blur mechanism for shapes was failing to check for a stroked shape due to misplaced parentheses.
2024-10-31 21:33:18 +00:00
Jonah Williams
14df054f9c [Impeller] make desktop GL render. (flutter/engine#56274)
Fixes https://github.com/flutter/flutter/issues/143387

Will be tested in https://github.com/flutter/flutter/pull/157888
2024-10-31 21:33:15 +00:00
Chris Bracken
998761eb14 iOS,macOS: migrate shell/gpu to ARC (flutter/engine#56157)
Migrates Objective-C code in shell/gpu to ARC.

Migrate `sk_cfp::reset(__bridge_retained ptr)` to `sk_cfp::retain(__bridge ptr)`. `reset` `CFRelease`s the previously held pointer and sets the pointer to the new pointer. `retain` `CFRetain`s the new pointer prior to setting it.

No changes to tests since this makes no semantic changes.

Issue: https://github.com/flutter/flutter/issues/137801

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-10-31 18:55:48 +00:00
Jonah Williams
6eed502b8b [Impeller] Reland: disable AHBs on devices that were upgraded to 29. (flutter/engine#56221)
Uses ro.product.first_api_level to disable AHBs on devices that began life pre 29.

Fixes https://github.com/flutter/flutter/issues/157113
2024-10-31 17:42:12 +00:00
Jonah Williams
8b0392d282 [Impeller] use primitive restart for faster tessellation: write directly into host buffer. (flutter/engine#56173)
Using primitive restart we can avoid tracking even odd or inserting degenerate triangles. Instead a special index value `0xFFFF` is used to signal a break. This can be combined with triangle fan on vulkan for a dramatically simpler tessellation.

Additionally, switches to a two pass system where we first estimate the storage required by the path so tha the host buffer can be written to directly.
2024-10-31 02:27:28 +00:00
Jonah Williams
693f99ae00 [Impeller] expose reference to tessellator instead of shared_ptr. (flutter/engine#56244)
All geometries were incrementing the shared_ptr usage count which shows up in profiles. Instead expose a Tessellator reference like we do with HostBuffer.
2024-10-31 00:40:18 +00:00
Jason Simmons
d24eb30b3d [Impeller] Remove the use of a subpixel minimum stroke size for MSAA (flutter/engine#56223)
Based on https://github.com/flutter/engine/pull/55230

Fixes https://github.com/flutter/flutter/issues/156438
2024-10-30 18:45:45 +00:00
auto-submit[bot]
728997cd8f Reverts "[Impeller] Reland: disable AHBs on devices that were upgraded to 29. (#56213)" (flutter/engine#56220)
Reverts: flutter/engine#56213
Initiated by: jtmcdole
Reason for reverting: breaks the tree. :'(
Original PR Author: jonahwilliams

Reviewed By: {chinmaygarde, jtmcdole}

This change reverts the following previous change:
Uses ro.product.first_api_level to disable AHBs on devices that began life pre 29.

Fixes https://github.com/flutter/flutter/issues/157113
2024-10-29 22:24:19 +00:00