-
Notifications
You must be signed in to change notification settings - Fork 24
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
Fix Canvas2D fonts performance #253
Fix Canvas2D fonts performance #253
Conversation
forceFullLayoutCalc: false, | ||
textW: 0, | ||
textH: 0, | ||
fontInfo: undefined, | ||
fontFaceLoadedHandler: undefined, | ||
isRenderable: false, | ||
isScrollable: props.scrollable === true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to make this a state property? If a user were to change the scrollable
property of a Text Node mid-lifecycle it would not have any affect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's exactly why. I figured it might be better to stay on the 3 canvasPage rendering instead of going back to the single, to avoid large discrepancies with rendering and positioning. If you feel that would be a better path, easy to flip it back to just state.props.scrollable
and not have this here.
that said would this really be a usecase? a user repurposing a large chunk of scrollable text to a single non-scrollable piece of text?
f1a8101
to
66a5056
Compare
66a5056
to
a651bd5
Compare
@@ -160,6 +160,18 @@ export class ImageTexture extends Texture { | |||
return `ImageTexture,${key},${resolvedProps.premultiplyAlpha ?? 'true'}`; | |||
} | |||
|
|||
override free(): void { | |||
if (this.props.src instanceof ImageData) { | |||
// ImageData is a non-cacheable texture, so we need to free it manually |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incorrect since the addition of the image factory/key PR #256
Replaced by #319 |
This PR adds a "single page" Canvas2D text rendering path for small Canvas text usage along side of the original "scrollable" Canvas2D text path.