use crate::metal::RafxTextureMetal;
use crate::RafxError;
pub struct RafxPresentableFrameMetal {
pub(crate) drawable: metal::CoreAnimationDrawable,
pub(crate) texture: RafxTextureMetal,
}
impl RafxPresentableFrameMetal {
pub fn new(drawable: metal::CoreAnimationDrawable) -> Self {
let texture = RafxTextureMetal::new_from_metal_texture(drawable.texture().to_owned());
RafxPresentableFrameMetal { drawable, texture }
}
pub fn cancel_present(
self,
_result: RafxError,
) {
}
pub fn present(self ) {
self.drawable.present();
}
pub fn texture_ref(&self) -> &RafxTextureMetal {
&self.texture
}
pub fn texture(&self) -> RafxTextureMetal {
RafxTextureMetal::new_from_metal_texture(self.drawable.texture().to_owned())
}
}