Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion glutin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ default = ["x11", "wayland", "wayland-dlopen"]

[dependencies]
lazy_static = "1.3"
winit = { version = "0.26", default-features = false }
winit = { version = "0.26", default-features = false, path="../../winit" }

[target.'cfg(target_os = "android")'.dependencies]
android_glue = "0.2"
Expand Down
7 changes: 6 additions & 1 deletion glutin/src/api/android/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::api::egl::{Context as EglContext, NativeDisplay, SurfaceType as EglSu
use crate::CreationError::{self, OsError};
use crate::{Api, ContextError, GlAttributes, PixelFormat, PixelFormatRequirements, Rect};

use crate::platform::android::EventLoopExtAndroid;
use crate::platform::android::EventLoopWindowTargetExtAndroid;
use glutin_egl_sys as ffi;
use parking_lot::Mutex;
use winit;
Expand Down Expand Up @@ -142,6 +142,11 @@ impl Context {
#[inline]
pub fn resize(&self, _: u32, _: u32) {}

#[inline]
pub fn buffer_age(&self) -> u32 {
self.0.egl_context.buffer_age()
}

#[inline]
pub fn is_current(&self) -> bool {
self.0.egl_context.is_current()
Expand Down
10 changes: 8 additions & 2 deletions glutin/src/api/egl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ impl Context {
pub fn swap_buffers_with_damage(&self, rects: &[Rect]) -> Result<(), ContextError> {
let egl = EGL.as_ref().unwrap();

if !egl.SwapBuffersWithDamageKHR.is_loaded() {
if !self.swap_buffers_with_damage_supported() {
return Err(ContextError::FunctionUnavailable);
}

Expand Down Expand Up @@ -658,12 +658,18 @@ impl Context {
}

#[inline]
#[cfg(not(target_os = "windows"))]
#[cfg(not(any(target_os = "windows", target_os = "android")))]
pub fn swap_buffers_with_damage_supported(&self) -> bool {
let egl = EGL.as_ref().unwrap();
egl.SwapBuffersWithDamageKHR.is_loaded()
}

#[inline]
#[cfg(target_os = "android")]
pub fn swap_buffers_with_damage_supported(&self) -> bool {
true
}

#[inline]
pub fn get_pixel_format(&self) -> PixelFormat {
self.pixel_format.clone()
Expand Down