Skip to content
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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Commits on Nov 7, 2023

  1. 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
    graveljp committed Nov 7, 2023
    Configuration menu
    Copy the full SHA
    f8a46e0 View commit details
    Browse the repository at this point in the history
  2. 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.
    graveljp committed Nov 7, 2023
    Configuration menu
    Copy the full SHA
    0868d09 View commit details
    Browse the repository at this point in the history

Commits on Nov 9, 2023

  1. Fix <ref> syntax

    domenic committed Nov 9, 2023
    Configuration menu
    Copy the full SHA
    6f28c4d View commit details
    Browse the repository at this point in the history
  2. Fixed editorial issues

    graveljp committed Nov 9, 2023
    Configuration menu
    Copy the full SHA
    fd385d3 View commit details
    Browse the repository at this point in the history

Commits on May 31, 2024

  1. Remove XML CanvasFilter from initial layer spec

    This will be moved to a separate pull request.
    graveljp committed May 31, 2024
    Configuration menu
    Copy the full SHA
    6d00e9e View commit details
    Browse the repository at this point in the history

Commits on Aug 16, 2024

  1. 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.
    graveljp committed Aug 16, 2024
    Configuration menu
    Copy the full SHA
    6687ecc View commit details
    Browse the repository at this point in the history
  2. Remove BeginLayerOptions

    This removes the filter argument of the beginLayer API.
    BeginLayerOptions can possibliy be added to the specification as a
    follow-up.
    graveljp committed Aug 16, 2024
    Configuration menu
    Copy the full SHA
    1d3e5ce View commit details
    Browse the repository at this point in the history

Commits on Sep 10, 2024

  1. 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).
    graveljp committed Sep 10, 2024
    Configuration menu
    Copy the full SHA
    7d60c4e View commit details
    Browse the repository at this point in the history

Commits on Sep 23, 2024

  1. 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.
    graveljp committed Sep 23, 2024
    Configuration menu
    Copy the full SHA
    1fc4c42 View commit details
    Browse the repository at this point in the history