DescriptionMake ImageBitmap transferable work with ImageBitmapOptions
At this moment, transfer an ImageBitmap works fine with an ImageBitmap
created with the default options. Now that we have options of flipY and
premultiplyAlpha, we should make sure that the transfer logic works.
To verify that, we create an ImageBitmap with flipY=true and premultiplyAlpha
=false, we transfer this ImageBitmap to the worker thread and worker
transfer it back to the main thread. Now on the main thread, the ImageBitmap
should have the same pixel data as the originally created one.
The tricky part here is that when transferring an ImageBitmap to worker,
we are actually pass a StaticBitmapImage which is stored internally in
the ImageBitmap. Since StaticBitmapImage doesn't have info about whether
it is premultiplied alpha or not, we will lose this info. To make sure
the transferring logic is correct, we add a member m_isPremultiplied to
StaticBitmapImage, and ImageBitmap keeps track of this member.
A layout test is added to make sure that the ImageBitmap's pixel data
survives the round trip from main<-->worker thread.
Committed: https://crrev.com/162000219b284ce3b5e98129d8bde4f06bb9c8cc
Cr-Commit-Position: refs/heads/master@{#383780}
Patch Set 1 #Patch Set 2 : Also testing create ImageBitmap on worker with options #Patch Set 3 : Don't flip again on worker #Patch Set 4 : rebase #
Total comments: 4
Patch Set 5 : add comments #
Messages
Total messages: 15 (5 generated)
|