Comments (7)
I mean we can also add helpers to the DlBuilder that look more like Impeller.
That's what the facade is, they just so happen to match the API of aiks::Canvas. When making a large refactor, the least amount of change to the test code will give you the highest confidence that you didn't break anything. Actually we could probably implement this without changing AiksTests at all as a first step and might be worth considering. The changes I proposed are pretty straightforward though. We don't want a huge PR that completely resurfaces all the tests that are supposed to be verifying that it's correct.
from flutter.
For the existing aiks tests this is going to be a bit tricky. We have a significant investment in testing against the aiks api.
We should try to create a testing shim that will wrap up DlCanvas. That way tests written like this:
TEST_P(AiksTest, CanRenderColoredRect) {
Canvas canvas;
Paint paint;
paint.color = Color::Blue();
canvas.DrawPath(PathBuilder{}
.AddRect(Rect::MakeXYWH(100.0, 100.0, 100.0, 100.0))
.TakePath(),
paint);
ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture()));
}
would become something like
TEST_P(AiksTest, CanRenderColoredRect) {
DisplayListBuilder builder;
AiksFacade canvas(builder);
Paint paint;
paint.color = Color::Blue();
canvas.DrawPath(PathBuilder{}
.AddRect(Rect::MakeXYWH(100.0, 100.0, 100.0, 100.0))
.TakePath(),
paint);
ASSERT_TRUE(OpenPlaygroundHere(builder.build()));
}
Then we could little by little delete the facade. That will potentially require creating some new helper functions in the testing namespace or pushing new functionality to the flutter namespace.
For the existing dl_unittests.cc they would almost be exactly the same, since the facade is just an adapter around DisplayListBuilder
. The missing gap is just to get from a DisplayList
to be rendered in a Playground
. Since Playground
can already render impeller::Picture
, we could use impeller::DlDispatcher
to create a picture and conform to the existing Playground
code.
from flutter.
What is the AiksFacade providing here? The canvas API is almost identical? Or is it more about the playground implementation itself?
from flutter.
AiksFacade just allows us to migrate all our existing tests over when we delete aiks::Canvas
. That way we can separately delete it. It may require a lot of effort to remove, in which case we can spread out its removal as we have time instead of having a huge upfront cost to migrating to display lists. It's probably the only sane way to keep our existing tests.
from flutter.
I mean we can also add helpers to the DlBuilder that look more like Impeller. I think before we commit to the facade I'd try migrating a few tests to see how difficult it will be. Some of the tests that use entity pass internals will need to be enitrely rewritten or deleted and the facade wont help there
from flutter.
Here is a design doc that talks about implementing this (and a tool to help propagate tests from framework usage): https://docs.google.com/document/d/17LiGKlt57R5CZMxcWt9wj9Z7eDihhUaUEg3oeGQAKTc/edit
from flutter.
Done in flutter/engine#52690
from flutter.
Related Issues (20)
- Error getting Flutter sdk information HOT 2
- Implementations of `TextEditingController`s throw error HOT 3
- Flutter Web Bootstrapping fails after Upgrade to 3.22
- Missing class android.window.BackEvent HOT 1
- [Impeller] automatic resource layout tracking for Vulkan HOT 2
- [master] Channel fully broken? (_macros package error) HOT 3
- Linux tool_integration_tests_4_4 is flaky HOT 2
- ListTile widgets when added as a children in ListView widget is scrolling outside its predefined space
- I would like clarification on material 3 support in flutter
- Flutter should log errors in vkCreateInstance
- Migrate ButtonBar use in assets-for-api-docs/packages/diagrams/lib/src/card.dart
- mac-3 low on disk space. HOT 3
- 'Multiple widgets used the same GlobalKey' on Hot Reload When Using ShellRoute with Global Key and Builder Parameter HOT 2
- After upgrading to 3.22 Flutter Web ignores the -no-web-resources-cdn config
- Improve fidelity of CupertinoCheckbox
- Web Build Busted After Upgrade
- App gray mode
- The argument limit does not work on Android
- [image_picker] pickMultiImage: The argument limit does not work on Android HOT 1
- Failures-only reporter for `flutter test`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter.