mirror of
https://github.com/servo/servo.git
synced 2025-08-11 08:25:32 +01:00
Fix viewport origin of webrender frame (#30088)
* Fix viewport origin of webrender frame * Update documentations
This commit is contained in:
parent
c264993da8
commit
1f7f4cf2be
3 changed files with 13 additions and 1 deletions
|
@ -200,6 +200,13 @@ pub struct EmbedderCoordinates {
|
|||
}
|
||||
|
||||
impl EmbedderCoordinates {
|
||||
/// Get the unflipped viewport rectangle for use with the WebRender API.
|
||||
pub fn get_viewport(&self) -> DeviceIntRect {
|
||||
DeviceIntRect::from_untyped(&self.viewport.to_untyped())
|
||||
}
|
||||
|
||||
/// Get the flipped viewport rectangle. This should be used when drawing directly
|
||||
/// to the framebuffer with OpenGL commands.
|
||||
pub fn get_flipped_viewport(&self) -> DeviceIntRect {
|
||||
let fb_height = self.framebuffer.height;
|
||||
let mut view = self.viewport.clone();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue