mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Use surfman with glow bindings (#34328)
* Use glowing surfman Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Port https://github.com/servo/webxr/pull/255 Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * fixups rebase Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * fmt Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Update surfman Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Fix stale TODO Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
parent
fdbfecf7dd
commit
503bb10c5b
13 changed files with 70 additions and 97 deletions
|
@ -570,15 +570,9 @@ macro_rules! define_resource_id {
|
|||
pub struct $name(nonzero_type!($type));
|
||||
|
||||
impl $name {
|
||||
#[allow(unsafe_code)]
|
||||
#[inline]
|
||||
/// Create a new $name.
|
||||
///
|
||||
/// # Safety
|
||||
///
|
||||
/// Using an invalid OpenGL id may result in undefined behavior.
|
||||
pub unsafe fn new(id: $type) -> Self {
|
||||
$name(<nonzero_type!($type)>::new_unchecked(id))
|
||||
pub fn new(id: nonzero_type!($type)) -> Self {
|
||||
Self(id)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
@ -599,10 +593,10 @@ macro_rules! define_resource_id {
|
|||
D: ::serde::Deserializer<'de>,
|
||||
{
|
||||
let id = <$type>::deserialize(deserializer)?;
|
||||
if id == 0 {
|
||||
Err(::serde::de::Error::custom("expected a non-zero value"))
|
||||
if let Some(id) = <nonzero_type!($type)>::new(id) {
|
||||
Ok($name(id))
|
||||
} else {
|
||||
Ok(unsafe { $name::new(id) })
|
||||
Err(::serde::de::Error::custom("expected a non-zero value"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue