Skip to content

Commit

Permalink
ImageBitmapRenderingContext for OffscreenCanvas
Browse files Browse the repository at this point in the history
  • Loading branch information
fserb authored and annevk committed May 14, 2019
1 parent 8600319 commit 8433bfc
Showing 1 changed file with 39 additions and 13 deletions.
52 changes: 39 additions & 13 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -41325,7 +41325,7 @@ interface <dfn>HTMLTableCellElement</dfn> : <span>HTMLElement</span> {
data-x="attr-col-span">span</code> attribute, or if trying to parse the attribute's value
resulted in an error or zero, then let <var>span</var> be 1.</p>

<p>If <var>span</var> is greater than 1000, let it be 1000 instead.</p>
<p>If <var>span</var> is greater than 1000, let it be 1000 instead.</p>

</li>

Expand Down Expand Up @@ -41384,7 +41384,7 @@ interface <dfn>HTMLTableCellElement</dfn> : <span>HTMLElement</span> {
data-x="attr-colgroup-span">span</code> attribute, or if trying to parse the attribute's
value resulted in an error or zero, then let <var>span</var> be 1.</p>

<p>If <var>span</var> is greater than 1000, let it be 1000 instead.</p>
<p>If <var>span</var> is greater than 1000, let it be 1000 instead.</p>

</li>

Expand Down Expand Up @@ -65074,10 +65074,10 @@ function AddCloud(data, x, y) { ... }</code></pre>

<h6>The <code>ImageBitmapRenderingContext</code> interface</h6>

<pre><code class="idl" data-x="">[Exposed=Window]
<pre><code class="idl" data-x="">[Exposed=(Window,Worker)]
interface <dfn>ImageBitmapRenderingContext</dfn> {
readonly attribute <span>HTMLCanvasElement</span> <span data-x="dom-ImageBitmapRenderingContext-canvas">canvas</span>;
void <span data-x="dom-ImageBitmapRenderingContext-transferFromImageBitmap">transferFromImageBitmap</span>(ImageBitmap? bitmap);
readonly attribute (<span>HTMLCanvasElement</span> or <span>OffscreenCanvas</span>) <span data-x="dom-ImageBitmapRenderingContext-canvas">canvas</span>;
void <span data-x="dom-ImageBitmapRenderingContext-transferFromImageBitmap">transferFromImageBitmap</span>(<span>ImageBitmap</span>? bitmap);
};

dictionary <dfn>ImageBitmapRenderingContextSettings</dfn> {
Expand Down Expand Up @@ -65121,8 +65121,7 @@ dictionary <dfn>ImageBitmapRenderingContextSettings</dfn> {
</dd>

<dt><var>context</var> . <code
data-x="dom-ImageBitmapRenderingContext-transferFromImageBitmap">transferFromImageBitmap</code>(
null)</dt>
data-x="dom-ImageBitmapRenderingContext-transferFromImageBitmap">transferFromImageBitmap</code>(null)</dt>

<dd>

Expand Down Expand Up @@ -65237,8 +65236,7 @@ dictionary <dfn>ImageBitmapRenderingContextSettings</dfn> {
<hr>

<p>The <dfn><code>ImageBitmapRenderingContext</code> creation algorithm</dfn>, which is passed a
<var>target</var> (a <code>canvas</code> element) and <var>options</var>, consists of running
these steps:</p>
<var>target</var> and <var>options</var>, consists of running these steps:</p>

<ol>
<li><p>Let <var>settings</var> be the result of <span
Expand Down Expand Up @@ -65313,14 +65311,14 @@ dictionary <dfn>ImageBitmapRenderingContextSettings</dfn> {

<h5>The <code>OffscreenCanvas</code> interface</h5>

<pre><code class="idl" data-x="">typedef (<span>OffscreenCanvasRenderingContext2D</span> or <span>WebGLRenderingContext</span> or <span>WebGL2RenderingContext</span>) <dfn>OffscreenRenderingContext</dfn>;
<pre><code class="idl" data-x="">typedef (<span>OffscreenCanvasRenderingContext2D</span> or <span>ImageBitmapRenderingContext</span> or <span>WebGLRenderingContext</span> or <span>WebGL2RenderingContext</span>) <dfn>OffscreenRenderingContext</dfn>;

dictionary <dfn>ImageEncodeOptions</dfn> {
DOMString <span data-x="image-encode-options-type">type</span> = "image/png";
unrestricted double <span data-x="image-encode-options-quality">quality</span>;
};

enum <dfn>OffscreenRenderingContextId</dfn> { "<span data-x="offscreen-context-type-2d">2d</span>", "<span data-x="offscreen-context-type-webgl">webgl</span>", "<span data-x="offscreen-context-type-webgl2">webgl2</span>" };
enum <dfn>OffscreenRenderingContextId</dfn> { "<span data-x="offscreen-context-type-2d">2d</span>", "<span data-x="offscreen-context-type-bitmaprenderer">bitmaprenderer</span>, "<span data-x="offscreen-context-type-webgl">webgl</span>", "<span data-x="offscreen-context-type-webgl2">webgl2</span>" };

[<span data-x="dom-OffscreenCanvas">Constructor</span>([EnforceRange] unsigned long long width, [EnforceRange] unsigned long long height), Exposed=(Window,Worker), <span>Transferable</span>]
interface <dfn>OffscreenCanvas</dfn> : <span>EventTarget</span> {
Expand Down Expand Up @@ -65371,6 +65369,7 @@ interface <dfn>OffscreenCanvas</dfn> : <span>EventTarget</span> {
<p>Returns an object that exposes an API for drawing on the <code>OffscreenCanvas</code>
object. <var>contextId</var> specifies the desired API: "<code
data-x="offscreen-context-type-2d">2d</code>", "<code
data-x="offscreen-context-type-bitmaprenderer">bitmaprenderer</code>", "<code
data-x="offscreen-context-type-webgl">webgl</code>", or "<code
data-x="offscreen-context-type-webgl2">webgl2</code>". <var>options</var> is handled by that
API.</p>
Expand Down Expand Up @@ -65402,6 +65401,7 @@ interface <dfn>OffscreenCanvas</dfn> : <span>EventTarget</span> {
has a <dfn data-x="offscreencanvas-context-mode">context mode</dfn>, which is initially <dfn
data-x="offscreencanvas-context-none">none</dfn> but can be changed to either <dfn
data-x="offscreencanvas-context-2d">2d</dfn>, <dfn
data-x="offscreencanvas-context-bitmaprenderer">bitmaprenderer</dfn>, <dfn
data-x="offscreencanvas-context-webgl">webgl</dfn>, <dfn
data-x="offscreencanvas-context-webgl2">webgl2</dfn>, or <dfn
data-x="offscreencanvas-context-detached">detached</dfn> by algorithms defined in this
Expand Down Expand Up @@ -65480,15 +65480,16 @@ interface <dfn>OffscreenCanvas</dfn> : <span>EventTarget</span> {
<td>
<th><span data-x="offscreencanvas-context-none">none</span>
<th><span data-x="offscreencanvas-context-2d">2d</span>
<th><span data-x="offscreencanvas-context-bitmaprenderer">bitmaprenderer</span>
<th><span data-x="offscreencanvas-context-webgl">webgl</span> or <span
data-x="offscreencanvas-context-webgl2">webgl2</span>
<th><span data-x="offscreencanvas-context-detached">detached</span>
<tbody>
<tr>
<th>"<dfn><code data-x="offscreen-context-type-2d">2d</code></dfn>"
<td>
Follow the steps to <span data-x="Offscreen 2D context creation algorithm">create an
offscreen 2D context</span> defined in the section below, passing it this
Follow the <span data-x="Offscreen 2D context creation algorithm">offscreen 2D context
creation algorithm</span> defined in the section below, passing it this
<code>OffscreenCanvas</code> object and <var>options</var>, to obtain an
<code>OffscreenCanvasRenderingContext2D</code> object; if this does not throw an exception,
then set this <code>OffscreenCanvas</code> object's <span
Expand All @@ -65500,6 +65501,28 @@ interface <dfn>OffscreenCanvas</dfn> : <span>EventTarget</span> {
first argument.
<td>
Return null.
<td>
Return null.
<td>
Throw an <span>"<code>InvalidStateError</code>"</span> <code>DOMException</code>.
<tr>
<th>"<dfn><code data-x="offscreen-context-type-bitmaprenderer">bitmaprenderer</code></dfn>"
<td>
Follow the <span><code>ImageBitmapRenderingContext</code> creation algorithm</span>
defined in the section above, passing it this
<code>OffscreenCanvas</code> object and <var>options</var>,
to obtain an <code>ImageBitmapRenderingcontext</code> object; if this does not throw
an exception, then set this <code>OffscreenCanvas</code> object's <span
data-x="offscreencanvas-context-mode">context mode</span> to <span
data-x="offscreencanvas-context-bitmaprenderer">bitmaprenderer</span>, and return the new
<code>ImageBitmapRenderingcontext</code> object.
<td>
Return null.
<td>
Return the same object as was returned the last time the method was invoked with this same
first argument.
<td>
Return null.
<td>
Throw an <span>"<code>InvalidStateError</code>"</span> <code>DOMException</code>.
<tr>
Expand All @@ -65516,6 +65539,8 @@ interface <dfn>OffscreenCanvas</dfn> : <span>EventTarget</span> {
spec=WEBGL>
<td>
Return null.
<td>
Return null.
<td>
Return the same value as was returned the last time the method was invoked with this same
first argument.
Expand Down Expand Up @@ -122790,6 +122815,7 @@ INSERT INTERFACES HERE
Joshua Bell,
Joshua Randall,
Juan Olvera, <!-- thinkxl on GitHub -->
Juanmi Huertas,
Jukka K. Korpela,
Jules Cl&eacute;ment-Ripoche,
Julian Reschke,
Expand Down

0 comments on commit 8433bfc

Please sign in to comment.