From 8927cc6bf5ba0684f839c72fc76c2fb9a8cf7c67 Mon Sep 17 00:00:00 2001 From: Christopher Cameron Date: Tue, 7 Jan 2025 22:22:34 +0000 Subject: [PATCH 1/6] Merge offscreen and onscreen CanvasRenderingContext2DSettings --- source | 253 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 125 insertions(+), 128 deletions(-) diff --git a/source b/source index 0639bb4821c..f9fbcaea7f6 100644 --- a/source +++ b/source @@ -64640,8 +64640,9 @@ callback BlobCallback = undefined (Blob? blob);

The bitmaps of canvas elements, the bitmaps of ImageBitmap objects, as well as some of the bitmaps of rendering contexts, such as those described in the sections on - the CanvasRenderingContext2D and ImageBitmapRenderingContext objects - below, have an origin-clean flag, which can be + the CanvasRenderingContext2D, OffscreenCanvasRenderingContext2D, and + ImageBitmapRenderingContext objects below, + have an origin-clean flag, which can be set to true or false. Initially, when the canvas element or ImageBitmap object is created, its bitmap's origin-clean flag must be set to true.

@@ -65105,9 +65106,8 @@ enum ImageSmoothingQuality { "canvas; - - CanvasRenderingContext2DSettings getContextAttributes(); }; +CanvasRenderingContext2D includes CanvasBitmap; CanvasRenderingContext2D includes CanvasState; CanvasRenderingContext2D includes CanvasTransform; CanvasRenderingContext2D includes CanvasCompositing; @@ -65125,6 +65125,11 @@ interface CanvasRenderingContext2D { CanvasRenderingContext2D includes CanvasTextDrawingStyles; CanvasRenderingContext2D includes CanvasPath; +interface mixin CanvasBitmap { + // bitmap + CanvasRenderingContext2DSettings getContextAttributes(); +}; + interface mixin CanvasState { // state undefined save(); // push state on state stack @@ -65416,89 +65421,6 @@ interface Path2D {
-

A CanvasRenderingContext2D object has an output bitmap that - is initialized when the object is created.

- -

The output bitmap has an origin-clean flag, which can be set to true or false. - Initially, when one of these bitmaps is created, its origin-clean flag must be set to true.

- -

The CanvasRenderingContext2D object also has an alpha boolean. When a - CanvasRenderingContext2D object's alpha is false, then its alpha channel must be fixed to 1.0 - (fully opaque) for all pixels, and attempts to change the alpha component of any pixel must be - silently ignored.

- -

Thus, the bitmap of such a context starts off as opaque black instead - of transparent black; clearRect() - always results in opaque black pixels, every fourth byte from getImageData() is always 255, the putImageData() method effectively ignores every - fourth byte in its input, and so on. However, the alpha component of styles and images drawn - onto the canvas are still honoured up to the point where they would impact the output - bitmap's alpha channel; for instance, drawing a 50% transparent white square on a freshly - created output bitmap with its alpha set - to false will result in a fully-opaque gray square.

- -

The CanvasRenderingContext2D object also has a desynchronized boolean. When a - CanvasRenderingContext2D object's desynchronized is true, then the user agent may - optimize the rendering of the canvas to reduce the latency, as measured from input events to - rasterization, by desynchronizing the canvas paint cycle from the event loop, bypassing the - ordinary user agent rendering algorithm, or both. Insofar as this mode involves bypassing the - usual paint mechanisms, rasterization, or both, it might introduce visible tearing artifacts.

- -

The user agent usually renders on a buffer which is not being displayed, quickly - swapping it and the one being scanned out for presentation; the former buffer is called - back buffer and the latter front buffer. A popular technique for reducing latency is called - front buffer rendering, also known as single buffer rendering, where rendering happens in - parallel and racily with the scanning out process. This technique reduces the latency at the price - of potentially introducing tearing artifacts and can be used to implement in total or part of the - desynchronized boolean. - MULTIPLEBUFFERING

- -

The desynchronized boolean - can be useful when implementing certain kinds of applications, such as drawing applications, - where the latency between input and rasterization is critical.

- -

The CanvasRenderingContext2D object also has a will read frequently boolean. When a - CanvasRenderingContext2D object's will read frequently is true, the user agent - may optimize the canvas for readback operations.

- -

On most devices the user agent needs to decide whether to store the canvas's - output bitmap on the GPU (this is also called "hardware accelerated"), or on the CPU - (also called "software"). Most rendering operations are more performant for accelerated canvases, - with the major exception being readback with getImageData(), toDataURL(), or toBlob(). CanvasRenderingContext2D objects with - will read frequently equal to true tell - the user agent that the webpage is likely to perform many readback operations and that it is - advantageous to use a software canvas.

- -

The CanvasRenderingContext2D object also has a color space setting of type - PredefinedColorSpace. The CanvasRenderingContext2D object's color space indicates the color space for the - output bitmap.

- -

The getContextAttributes() method - steps are to return «[ "alpha" → - this's alpha, "desynchronized" → - this's desynchronized, "colorSpace" → this's - color space, "willReadFrequently" → - this's will read frequently - ]».

-

The CanvasRenderingContext2D 2D rendering context represents a flat linear @@ -65709,6 +65631,91 @@ context.fillRect(100,0,50,50); // only this square remains or to enable double buffering so that graphics updates, like page scrolling for example, can be processed concurrently while canvas draw commands are being executed.

+
The canvas bitmap
+ +

A CanvasBitmap object has an output bitmap that + is initialized when the object is created.

+ +

The output bitmap has an origin-clean flag, which can be set to true or false. + Initially, when one of these bitmaps is created, its origin-clean flag must be set to true.

+ +

The CanvasBitmap object also has an alpha boolean. When a + CanvasBitmap object's alpha is false, then its alpha channel must be fixed to 1.0 + (fully opaque) for all pixels, and attempts to change the alpha component of any pixel must be + silently ignored.

+ +

Thus, the bitmap of such a context starts off as opaque black instead + of transparent black; clearRect() + always results in opaque black pixels, every fourth byte from getImageData() is always 255, the putImageData() method effectively ignores every + fourth byte in its input, and so on. However, the alpha component of styles and images drawn + onto the canvas are still honoured up to the point where they would impact the output + bitmap's alpha channel; for instance, drawing a 50% transparent white square on a freshly + created output bitmap with its alpha set + to false will result in a fully-opaque gray square.

+ +

The CanvasBitmap object also has a desynchronized boolean. When a + CanvasBitmap object's desynchronized is true, then the user agent may + optimize the rendering of the canvas to reduce the latency, as measured from input events to + rasterization, by desynchronizing the canvas paint cycle from the event loop, bypassing the + ordinary user agent rendering algorithm, or both. Insofar as this mode involves bypassing the + usual paint mechanisms, rasterization, or both, it might introduce visible tearing artifacts.

+ +

The user agent usually renders on a buffer which is not being displayed, quickly + swapping it and the one being scanned out for presentation; the former buffer is called + back buffer and the latter front buffer. A popular technique for reducing latency is called + front buffer rendering, also known as single buffer rendering, where rendering happens in + parallel and racily with the scanning out process. This technique reduces the latency at the price + of potentially introducing tearing artifacts and can be used to implement in total or part of the + desynchronized boolean. + MULTIPLEBUFFERING

+ +

The desynchronized boolean + can be useful when implementing certain kinds of applications, such as drawing applications, + where the latency between input and rasterization is critical.

+ +

The CanvasBitmap object also has a will read frequently boolean. When a + CanvasBitmap object's will read frequently is true, the user agent + may optimize the canvas for readback operations.

+ +

On most devices the user agent needs to decide whether to store the canvas's + output bitmap on the GPU (this is also called "hardware accelerated"), or on the CPU + (also called "software"). Most rendering operations are more performant for accelerated canvases, + with the major exception being readback with getImageData(), toDataURL(), or toBlob(). CanvasBitmap objects with + will read frequently equal to true tell + the user agent that the webpage is likely to perform many readback operations and that it is + advantageous to use a software canvas.

+ +

The CanvasBitmap object also has a color space setting of type + PredefinedColorSpace. The CanvasBitmap object's color space indicates the color space for the + output bitmap.

+ +

The getContextAttributes() method + steps are to return «[ "alpha" → + this's alpha, "desynchronized" → + this's desynchronized, "colorSpace" → this's + color space, "willReadFrequently" → + this's will read frequently + ]».

+
The canvas state

Objects that implement the CanvasState interface maintain a stack of drawing @@ -71271,9 +71278,9 @@ interface OffscreenCanvas : EventTarget {

  • If this OffscreenCanvas object's context mode is 2d and the rendering context's bitmap's origin-clean flag is set to false, then return + data-x="offscreencanvas-context-2d">2d and the rendering context's + output bitmap's origin-clean flag + is set to false, then return a promise rejected with a "SecurityError" DOMException.

    @@ -71338,7 +71345,7 @@ interface OffscreenCanvas : EventTarget { data-x="offscreencanvas-bitmap">bitmap to reference a newly created bitmap of the same dimensions and color space as the previous bitmap, and with its pixels initialized to transparent black, or opaque black if the rendering context's alpha flag is set to false.

    + data-x="concept-canvas-alpha">alpha flag is set to false.

    This means that if the rendering context of this OffscreenCanvas is a WebGLRenderingContext, the value of OffscreenCanvasRenderingContext2D { readonly attribute OffscreenCanvas canvas; }; +OffscreenCanvasRenderingContext2D includes CanvasBitmap; OffscreenCanvasRenderingContext2D includes CanvasState; OffscreenCanvasRenderingContext2D includes CanvasTransform; OffscreenCanvasRenderingContext2D includes CanvasCompositing; @@ -71398,29 +71406,6 @@ interface OffscreenCanvasRenderingContext2D { OffscreenCanvas object rather than a canvas element;

  • -

    An OffscreenCanvasRenderingContext2D object has a bitmap that is initialized when the object is - created.

    - -

    The bitmap has an origin-clean flag, which can be set to true or - false. Initially, when one of these bitmaps is created, its origin-clean flag must be set to true.

    - -

    An OffscreenCanvasRenderingContext2D object also has an alpha flag, which can be set to true or false. Initially, - when the context is created, its alpha flag must be set to true. When an - OffscreenCanvasRenderingContext2D object has its alpha flag set to false, then its alpha channel must be - fixed to 1.0 (fully opaque) for all pixels, and attempts to change the alpha component of any pixel - must be silently ignored.

    - -

    An OffscreenCanvasRenderingContext2D object also has a color space setting of type - PredefinedColorSpace. The color space for the context's bitmap is set to the context's color space.

    -

    An OffscreenCanvasRenderingContext2D object has an associated OffscreenCanvas object, which is the OffscreenCanvas object from which the OffscreenCanvasRenderingContext2D object was created. @@ -71451,23 +71436,35 @@ interface OffscreenCanvasRenderingContext2D {

  • Set context's associated OffscreenCanvas object to target.

  • -
  • If settings["alpha"] is false, then set - context's alpha flag to false.

  • - -
  • Set context's color space - to settings["colorSpace"].

  • - -
  • Set context's bitmap to a newly +

  • Set context's alpha to + settings + ["alpha"]. +

  • + +
  • Set context's desynchronized to + settings + ["desynchronized"]. +

  • + +
  • Set context's color space + to settings + ["colorSpace"]. +

  • + +
  • Set context's will read frequently to + settings + ["willReadFrequently"]. +

  • + +
  • Set context's output bitmap to a newly created bitmap with the dimensions specified by the width and height attributes of target, and set target's bitmap to the same bitmap (so that they are shared).

  • -
  • If context's alpha flag is set - to true, initialize all the pixels of context's bitmap to transparent black. Otherwise, +

  • If context's alpha flag is set + to true, initialize all the pixels of context's output bitmap to + transparent black. Otherwise, initialize the pixels to opaque black.

  • Return context.

  • @@ -71719,8 +71716,8 @@ interface OffscreenCanvasRenderingContext2D { lossy operation on colors that are not fully opaque.

    A CanvasRenderingContext2D's output bitmap and an - OffscreenCanvasRenderingContext2D's bitmap must use premultiplied alpha to represent transparent colors.

    + OffscreenCanvasRenderingContext2D's output bitmap must use + premultiplied alpha to represent transparent colors.

    It is important for canvas bitmaps to represent colors using premultiplied alpha because it affects the range of representable colors. While additive colors cannot currently be From 4c74124696e99c499062ed760da8de1c80e557ac Mon Sep 17 00:00:00 2001 From: Christopher Cameron Date: Wed, 8 Jan 2025 09:50:16 +0000 Subject: [PATCH 2/6] Change CanvasBitmap to CanvasSettings --- source | 105 +++++++++++++++++++++++++++------------------------------ 1 file changed, 50 insertions(+), 55 deletions(-) diff --git a/source b/source index f9fbcaea7f6..efc4bc17030 100644 --- a/source +++ b/source @@ -65107,7 +65107,7 @@ interface CanvasRenderingContext2D { // back-reference to the canvas readonly attribute HTMLCanvasElement canvas; }; -CanvasRenderingContext2D includes CanvasBitmap; +CanvasRenderingContext2D includes CanvasSettings; CanvasRenderingContext2D includes CanvasState; CanvasRenderingContext2D includes CanvasTransform; CanvasRenderingContext2D includes CanvasCompositing; @@ -65125,8 +65125,8 @@ interface CanvasRenderingContext2D { CanvasRenderingContext2D includes CanvasTextDrawingStyles; CanvasRenderingContext2D includes CanvasPath; -interface mixin CanvasBitmap { - // bitmap +interface mixin CanvasSettings { + // settings CanvasRenderingContext2DSettings getContextAttributes(); }; @@ -65475,23 +65475,8 @@ interface Path2D { data-x="attr-canvas-width">width and height content attributes.

    -
  • Set context's alpha to - settings["alpha"].

  • - -
  • Set context's desynchronized to settings["desynchronized"].

  • - -
  • Set context's color space to - settings["colorSpace"].

  • - -
  • Set context's will read frequently to - settings["willReadFrequently"].

  • +
  • Run the canvas settings output bitmap initialization algorithm, + given context and settings.

  • Return context.

  • @@ -65631,9 +65616,9 @@ context.fillRect(100,0,50,50); // only this square remains or to enable double buffering so that graphics updates, like page scrolling for example, can be processed concurrently while canvas draw commands are being executed.

    -
    The canvas bitmap
    +
    The canvas settings
    -

    A CanvasBitmap object has an output bitmap that +

    A CanvasSettings object has an output bitmap that is initialized when the object is created.

    The output bitmap has an Initially, when one of these bitmaps is created, its origin-clean flag must be set to true.

    -

    The CanvasBitmap object also has an The CanvasSettings object also has an alpha boolean. When a - CanvasBitmap object's CanvasSettings object's alpha is false, then its alpha channel must be fixed to 1.0 (fully opaque) for all pixels, and attempts to change the alpha component of any pixel must be silently ignored.

    @@ -65659,9 +65644,9 @@ context.fillRect(100,0,50,50); // only this square remains created output bitmap with its alpha set to false will result in a fully-opaque gray square.

    -

    The CanvasBitmap object also has a The CanvasSettings object also has a desynchronized boolean. When a - CanvasBitmap object's CanvasSettings object's desynchronized is true, then the user agent may optimize the rendering of the canvas to reduce the latency, as measured from input events to rasterization, by desynchronizing the canvas paint cycle from the event loop, bypassing the @@ -65681,9 +65666,9 @@ context.fillRect(100,0,50,50); // only this square remains can be useful when implementing certain kinds of applications, such as drawing applications, where the latency between input and rasterization is critical.

    -

    The CanvasBitmap object also has a The CanvasSettings object also has a will read frequently boolean. When a - CanvasBitmap object's CanvasSettings object's will read frequently is true, the user agent may optimize the canvas for readback operations.

    @@ -65693,18 +65678,45 @@ context.fillRect(100,0,50,50); // only this square remains with the major exception being readback with getImageData(), toDataURL(), or toBlob(). CanvasBitmap objects with + data-x="dom-canvas-toBlob">toBlob(). CanvasSettings objects with will read frequently equal to true tell the user agent that the webpage is likely to perform many readback operations and that it is advantageous to use a software canvas.

    -

    The CanvasBitmap object also has a The CanvasSettings object also has a color space setting of type - PredefinedColorSpace. The CanvasBitmap object's PredefinedColorSpace. The CanvasSettings object's color space indicates the color space for the output bitmap.

    -

    The + The canvas settings output bitmap initialization algorithm, which is passed + canvas (a CanvasSettings object) and + settings (a CanvasRenderingContext2DSettings object), consists + of running these steps: +

    + +
      +
    1. Set context's alpha to + settings["alpha"].

    2. + +
    3. Set context's desynchronized to settings["desynchronized"].

    4. + +
    5. Set context's color space to + settings["colorSpace"].

    6. + +
    7. Set context's will read frequently to + settings["willReadFrequently"].

    8. +
    + +

    The getContextAttributes() method steps are to return «[ "alpha" → this's alpha, "OffscreenCanvas : EventTarget { "2d"

      -
    1. Let context be the result of running the offscreen 2D context creation - algorithm given this and options.

    2. +
    3. Let context be the result of running the + offscreen 2D context creation algorithm given + this and options.

    4. Set this's context mode to 2d.

    5. @@ -71377,7 +71389,7 @@ interface OffscreenCanvasRenderingContext2D { readonly attribute OffscreenCanvas canvas; }; -OffscreenCanvasRenderingContext2D includes CanvasBitmap; +OffscreenCanvasRenderingContext2D includes CanvasSettings; OffscreenCanvasRenderingContext2D includes CanvasState; OffscreenCanvasRenderingContext2D includes CanvasTransform; OffscreenCanvasRenderingContext2D includes CanvasCompositing; @@ -71436,25 +71448,8 @@ interface OffscreenCanvasRenderingContext2D {
    6. Set context's associated OffscreenCanvas object to target.

    7. -
    8. Set context's alpha to - settings - ["alpha"]. -

    9. - -
    10. Set context's desynchronized to - settings - ["desynchronized"]. -

    11. - -
    12. Set context's color space - to settings - ["colorSpace"]. -

    13. - -
    14. Set context's will read frequently to - settings - ["willReadFrequently"]. -

    15. +
    16. Run the canvas settings output bitmap initialization algorithm, + given context and settings.

    17. Set context's output bitmap to a newly created bitmap with the dimensions specified by the Date: Tue, 14 Jan 2025 09:30:48 +0000 Subject: [PATCH 3/6] Incorporate review feedback --- source | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/source b/source index efc4bc17030..1b25efcd577 100644 --- a/source +++ b/source @@ -65475,8 +65475,8 @@ interface Path2D { data-x="attr-canvas-width">width and height content attributes.

    18. -
    19. Run the canvas settings output bitmap initialization algorithm, - given context and settings.

    20. +
    21. Run the canvas settings output bitmap + initialization algorithm, given context and settings.

    22. Return context.

    @@ -65689,12 +65689,9 @@ context.fillRect(100,0,50,50); // only this square remains data-x="concept-canvas-color-space">color space indicates the color space for the output bitmap.

    -

    - The canvas settings output bitmap initialization algorithm, which is passed - canvas (a CanvasSettings object) and - settings (a CanvasRenderingContext2DSettings object), consists - of running these steps: -

    +

    To initialize a CanvasSettings + output bitmap, given a CanvasSettings context and a + CanvasRenderingContext2DSettings settings execute these steps:

    1. Set context's alpha to @@ -71357,7 +71354,7 @@ interface OffscreenCanvas : EventTarget { data-x="offscreencanvas-bitmap">bitmap to reference a newly created bitmap of the same dimensions and color space as the previous bitmap, and with its pixels initialized to transparent black, or opaque black if the rendering context's alpha flag is set to false.

      + data-x="concept-canvas-alpha">alpha is false.

      This means that if the rendering context of this OffscreenCanvas is a WebGLRenderingContext, the value of OffscreenCanvasRenderingContext2D {

    2. Set context's associated OffscreenCanvas object to target.

    3. -
    4. Run the canvas settings output bitmap initialization algorithm, - given context and settings.

    5. +
    6. Run the canvas settings output bitmap + initialization algorithm, given context and settings.

    7. Set context's output bitmap to a newly created bitmap with the dimensions specified by the Date: Thu, 16 Jan 2025 13:31:56 -0500 Subject: [PATCH 4/6] Run these steps --- source | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source b/source index 1b25efcd577..2cc94645707 100644 --- a/source +++ b/source @@ -65691,7 +65691,7 @@ context.fillRect(100,0,50,50); // only this square remains

      To initialize a CanvasSettings output bitmap, given a CanvasSettings context and a - CanvasRenderingContext2DSettings settings execute these steps:

      + CanvasRenderingContext2DSettings settings, run these steps:

      1. Set context's alpha to From e021450047416c79e28507c13d8b49e06e698a88 Mon Sep 17 00:00:00 2001 From: Dominic Farolino Date: Thu, 16 Jan 2025 13:41:42 -0500 Subject: [PATCH 5/6] `specfmt` wrapping --- source | 90 ++++++++++++++++++++++++++++------------------------------ 1 file changed, 43 insertions(+), 47 deletions(-) diff --git a/source b/source index 2cc94645707..14b3fa7cea0 100644 --- a/source +++ b/source @@ -64641,11 +64641,11 @@ callback BlobCallback = undefined (Blob? blob);

        The bitmaps of canvas elements, the bitmaps of ImageBitmap objects, as well as some of the bitmaps of rendering contexts, such as those described in the sections on the CanvasRenderingContext2D, OffscreenCanvasRenderingContext2D, and - ImageBitmapRenderingContext objects below, - have an origin-clean flag, which can be - set to true or false. Initially, when the canvas element or ImageBitmap - object is created, its bitmap's origin-clean - flag must be set to true.

        + ImageBitmapRenderingContext objects below, have an origin-clean flag, which can be set to true or false. + Initially, when the canvas element or ImageBitmap object is created, its + bitmap's origin-clean flag must be set to + true.

        A canvas element can have a rendering context bound to it. Initially, it does not have a bound rendering context. To keep track of whether it has a rendering context or not, and @@ -65618,8 +65618,8 @@ context.fillRect(100,0,50,50); // only this square remains

        The canvas settings
        -

        A CanvasSettings object has an output bitmap that - is initialized when the object is created.

        +

        A CanvasSettings object has an output bitmap that is initialized when + the object is created.

        The output bitmap has an origin-clean flag, which can be set to true or false. @@ -65627,22 +65627,21 @@ context.fillRect(100,0,50,50); // only this square remains data-x="concept-canvas-origin-clean">origin-clean flag must be set to true.

        The CanvasSettings object also has an alpha boolean. When a - CanvasSettings object's alpha is false, then its alpha channel must be fixed to 1.0 - (fully opaque) for all pixels, and attempts to change the alpha component of any pixel must be + data-x="concept-canvas-alpha">alpha boolean. When a CanvasSettings object's + alpha is false, then its alpha channel must be fixed to + 1.0 (fully opaque) for all pixels, and attempts to change the alpha component of any pixel must be silently ignored.

        Thus, the bitmap of such a context starts off as opaque black instead of transparent black; clearRect() always results in opaque black pixels, every fourth byte from getImageData() is always 255, the putImageData() method effectively ignores every - fourth byte in its input, and so on. However, the alpha component of styles and images drawn - onto the canvas are still honoured up to the point where they would impact the output - bitmap's alpha channel; for instance, drawing a 50% transparent white square on a freshly - created output bitmap with its alpha set - to false will result in a fully-opaque gray square.

        + data-x="dom-context-2d-putImageData">putImageData() method effectively ignores every fourth + byte in its input, and so on. However, the alpha component of styles and images drawn onto the + canvas are still honoured up to the point where they would impact the output bitmap's + alpha channel; for instance, drawing a 50% transparent white square on a freshly created + output bitmap with its alpha set to false + will result in a fully-opaque gray square.

        The CanvasSettings object also has a desynchronized boolean. When a @@ -65654,23 +65653,22 @@ context.fillRect(100,0,50,50); // only this square remains usual paint mechanisms, rasterization, or both, it might introduce visible tearing artifacts.

        The user agent usually renders on a buffer which is not being displayed, quickly - swapping it and the one being scanned out for presentation; the former buffer is called - back buffer and the latter front buffer. A popular technique for reducing latency is called + swapping it and the one being scanned out for presentation; the former buffer is called back + buffer and the latter front buffer. A popular technique for reducing latency is called front buffer rendering, also known as single buffer rendering, where rendering happens in parallel and racily with the scanning out process. This technique reduces the latency at the price of potentially introducing tearing artifacts and can be used to implement in total or part of the desynchronized boolean. MULTIPLEBUFFERING

        -

        The desynchronized boolean - can be useful when implementing certain kinds of applications, such as drawing applications, - where the latency between input and rasterization is critical.

        +

        The desynchronized boolean can + be useful when implementing certain kinds of applications, such as drawing applications, where the + latency between input and rasterization is critical.

        The CanvasSettings object also has a will read frequently boolean. When a - CanvasSettings object's will read frequently is true, the user agent - may optimize the canvas for readback operations.

        + CanvasSettings object's will read + frequently is true, the user agent may optimize the canvas for readback operations.

        On most devices the user agent needs to decide whether to store the canvas's output bitmap on the GPU (this is also called "hardware accelerated"), or on the CPU @@ -65678,9 +65676,9 @@ context.fillRect(100,0,50,50); // only this square remains with the major exception being readback with getImageData(), toDataURL(), or toBlob(). CanvasSettings objects with - will read frequently equal to true tell - the user agent that the webpage is likely to perform many readback operations and that it is + data-x="dom-canvas-toBlob">toBlob(). CanvasSettings objects with will read frequently equal to true tell the + user agent that the webpage is likely to perform many readback operations and that it is advantageous to use a software canvas.

        The CanvasSettings object also has a data-x="concept-canvas-color-space">color space indicates the color space for the output bitmap.

        -

        To initialize a CanvasSettings - output bitmap, given a CanvasSettings context and a +

        To initialize a CanvasSettings output + bitmap, given a CanvasSettings context and a CanvasRenderingContext2DSettings settings, run these steps:

          @@ -65707,9 +65705,9 @@ context.fillRect(100,0,50,50); // only this square remains settings["colorSpace"].

          -
        1. Set context's will read frequently to - settings["

          Set context's will read + frequently to settings["willReadFrequently"].

        @@ -71287,11 +71285,10 @@ interface OffscreenCanvas : EventTarget {
      2. If this OffscreenCanvas object's context mode is 2d and the rendering context's - output bitmap's origin-clean flag - is set to false, then return - a promise rejected with a "SecurityError" - DOMException.

        + data-x="offscreencanvas-context-2d">2d and the rendering context's output + bitmap's origin-clean flag is set to + false, then return a promise rejected with a + "SecurityError" DOMException.

      3. If this OffscreenCanvas object's bitmap has no pixels (i.e., either its horizontal @@ -71448,16 +71445,15 @@ interface OffscreenCanvasRenderingContext2D {

      4. Run the canvas settings output bitmap initialization algorithm, given context and settings.

      5. -
      6. Set context's output bitmap to a newly - created bitmap with the dimensions specified by the width and

        Set context's output bitmap to a newly created bitmap with the + dimensions specified by the width and height attributes of target, and set target's bitmap to the same bitmap (so that they are shared).

      7. -
      8. If context's alpha flag is set - to true, initialize all the pixels of context's output bitmap to - transparent black. Otherwise, - initialize the pixels to opaque black.

      9. +
      10. If context's alpha flag is set to + true, initialize all the pixels of context's output bitmap to + transparent black. Otherwise, initialize the pixels to opaque + black.

      11. Return context.

      @@ -71708,8 +71704,8 @@ interface OffscreenCanvasRenderingContext2D { lossy operation on colors that are not fully opaque.

      A CanvasRenderingContext2D's output bitmap and an - OffscreenCanvasRenderingContext2D's output bitmap must use - premultiplied alpha to represent transparent colors.

      + OffscreenCanvasRenderingContext2D's output bitmap must use premultiplied + alpha to represent transparent colors.

      It is important for canvas bitmaps to represent colors using premultiplied alpha because it affects the range of representable colors. While additive colors cannot currently be From 3ae8dce258cd942896e3aa75cfc7160a8e12c872 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Mon, 20 Jan 2025 16:05:08 +0100 Subject: [PATCH 6/6] nit --- source | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source b/source index 14b3fa7cea0..82abd48687f 100644 --- a/source +++ b/source @@ -65689,7 +65689,7 @@ context.fillRect(100,0,50,50); // only this square remains

      To initialize a CanvasSettings output bitmap, given a CanvasSettings context and a - CanvasRenderingContext2DSettings settings, run these steps:

      + CanvasRenderingContext2DSettings settings:

      1. Set context's alpha to