-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a layer and filter interface in the 2D canvas #9537
base: main
Are you sure you want to change the base?
Commits on Nov 14, 2024
-
Add a layer and filter interface in the 2D canvas
This adds new beginLayer and endLayer functions to open and close layers in the canvas. While layers are active, draw calls operate on a separate texture that gets composited to the parent output bitmap when the layer is closed. An optional filter can be specified in beginLayer, allowing effects to be applied to the layer's texture when it's composited its parent. Tests: https://github.com/web-platform-tests/wpt/tree/master/html/canvas/element/layers https://github.com/web-platform-tests/wpt/tree/master/html/canvas/offscreen/layers Fixes whatwg#8476
Configuration menu - View commit details
-
Copy full SHA for 7f411fd - Browse repository at this point
Copy the full SHA 7f411fdView commit details -
Added CCS filter, fixed unclosed layers and replied to review comments
This update addresses 3 main things: - Support for CSS filter strings was added to the beginLayer API - Unclosed layers are now never rasterized when the canvas is presented to the user. Instead, the content of the layer is preserved and will be rasterized in a later frame, if/when the layer is closed. - Replied to the first round of review comments.
Configuration menu - View commit details
-
Copy full SHA for aa10da3 - Browse repository at this point
Copy the full SHA aa10da3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9d4d816 - Browse repository at this point
Copy the full SHA 9d4d816View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5caa39a - Browse repository at this point
Copy the full SHA 5caa39aView commit details -
Remove XML CanvasFilter from initial layer spec
This will be moved to a separate pull request.
Configuration menu - View commit details
-
Copy full SHA for 7a74000 - Browse repository at this point
Copy the full SHA 7a74000View commit details -
Add ctx.filter to the layer rendering states
With this change, the context filters now applies to the layer's output bitmap and is resetted to "none" when entering layers.
Configuration menu - View commit details
-
Copy full SHA for 9dafd05 - Browse repository at this point
Copy the full SHA 9dafd05View commit details -
This removes the filter argument of the beginLayer API. BeginLayerOptions can possibliy be added to the specification as a follow-up.
Configuration menu - View commit details
-
Copy full SHA for 809c650 - Browse repository at this point
Copy the full SHA 809c650View commit details -
Clarify what type of bitmaps are used across the canvas spec
The HTMLCanvasElement's bitmap was linkified to clarify to which bitmap each uses of the word "bitmap" refers to (either the element's bitmap, the context's top level output bitmap or the context's current output bitmap).
Configuration menu - View commit details
-
Copy full SHA for 1630ffa - Browse repository at this point
Copy the full SHA 1630ffaView commit details -
Add the current transform to the layer rendering states
This means that when entering a layer, the current transform now is reset to the identity matrix. setTransform and getTransform are now local to the current layer, meaning that calling setTransform sets a matrix relative to the parent layer.
Configuration menu - View commit details
-
Copy full SHA for 8a626cf - Browse repository at this point
Copy the full SHA 8a626cfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3f3cc52 - Browse repository at this point
Copy the full SHA 3f3cc52View commit details -
Rewrote the note describing how the state stack stores the output bitmap
With how the spec is written now, the context always has a top level and a current output bitmap, irrespective of how the context's bitmap is bound or used by an HTMLCanvasElement or OffscreenCanvas. Thus, the paragraph modified by this commit wasn't correct. It's more useful to describe how the state stack as a whole relates with the context's state.
Configuration menu - View commit details
-
Copy full SHA for c8b18a1 - Browse repository at this point
Copy the full SHA c8b18a1View commit details -
Make all instances of "drawing states" plural
Most uses were plural already. Making them all plural is more consistent and allows to remove the data-x that was needed to reconcile the differences.
Configuration menu - View commit details
-
Copy full SHA for 1db7673 - Browse repository at this point
Copy the full SHA 1db7673View commit details
Commits on Nov 20, 2024
-
Main changes include clarifications in the `drawing state` definition and renaming `current transformation matrix` to `layer transformation matrix`.
Configuration menu - View commit details
-
Copy full SHA for 3378c5d - Browse repository at this point
Copy the full SHA 3378c5dView commit details