@@ -60200,6 +60200,7 @@ enum <dfn>CanvasFillRule</dfn> { "<span data-x="dom-context-2d-fillRule-nonzero"
60200
60200
60201
60201
dictionary <dfn>CanvasRenderingContext2DSettings</dfn> {
60202
60202
boolean <span data-x="dom-CanvasRenderingContext2DSettings-alpha">alpha</span> = true;
60203
+ boolean <span data-x="dom-CanvasRenderingContext2DSettings-desynchronized">desynchronized</span> = false;
60203
60204
};
60204
60205
60205
60206
enum <dfn>ImageSmoothingQuality</dfn> { "<span data-x="dom-context-2d-imageSmoothingQuality-low">low</span>", "<span data-x="dom-context-2d-imageSmoothingQuality-medium">medium</span>", "<span data-x="dom-context-2d-imageSmoothingQuality-high">high</span>" };
@@ -60452,36 +60453,38 @@ interface <dfn>Path2D</dfn> {
60452
60453
objects.</p>
60453
60454
60454
60455
<dl class="domintro">
60455
-
60456
- <dt><var>context</var> = <var>canvas</var> . <code data-x="dom-canvas-getContext">getContext</code>('2d' [, { [ <code data-x="dom-CanvasRenderingContext2DSettings-alpha">alpha</code>: false ] } ] )</dt>
60457
-
60456
+ <dt><var>context</var> = <var>canvas</var> . <code data-x="dom-canvas-getContext">getContext</code>('2d' [, { [ <code data-x="dom-CanvasRenderingContext2DSettings-alpha">alpha</code>: true ] [, <code data-x="dom-CanvasRenderingContext2DSettings-desynchronized">desynchronized</code>: false ] } ] )</dt>
60458
60457
<dd>
60459
-
60460
60458
<p>Returns a <code>CanvasRenderingContext2D</code> object that is permanently bound to a
60461
60459
particular <code>canvas</code> element.</p>
60462
60460
60463
- <p>If the <code data-x="dom-CanvasRenderingContext2DSettings-alpha">alpha</code> setting is
60464
- provided and set to false, then the canvas is forced to always be opaque.</p>
60461
+ <p>If the <code data-x="dom-CanvasRenderingContext2DSettings-alpha">alpha</code> member is
60462
+ false, then the context is forced to always be opaque.</p>
60465
60463
60464
+ <p>If the <code
60465
+ data-x="dom-CanvasRenderingContext2DSettings-desynchronized">desynchronized</code> member is
60466
+ true, then the context might be <span
60467
+ data-x="concept-canvas-desynchronized">desynchronized</span>.</p>
60466
60468
</dd>
60467
60469
60468
60470
<dt><var>context</var> . <code subdfn data-x="dom-context-2d-canvas">canvas</code></dt>
60469
-
60470
60471
<dd>
60471
-
60472
60472
<p>Returns the <code>canvas</code> element.</p>
60473
-
60474
60473
</dd>
60475
60474
60476
60475
<dt><var>attributes</var> = <var>canvas</var> . <code data-x="dom-context-2d-canvas-getcontextattributes">getContextAttributes</code>()</dt>
60477
-
60478
60476
<dd>
60477
+ <p>Returns an object whose:</p>
60479
60478
60480
- <p>Returns an object whose <code data-x="concept-canvas-alpha">alpha</code> member is true if
60481
- the context has an alpha channel, or false if it was forced to be opaque.</p>
60479
+ <ul>
60480
+ <li><code data-x="concept-canvas-alpha">alpha</code> member is true if the context has an alpha
60481
+ channel, or false if it was forced to be opaque.</li>
60482
60482
60483
+ <li><code data-x="dom-CanvasRenderingContext2DSettings-desynchronized">desynchronized</code>
60484
+ member is true if the context can be <span
60485
+ data-x="concept-canvas-desynchronized">desynchronized</span>.</li>
60486
+ </ul>
60483
60487
</dd>
60484
-
60485
60488
</dl>
60486
60489
60487
60490
<div w-nodev>
@@ -60497,12 +60500,11 @@ interface <dfn>Path2D</dfn> {
60497
60500
<!--REMOVE-TOPIC:Security-->
60498
60501
60499
60502
<p>The <code>CanvasRenderingContext2D</code> object also has an <dfn
60500
- data-x="concept-canvas-alpha">alpha</dfn> flag, which can be set to true or false. Initially,
60501
- when the context is created, its <span data-x="concept-canvas-alpha">alpha</span> flag must be
60502
- set to true. When a <code>CanvasRenderingContext2D</code> object has its <span
60503
- data-x="concept-canvas-alpha">alpha</span> flag set to false, then its alpha channel must be
60504
- fixed to 1.0 (fully opaque) for all pixels, and attempts to change the alpha component of any
60505
- pixel must be silently ignored.</p>
60503
+ data-x="concept-canvas-alpha">alpha</dfn> boolean. When a
60504
+ <code>CanvasRenderingContext2D</code> object's <span
60505
+ data-x="concept-canvas-alpha">alpha</span> is false, then its alpha channel must be fixed to 1.0
60506
+ (fully opaque) for all pixels, and attempts to change the alpha component of any pixel must be
60507
+ silently ignored.</p>
60506
60508
60507
60509
<p class="note">Thus, the bitmap of such a context starts off as <span>opaque black</span> instead
60508
60510
of <span>transparent black</span>; <code data-x="dom-context-2d-clearRect">clearRect()</code>
@@ -60512,14 +60514,43 @@ interface <dfn>Path2D</dfn> {
60512
60514
fourth byte in its input, and so on. However, the alpha component of styles and images drawn
60513
60515
onto the canvas are still honoured up to the point where they would impact the <span>output
60514
60516
bitmap</span>'s alpha channel; for instance, drawing a 50% transparent white square on a freshly
60515
- created <span>output bitmap</span> with its <span data-x="concept-canvas-alpha">alpha</span>
60516
- flag set to false will result in a fully-opaque gray square.</p>
60517
+ created <span>output bitmap</span> with its <span data-x="concept-canvas-alpha">alpha</span> set
60518
+ to false will result in a fully-opaque gray square.</p>
60519
+
60520
+ <p>The <code>CanvasRenderingContext2D</code> object also has a <dfn
60521
+ data-x="concept-canvas-desynchronized">desynchronized</dfn> boolean. When a
60522
+ <code>CanvasRenderingContext2D</code> object's <span
60523
+ data-x="concept-canvas-desynchronized">desynchronized</span> is true, then the user agent may
60524
+ optimize the rendering of the canvas to reduce the latency, as measured from input events to
60525
+ rasterization, by desynchronizing the canvas paint cycle from the event loop, bypassing the
60526
+ ordinary user agent rendering algorithm, or both. Insofar as this mode involves bypassing the
60527
+ usual paint mechanisms, rasterization, or both, it might introduce visible tearing artifacts.</p>
60528
+
60529
+ <p class="note">The user agent usually renders on a buffer which is not being displayed, quickly
60530
+ swapping it and the one being scanned out for presentation; the former buffer is called
60531
+ back buffer and the latter <i>front buffer</i>. A popular technique for reducing latency is called
60532
+ front buffer rendering, also known as <i>single buffer</i> rendering, where rendering happens in
60533
+ parallel and racily with the scanning out process. This technique reduces the latency at the price
60534
+ of potentially introducing tearing artifacts and can be used to implement in total or part of the
60535
+ <span data-x="concept-canvas-desynchronized">desynchronized</span> boolean. <ref
60536
+ spec=MULTIPLEBUFFERING></p>
60537
+
60538
+ <p class="note">The <span data-x="concept-canvas-desynchronized">desynchronized</span> boolean
60539
+ can be useful when implementing certain kinds of applications, such as drawing applications,
60540
+ where the latency between input and rasterization is critical.</p>
60517
60541
60518
60542
<p>The <dfn><code
60519
60543
data-x="dom-context-2d-canvas-getcontextattributes">getContextAttributes()</code></dfn> method,
60520
- when invoked, must return a <code>CanvasRenderingContext2DSettings</code> dictionary whose <code
60521
- data-x="concept-canvas-alpha">alpha</code> member is set to true if this context's <span
60522
- data-x="concept-canvas-alpha">alpha</span> flag is set, and false otherwise.</p>
60544
+ when invoked, must return a <code>CanvasRenderingContext2DSettings</code> dictionary containing
60545
+ the following members:</p>
60546
+
60547
+ <ul>
60548
+ <li><p><code data-x="concept-canvas-alpha">alpha</code>, set to this context's <span
60549
+ data-x="concept-canvas-alpha">alpha</span>.</p></li>
60550
+
60551
+ <li><p><code data-x="concept-canvas-desynchronized">desynchronized</code>, set to this context's
60552
+ <span data-x="concept-canvas-desynchronized">desynchronized</span>.</p></li>
60553
+ </ul>
60523
60554
60524
60555
<hr>
60525
60556
@@ -60575,15 +60606,13 @@ interface <dfn>Path2D</dfn> {
60575
60606
data-x="attr-canvas-width">width</code> and <code data-x="attr-canvas-height">height</code>
60576
60607
content attributes.</p></li>
60577
60608
60578
- <li>
60579
- <p>Process each of the members of <var>settings</var> as follows:</p>
60609
+ <li><p>Set <var>context</var>'s <span data-x="concept-canvas-alpha">alpha</span> to
60610
+ <var>settings</var>'s <dfn><code
60611
+ data-x="dom-CanvasRenderingContext2DSettings-alpha">alpha</code></dfn>.</p></li>
60580
60612
60581
- <dl>
60582
- <dt><dfn><code data-x="dom-CanvasRenderingContext2DSettings-alpha">alpha</code></dfn></dt>
60583
- <dd>If false, then set <var>context</var>'s <span data-x="concept-canvas-alpha">alpha</span>
60584
- flag to false.</dd>
60585
- </dl>
60586
- </li>
60613
+ <li><p>Set <var>context</var>'s <span
60614
+ data-x="concept-canvas-desynchronized">desynchronized</span> to <var>settings</var>'s <dfn><code
60615
+ data-x="dom-CanvasRenderingContext2DSettings-desynchronized">desynchronized</code></dfn>.</p></li>
60587
60616
60588
60617
<li><p>Return <var>context</var>.</p></li>
60589
60618
</ol>
@@ -121910,6 +121939,9 @@ INSERT INTERFACES HERE
121910
121939
<dt id="refsMQ">[MQ]</dt>
121911
121940
<dd><cite><a href="https://drafts.csswg.org/mediaqueries/">Media Queries</a></cite>, H. Lie, T. Çelik, D. Glazman, A. van Kesteren. W3C.</dd>
121912
121941
121942
+ <dt id="refsMULTIPLEBUFFERING">[MULTIPLEBUFFERING]</dt>
121943
+ <dd>(Non-normative) <cite><a href="https://en.wikipedia.org/wiki/Multiple_buffering">Multiple buffering</a></cite>. Wikipedia.</dd>
121944
+
121913
121945
<dt id="refsNAVMODEL">[NAVMODEL]</dt>
121914
121946
<dd><cite><a href="https://arxiv.org/abs/1608.05444">A Model of Navigation History</a></cite>. C. Brewster, A. Jeffrey.</dd>
121915
121947
0 commit comments