Skip to content
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

Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true #1282

Open
coderextreme opened this issue Jul 12, 2023 · 9 comments

Comments

@coderextreme
Copy link
Contributor

coderextreme commented Jul 12, 2023

‘’’
Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true. See:
x3dom-full.debug.js:21721 Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true. See: https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-will-read-frequently
x3dom.Texture.uploadTextMipmap @ x3dom-full.debug.js:21721
x3dom-full.debug.js:21721 Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true. See: https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-will-read-frequently
x3dom.Texture.uploadTextMipmap @ x3dom-full.debug.js:21721
x3dom-full.debug.js:21721 Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true. See: https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-will-read-frequently
x3dom.Texture.uploadTextMipmap @ x3dom-full.debug.js:21721
x3dom-full.debug.js:21721 Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true. See: https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-will-read-frequently
x3dom.Texture.uploadTextMipmap @ x3dom-full.debug.js:21721
x3dom-full.debug.js:21721 Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true. See: https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-will-read-frequently
x3dom.Texture.uploadTextMipmap @ x3dom-full.debug.js:21721
x3dom-full.debug.js:21721 Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true. See: https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-will-read-frequently
x3dom.Texture.uploadTextMipmap @ x3dom-full.debug.js:21721
x3dom-full.debug.js:21721 Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true. See: https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-will-read-frequently
x3dom.Texture.uploadTextMipmap @ x3dom-full.debug.js:21721
x3dom-full.debug.js:21721 Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true. See: https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-will-read-frequently
x3dom.Texture.uploadTextMipmap @ x3dom-full.debug.js:21721
x3dom-full.debug.js:21721 Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true. See: https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-will-read-frequently
‘’’

@andreasplesch
Copy link
Contributor

Thanks,

gl.texImage2D( this.type, level++, this.format, this.format, gl.UNSIGNED_BYTE, ctx2d.getImageData( 0, 0, w2, h2 ) );

seems the only place where getImageData is called, for setting up rendering Text. It is called rarely, eg. not every frame.

See https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/getContext#willreadfrequently

Sounds like it trades off memory vs. performance. Probably not applicable here.

@coderextreme
Copy link
Contributor Author

coderextreme commented Jul 12, 2023 via email

@coderextreme
Copy link
Contributor Author

coderextreme commented Jul 12, 2023 via email

@andreasplesch
Copy link
Contributor

andreasplesch commented Jul 12, 2023

Thanks. The picture did not make it.

https://www.web3d.org/x3d/content/examples/HumanoidAnimation/Skin/BoxMan4AnimationPanelX3dom.xhtml

seems to work. Is the same panel ?

@coderextreme
Copy link
Contributor Author

coderextreme commented Jul 12, 2023 via email

@coderextreme
Copy link
Contributor Author

coderextreme commented Jul 12, 2023 via email

@andreasplesch
Copy link
Contributor

The picture did not make it.

@coderextreme
Copy link
Contributor Author

coderextreme commented Jul 14, 2023 via email

@andreasplesch
Copy link
Contributor

Yes, it was a typo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants