-
Notifications
You must be signed in to change notification settings - Fork 178
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 against severe FPS drops by scrollbar #2087
Conversation
LGTM, @bradallred ? |
Feels like a hack; tho I must admit it's not clear to me what exactly is happening. I suspect this might cause issues with some places with nested views. At a minimum, the name is indeed confusing. IIRC, Seems that the visibility check is there to handle when views change visibility only, so just a single frame of redrawing is needed. Maybe some way of tracking that then? Maybe We can punt on it for now and commit this if that is too much to ask or otherwise infeasible. |
Yeah. Maybe you remember the case you were fixing in this commit, i. e. the example?
Not sure if this is actually helpful if we had that (I just did not do the math for the regions). Structure is: ScrollView
So
Sure, that is probably the clean way to do but I expect this to be some more work with regressions to look out for. |
I don't. There may be some neighboring commits with clues.
Right, and we do that because there is no mechanism in place for partial redrawing All that aside, I think there is possibly an easier fix. IIRC, |
You mean like this? diff --git a/gemrb/core/GUI/View.cpp b/gemrb/core/GUI/View.cpp
index 731ad3bfe..76227c1c8 100644
--- a/gemrb/core/GUI/View.cpp
+++ b/gemrb/core/GUI/View.cpp
@@ -177,7 +177,7 @@ Regions View::DirtySuperViewRegions() const
return {};
}
- if (NeedsDraw() || (!IsVisible() && !HasIntrinsicInvisibility())) {
+ if ((NeedsDraw() || !IsVisible()) && !frame.size.IsInvalid()) {
return { frame };
} Works. |
yes, roughly, except I was thinking is would be a condition for the case returning an empty set (like If it works, lets do that. |
`IsInvisible` is too broad since scroll bars may be invisible and thus ask for background redrawing. But since they are shrinked to zero, we don't have to check for that state.
b271a66
to
b5e0e69
Compare
Alright, here we go. |
Quality Gate passedIssues Measures |
Thanks, great work diagnosing too. |
Description
I noticed that opening some text sections, like a mildly filled journal or dialogs, drops FPS by up to 75%.
That is because 382ed93 checks whether invisibility is set to get a background redraw of something after turning invisible. Problem: scrollbars may be invisible by design, so that neighbouring content view is marked dirty and thus it draws fonts over and over again, even if nothing actually requires redrawing.
I made
ScrollBar
exempt from counting for this invisibility check, not sure if the name suits well but I still can't come up with any better one.Checklist