w3c / mediacapture-worker

MediaStream with worker
Other
9 stars 12 forks source link

Drop the cropping variant of creating ImageBitmap from an ArrayBuffer. #48

Closed kakukogou closed 8 years ago

kakukogou commented 8 years ago

Following the discussion at Mozilla bugzilla bug1141979 comment278.

@jrmuizel suggests that dropping the cropping variant of ImageBitmapFactory extensions:

[NoInterfaceObject, Exposed=(Window,Worker)]
partial interface ImageBitmapFactories {
    // Keep this.
    Promise<ImageBitmap> createImageBitmap(BufferSource buffer,
                                           long offset,
                                           long length,
                                           ImageFormat format,
                                           ImageFormatPixelLayout layout);

    // Drop this.
    Promise<ImageBitmap> createImageBitmap(BufferSource buffer,
                                           long offset,
                                           long length,
                                           ImageFormat format,
                                           ImageFormatPixelLayout layout,
                                           long sx,
                                           long sy,
                                           long sw,
                                           long sh);
};

Before, the reason why I chose to keep the copping variant is to keep the same behavior of the existing API. However, after the implementation and reviewing, we have already filed two issues, #43 and #46, to add exceptions on it. So, the extension API now has different behaviors to the existing API.

Personally, I agree to drop the cropping variant to simplification, however I still would like to listen to more thoughts on it. @rocallahan, @anssiko, @ChiahungTai and @smaug----.

smaug---- commented 8 years ago

At least the initial version of the API could be without the latter version of the method. If it is needed, it can be added back (and then #43 and #46 should be fixed).