New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adapt loader to output blob for createImageBitmap #4611
Comments
never mind |
Yes, I know that the current version doesn't use createBitmap. This issue targets the current next branch as stated above in the Setup section. |
Can you measure it in firefox? |
I would love to do measurements in Firefox, unfortunately I am not really familiar with their developer tools. Especially the performance tools a hard to read and I don't get any reasonable information from that :/ |
You can specify how an image should be loaded already, it just defaults to using You can set an individual resource's load type like so: loader.add('myimage', 'myimage.png', { loadType: Resource.LOAD_TYPE.XHR, xhrType: Resource.XHR_RESPONSE_TYPE.BLOB }); That will force the loader to load that single image as a Blob over XHR, but will refer back to the extension map for any other images. If you want to force all images to load as XHR blobs, resource-loader supports doing so by extension: Resource.setExtensionLoadType('png', Resource.LOAD_TYPE.XHR);
Resource.setExtensionXhrType('png', Resource.XHR_RESPONSE_TYPE.BLOB); This modifies the map linked above to map 'png' to being loaded over XHR as a Blob. When you add a resource without a specific loadType, it will look up the extension in the map and find your changed defaults. If there is no entry in the extension-loadType mapping it will fall back to XHR. If there is no entry in the extension-xhrType mapping it will fall back to Text. I think in pixi resource-loader's Hope this helps. |
@englercj Ah good to know. Unfortunately this still doesn't work as wanted. The It's important to pass a |
I'm slowly digging through all the source code but still missing the whole picture. I'll submit a pull request whenever I am ready. |
It would be good to get another specialist on texture uploading process in v5. I, @bigtimebuddy and @GoodBoyDigital understand how it works. We've made texture-resource refactoring, but we didnt test |
texture-resource API is upgraded from |
Hi @m9dfukc - Have you had a chance to look at opening a PR for this? Thanks! :) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Setup:
Pixi: v5 next #cb75b1d,
Browser: Chrome 64.0.3282
OS: macOs 10.12.06
What happens:
I am trying to offload image decoding from the main thread to avoid bumps in framerate. Using the current version of Pixi.js next the ResourceLoader provides an
HTMLImageElement
tocreateImageBitmap
which seems to block the main thread as opposed tocreateImageBitmap(Blob)
which spans a separate thread.Code to replicate:
I uploaded my test code to github which you can find here.
The text was updated successfully, but these errors were encountered: