Bug 1141979 - part14 - WebIDL for bindings; r=jrmuizel, r=smaug
authorKaku Kuo <tkuo@mozilla.com>
Wed, 27 Apr 2016 11:47:54 +0800
changeset 341165 4d2062a9112b64d9928612abb90193107da28695
parent 341164 e194ddd9ae5f50032ffccfec4a984bd9d0386443
child 341166 e46ee796c1d535e89d680ac7d4c57ba079e84b77
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel, smaug
bugs1141979
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1141979 - part14 - WebIDL for bindings; r=jrmuizel, r=smaug MozReview-Commit-ID: 5iR0WUuX6Zu
dom/webidl/ImageBitmap.webidl
--- a/dom/webidl/ImageBitmap.webidl
+++ b/dom/webidl/ImageBitmap.webidl
@@ -51,16 +51,28 @@ partial interface ImageBitmap {
 };
 
 [NoInterfaceObject, Exposed=(Window,Worker)]
 interface ImageBitmapFactories {
   [Throws]
   Promise<ImageBitmap> createImageBitmap(ImageBitmapSource aImage);
   [Throws]
   Promise<ImageBitmap> createImageBitmap(ImageBitmapSource aImage, long aSx, long aSy, long aSw, long aSh);
+
+  // Extensions
+  // Bug 1141979 - [FoxEye] Extend ImageBitmap with interfaces to access its
+  // underlying image data
+  //
+  // Note:
+  // Overloaded functions cannot have different "extended attributes",
+  // so I cannot add preference on the extended version of createImageBitmap().
+  // To work around, I will then check the preference at run time and throw if
+  // the preference is set to be false.
+  [Throws]
+  Promise<ImageBitmap> createImageBitmap(ImageBitmapSource aImage, long aOffset, long aLength, ImageBitmapFormat aFormat, ImagePixelLayout aLayout);
 };
 
 // ImageBitmap-extensions
 // Bug 1141979 - [FoxEye] Extend ImageBitmap with interfaces to access its
 // underlying image data
 
 /*
  * An image or a video frame is conceptually a two-dimensional array of data and
@@ -404,8 +416,17 @@ dictionary ChannelPixelLayout {
     required unsigned long              width;
     required unsigned long              height;
     required ChannelPixelLayoutDataType dataType;
     required unsigned long              stride;
     required unsigned long              skip;
 };
 
 typedef sequence<ChannelPixelLayout> ImagePixelLayout;
+
+partial interface ImageBitmap {
+    [Throws, Func="mozilla::dom::ImageBitmap::ExtensionsEnabled"]
+    ImageBitmapFormat               findOptimalFormat (optional sequence<ImageBitmapFormat> aPossibleFormats);
+    [Throws, Func="mozilla::dom::ImageBitmap::ExtensionsEnabled"]
+    long                            mappedDataLength (ImageBitmapFormat aFormat);
+    [Throws, Func="mozilla::dom::ImageBitmap::ExtensionsEnabled"]
+    Promise<ImagePixelLayout> mapDataInto (ImageBitmapFormat aFormat, BufferSource aBuffer, long aOffset);
+};
\ No newline at end of file