Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[Impeller] Add FAQ entry clarifying Skia usage and Web support. #34076

Merged
merged 1 commit into from
Jun 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions impeller/docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,40 @@
`./flutter/tools/gn`. Only do this if you frequently work with Playgrounds
and don't want to have to set the flags manually. Also, it would be a bad
idea to set this environment variable on CI.
* Does Impeller use Skia for rendering?
* No. Impeller has no direct dependencies on Skia.
* When running with Impeller, Flutter does not create a Skia graphics context.
* However, while Impeller still performs text rendering, text layout and
shaping needs to be done by a separate component. This component happens to
the SkParagraph which is part of Skia.
* Similarly, Impeller does not perform image decompression. Flutter uses a
standard set of codecs wrapped by Skia before querying the system supplied
image formats.
* So, while Impeller does not use nor is it a wrapper for Skia, some Skia
components are still used by Flutter when rendering using Impeller.
* Is Impeller going to be supported on the Web?
* The current priority for Impeller is to be amazing on all platforms targeted
by the C++ engine. This includes iOS, Android, desktops, and, all Embedder
API users. This would be by building Metal, Open GL, Open GL ES, and, Vulkan
rendering backends.
* The Open GL ES backend ought to work fine to target WebGL/WebGL2 and the
team can fix any issues found in such uses of the backend.
* However, in Flutter, Impeller sits behind the Display List interface in the
C++ engine. Display lists apply optimizations to the Flutter rendering
intent. But, more importantly for Impeller, they also provide a generic
interface with the ability to specify "dispatchers" to different rendering
packages. Today, the engine has Skia and Impeller dispatchers for display
lists.
* The web engine is unique in that it doesn't use any C++ engine components.
This includes the display lists mechanism. Instead, it interfaces directly
with Skia via the CanvasKit package.
Comment on lines +37 to +39
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: there's also an HTML backend that doesn't use CanvasKit at all...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. I mentioned CanvasKit to describe how the Web engine uses Skia. The HTML backend isn't relevant here right? Mind if I leave that out?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine either way. The Web is a bit confusing in terms of multiple backends and what they support or don't

* Updating the web engine to interface directly with Impeller is a non-goal at
this time. It is a significant undertaking (compared to a flag to swap
dispatchers that already exists) and also bypasses display list
optimizations.
* For this added implementation complexity, Web support has not been a
priority at this time for the small team working on Impeller.
* We are aware that these priorities might change in the future. There have
been sanity checks to ensure that the Impeller API can be ported to WASM and
also that Impeller shaders can be [compiled to WGSL](https://github.com/chinmaygarde/wgsl_sandbox)
for eventual WebGPU support.