Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upInvert control flow, fix resizing, and improve checkerboarding significantly #3761
Conversation
hoppipolla-critic-bot
commented
Oct 21, 2014
|
Critic review: https://critic.hoppipolla.co.uk/r/2934 This is an external review system which you may optionally use for the code review of your pull request. In order to help critic track your changes, please do not make in-place history rewrites (e.g. via |
| @@ -33,7 +33,7 @@ dependencies = [ | |||
| "egl 0.1.0 (git+https://github.com/servo/rust-egl#88f2a13812ddbce2bf2317221663a61c31b3e220)", | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| let have_unused_buffers = unused_buffers.len() > 0; | ||
| self.recomposite = self.recomposite || have_unused_buffers; | ||
| if have_unused_buffers { | ||
| let no_unused_buffers = unused_buffers.len() == 0; |
This comment has been minimized.
This comment has been minimized.
glennw
Oct 22, 2014
Member
Why no_unused_buffers here? have_unused_buffers seems clearer and doesn't require the !
| /// The number of nanoseconds per millisecond. | ||
| static NS_PER_MS: u64 = 1_000_000; | ||
|
|
||
| /// FIXME(pcwalton): This is NTSC; do we have to do anything different elsewhere? |
This comment has been minimized.
This comment has been minimized.
| ScheduleRefreshMsg(time) => { | ||
| let target = time as i64 + (REFRESH_RATE as i64) - (COMPOSITING_TIME as i64); | ||
| let delta = target - time::precise_time_ns() as i64; | ||
| timer::sleep(Duration::nanoseconds(delta)); |
This comment has been minimized.
This comment has been minimized.
glennw
Oct 22, 2014
Member
On Windows in particular, the OS sleep is often +/- 10ms, sometimes more, which seems like it would cause issues implementing the refresh driver this way? Do you think it's feasible to drive it directly from vsync?
This comment has been minimized.
This comment has been minimized.
pcwalton
Oct 22, 2014
Author
Contributor
How would we drive it from vsync in OpenGL? The message is sent immediately after glfwSwapBuffers() returns.
This comment has been minimized.
This comment has been minimized.
glennw
Oct 22, 2014
Member
I'm probably missing something completely obvious, but I'm not sure why the compositor can't just run at 60 fps (locked to vsync), like a game style render loop - what is the reason for having the refresh driver being a separate task?
|
I think what's causing problems here is that I'm trying to do too much in this "refresh driver". What I'm doing here is not a refresh driver at all—it's a scrolling timer. All I want to do is to allow scrolling events to bunch up for 12ms before we time out and composite anyway (and show a checkerboard) after a scroll event. This problem is specific to scrolling because "normal" page updates initiated by the page itself don't have this problem: they paint themselves instead of having the compositor request painting. Building a "scrolling timer" is a much more self-contained task than making a "refresh driver". The solution, I think, is to put scrolling only on this "scrolling timer". All other updates just go through regular |
|
@glennw re-r? I converted the "refresh driver" into a system that simply delays composites for scroll messages to give tiles time to paint when you scroll to them. Compositing happens immediately for other kinds of messages (unless compositing later in the frame was inevitable due to a scroll event). This feels a bit simpler/less fragile/more conventional. |
aa50241
to
9e99f7c
|
Mac:
Linux:
|
cd21233
to
c387cde
|
@bors: retry |
|
This timed out while running linux reftests on both runs. Does this pass locally for you? |
significantly by giving tiles some time to paint before we render unrendered content.
This comment has been minimized.
This comment has been minimized.
larsbergstrom
commented on 10f7b49
Nov 5, 2014
|
r+ |
This comment has been minimized.
This comment has been minimized.
jdm
replied
Nov 5, 2014
|
@bors: retry |
This comment has been minimized.
This comment has been minimized.
|
saw approval from larsbergstrom |
This comment has been minimized.
This comment has been minimized.
|
merging pcwalton/servo/smooth-scrolling = 10f7b49 into auto |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
some tests failed: |
This comment has been minimized.
This comment has been minimized.
|
saw approval from larsbergstrom |
This comment has been minimized.
This comment has been minimized.
|
merging pcwalton/servo/smooth-scrolling = 10f7b49 into auto |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
all tests pass: |
This comment has been minimized.
This comment has been minimized.
|
fast-forwarding master to auto = ffae110 |
|
Failure is:
|
This begins porting the Android event loop to work with the inverted flow control from servo#3761. Unfortunately, GLUT does not give us enough control over the event loop to really make this work, so this will build but it may not run properly. Our current plan is to get rid of GLUT and switch to Glutin in the near future. r? @pcwalton
This begins porting the Android event loop to work with the inverted flow control from #3761. Unfortunately, GLUT does not give us enough control over the event loop to really make this work, so this will build but it may not run properly. Our current plan is to get rid of GLUT and switch to Glutin in the near future. r? @pcwalton
This begins porting the Android event loop to work with the inverted flow control from #3761. Unfortunately, GLUT does not give us enough control over the event loop to really make this work, so this will build but it may not run properly. Our current plan is to get rid of GLUT and switch to Glutin in the near future. r? @pcwalton
pcwalton commentedOct 21, 2014
r? @glennw @mbrubeck