1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/.
6 * The origin of this IDL file is
7 * https://wiki.whatwg.org/wiki/OffscreenCanvas
9 * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
10 * Opera Software ASA. You are granted a license to use, reproduce
11 * and create derivative works of this document.
14 // The new ImageBitmapRenderingContext is a canvas rendering context
15 // which only provides the functionality to replace the canvas's
16 // contents with the given ImageBitmap. Its context id (the first argument
17 // to getContext) is "bitmaprenderer".
18 [Exposed=(Window,Worker)]
19 interface ImageBitmapRenderingContext {
20 readonly attribute CanvasSource? canvas;
22 // Displays the given ImageBitmap in the canvas associated with this
23 // rendering context. Ownership of the ImageBitmap is transferred to
24 // the canvas. The caller may not use its reference to the ImageBitmap
25 // after making this call. (This semantic is crucial to enable prompt
26 // reclamation of expensive graphics resources, rather than relying on
27 // garbage collection to do so.)
29 // The ImageBitmap conceptually replaces the canvas's bitmap, but
30 // it does not change the canvas's intrinsic width or height.
32 // The ImageBitmap, when displayed, is clipped to the rectangle
33 // defined by the canvas's instrinsic width and height. Pixels that
34 // would be covered by the canvas's bitmap which are not covered by
35 // the supplied ImageBitmap are rendered transparent black. Any CSS
36 // styles affecting the display of the canvas are applied as usual.
38 undefined transferFromImageBitmap(ImageBitmap? bitmap);
40 // Deprecated version of transferFromImageBitmap
41 [Deprecated="ImageBitmapRenderingContext_TransferImageBitmap", Throws]
42 undefined transferImageBitmap(ImageBitmap bitmap);