CesiumGS / cesium

An open-source JavaScript library for world-class 3D globes and maps :earth_americas:
https://cesium.com/cesiumjs/
Apache License 2.0
12.47k stars 3.39k forks source link

Consider using ImageBitmapOptions for createImageBitmap #7432

Open loshjawrence opened 5 years ago

loshjawrence commented 5 years ago

Got a heads-up from @pjcozzi. Looks like there will some way of seeing what createImageBitmap options are available. Consider using this in our createImageBitmap usage(which itself is not in cesium main yet, but has value when streaming image heavy models. See: https://github.com/AnalyticalGraphicsInc/cesium/issues/6624)

whatwg pr: https://github.com/whatwg/html/pull/4248

From that commit:

Constructs and returns a new ImageBitmapOptions dictionary whose attributes are initialized to the corresponding attributes of the options dictionary. Only those attributes which are recognized by the user agent are included in the returned dictionary. This allows web applications to detect which ImageBitmap creation options are supported.

OmarShehata commented 5 years ago

We've added createImageBitmap. Until this is supported by browsers, we actually attempt to decode a 1x1 image and see if it throws any errors given these options.