Wrong results with UNPACK_FLIP_Y_WEBGL and createImageBitmap imageOrientation

NEW
Unassigned

Status

()

defect
P3
normal
2 years ago
18 days ago

People

(Reporter: the.spite, Unassigned)

Tracking

(Blocks 2 bugs)

55 Branch
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: gfx-noted)

Attachments

(2 attachments, 4 obsolete attachments)

Reporter

Description

2 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36
Firefox for Android

Steps to reproduce:

When using texImage2D/texSubImage2D providing an ImageBitmap, the combinations of UNPACK_FLIP_Y_WEBGL and imageOrientation specified on createImageBitmap are inconsistent.

Here's a test case with all combinations: https://www.clicktorelease.com/tmp/texImage2D/
Code is here: https://github.com/spite/texImage2D


Actual results:

"ImageBitmap, UNPACK_FLIP_Y_WEBGL false, imageOrientation flipY" should be upright, it's upside down.
"ImageBitmap, UNPACK_FLIP_Y_WEBGL true, imageOrientation default" should be upside down, it's upright.


Expected results:

The combination of flipY on texture and imagebitmap should yield correct results.

Comment 1

2 years ago
Note that this is in the context of trying to integrate ImageBitmap support into the popular Three.js library.

Support for the imageOrientation ImageBitmap creation option is needed in order to do this -- because it's using WebGL under the scenes.
Status: UNCONFIRMED → NEW
Component: Untriaged → Canvas: 2D
Ever confirmed: true
Product: Firefox → Core
See Also: → 1335594
Flags: needinfo?(jgilbert)
Whiteboard: gfx-noted
I can confirm this problem and it prevents us from using createImageBitmap.

We do not support createImageBitmap options yet...

Comment 4

24 days ago
Posted file IGNORE SUBMITTED IN ERROR (obsolete) —

Comment 5

24 days ago
Posted file IGNORE SUBMITTED IN ERROR (obsolete) —

Comment 6

24 days ago
Posted file IGNORE SUBMITTED IN ERROR (obsolete) —
Attachment #9061851 - Attachment description: Bug 1367251 - ignore gl.UNPACK_FLIP_Y_WEBGL for textures uploading ImageBitmap data as per spec. r=lsalzman → Bug 1367251 IGNORE SUBMITTED IN ERROR
Attachment #9061849 - Attachment description: Bug 1367251 - ignore gl.UNPACK_FLIP_Y_WEBGL for textures uploading ImageBitmap data as per spec. r=lsalzman → IGNORE SUBMITTED IN ERROR
Attachment #9061848 - Attachment description: Bug 1367251 - ignore gl.UNPACK_FLIP_Y_WEBGL for textures uploading ImageBitmap data as per spec. r=lsalzman → IGNORE SUBMITTED IN ERROR
Attachment #9061851 - Attachment description: Bug 1367251 IGNORE SUBMITTED IN ERROR → IGNORE SUBMITTED IN ERROR
Attachment #9061851 - Attachment is obsolete: true
Attachment #9061849 - Attachment is obsolete: true
Attachment #9061848 - Attachment is obsolete: true

Comment 8

24 days ago

Add optional options Dictionary. Later patches will add
implementation of imageOrientation: none|flipY.

Component: Canvas: 2D → Canvas: WebGL
Flags: needinfo?(jgilbert)

We need to be sure we aren't running too far ahead of where the spec is:
https://github.com/whatwg/html/pull/4248

Presumably this blocks 1442632 because that will need ImageBitmapOptions too?

That said, I'd like to understand whether our plan is to implement all the currently-specified options, or only some of them, or something else?

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

Hmm. The spec already has an ImageBitmapOptions argument for createImageBitmap. That PR adds a new API for creating options objects that lets one easily detect which dictionary members on ImageBitmapOptions are supported, but doesn't affect the createImageBitmap() behavior, right?

I guess if https://github.com/whatwg/html/pull/4248#issuecomment-449221598 (and hence making ImageBitmapOptions an interface) is still on the table then we need to worry about that, but given that Chrome is shipping ImageBitmapOptions as a dictionary already that would still need to be supported not matter what, right?

Blocks: 1442632

Comment 11

18 days ago

Add optional options Dictionary. Later patches will add
implementation of imageOrientation: none|flipY.

Attachment #9063164 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.