-
Notifications
You must be signed in to change notification settings - Fork 2
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
lottie: Support Device Pixel Ratio #31
Conversation
Support DPR scaling as a browser scale factor. Issue: #14
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@tinyjin thanks, is it easy to apply DPR skottie? |
@hermet I guess not so difficult. I'll bring it on skottie as well. Should I include skottie DPR in this PR? |
if it's not hard, that would be nice! |
Got it. WIl do soon! |
Want to have DPR as option for each player. However just introduced devicePixelRatio over RenderConfig isn't delivered to NPM package yet. I'll add DPR option toggling on perf-test after coming release with this update |
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.
could you please consider this option? I don't see the reason we
Introduce renderConfig property to have devicePixelRatio as an optional value.
let initialized = false; | ||
let changingRatio = false; |
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 looks unnecessary?
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.
Without this, Yes it works. But to change DPR with canvasKit, calling MakeSWCanvasSurface
is required after DPR changed, this call takes seconds to process them.
So I define this status to avoid duplicated calling while canvas is built. Because drawFrame
is called every frame, I use this condition for the duplicated processing.
if (dpr !== ratio && !changingRatio) {
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.
But your logic looks wiered. changingRatio is only toggled in the scope? Is it correct?
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.
drawFrame()
is parallelly called. When MakeSWCanvasSurface
hangs on, another drawFrame()
newly called.
If changingRatio is true
, we can skip these process in newly called callback.
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.
it sounds like the context can be broken. should be never happend.
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.
Actually we don't need this logic. We just use system default value for DPR. Don't need to think of change in time.
Support DPR scaling as a browser scale factor.
Issue: #14
[Before in x300 scale]
[After in x300 scale]