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 upArithmetic overflow on shrinking window #236
Closed
Comments
|
I'm going to spend a bit of time trying to fix this. |
bors-servo
added a commit
that referenced
this issue
Mar 29, 2016
Use signed arithmetic to avoid underflow when shrinking window. fixes #236 The underflow occurs when the y co-ordinate of `viewport_size` in the last `render_api.set_root_stacking_context` call is bigger than the y co-ordinate of `framebuffer_size` in a `renderer.render` call. The problem is the calculated layer_origin y is negative, but we calculate it using unsigned ints, and then cast to signed just for the gl calls. The two places where this calculated value is used are `gl::scissor` and `gl::viewport`, both of these are perfectly happy with a negative origin point (as far as I know and can tell, but I don't have much experience with opengl), thus I've just changed it so we cast to signed integers early. The other options would be to require the above doesn't happen, either by using an outdated bigger framebuffer size (which results in the contents of the window moving upwards as the window shrinks), or recalling `set_root_stacking_context` (which is less efficient).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Webrender programs (including servo) crash when shrinking the window with the following error:
Backtrace generated from this code but servo generates a slightly longer but otherwise identical one.