aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/osmesa
diff options
context:
space:
mode:
authorPierre Krieger <pierre.krieger1708@gmail.com>2015-09-21 14:42:05 +0200
committerPierre Krieger <pierre.krieger1708@gmail.com>2015-09-23 13:11:47 +0200
commitaa9cb99929ee1893699184ded888b2586455f016 (patch)
treeb16503dbfe2248beeed0f7d82b150e64e6453043 /src/api/osmesa
parent3820d307a3f23828790e8a46a9c46849592104d6 (diff)
downloadglutin-aa9cb99929ee1893699184ded888b2586455f016.tar.gz
glutin-aa9cb99929ee1893699184ded888b2586455f016.zip
Add #[inline] attributes
Diffstat (limited to 'src/api/osmesa')
-rw-r--r--src/api/osmesa/mod.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/api/osmesa/mod.rs b/src/api/osmesa/mod.rs
index ca34e93..c41c997 100644
--- a/src/api/osmesa/mod.rs
+++ b/src/api/osmesa/mod.rs
@@ -27,6 +27,7 @@ pub enum OsMesaCreationError {
}
impl From<CreationError> for OsMesaCreationError {
+ #[inline]
fn from(e: CreationError) -> OsMesaCreationError {
OsMesaCreationError::CreationError(e)
}
@@ -67,21 +68,25 @@ impl OsMesaContext {
})
}
+ #[inline]
pub fn get_framebuffer(&self) -> &[u32] {
&self.buffer
}
+ #[inline]
pub fn get_dimensions(&self) -> (u32, u32) {
(self.width, self.height)
}
#[allow(dead_code)]
// TODO: can we remove this without causing havoc?
+ #[inline]
pub fn set_window_resize_callback(&mut self, _: Option<fn(u32, u32)>) {
}
}
impl GlContext for OsMesaContext {
+ #[inline]
unsafe fn make_current(&self) -> Result<(), ContextError> {
let ret = osmesa_sys::OSMesaMakeCurrent(self.context, self.buffer.as_ptr()
as *mut libc::c_void, 0x1401, self.width
@@ -96,6 +101,7 @@ impl GlContext for OsMesaContext {
Ok(())
}
+ #[inline]
fn is_current(&self) -> bool {
unsafe { osmesa_sys::OSMesaGetCurrentContext() == self.context }
}
@@ -107,20 +113,24 @@ impl GlContext for OsMesaContext {
}
}
+ #[inline]
fn swap_buffers(&self) -> Result<(), ContextError> {
Ok(())
}
+ #[inline]
fn get_api(&self) -> Api {
Api::OpenGl
}
+ #[inline]
fn get_pixel_format(&self) -> PixelFormat {
unimplemented!();
}
}
impl Drop for OsMesaContext {
+ #[inline]
fn drop(&mut self) {
unsafe { osmesa_sys::OSMesaDestroyContext(self.context) }
}