aboutsummaryrefslogtreecommitdiff
path: root/stockton-skeleton/src/draw_passes/cons.rs
diff options
context:
space:
mode:
Diffstat (limited to 'stockton-skeleton/src/draw_passes/cons.rs')
-rw-r--r--stockton-skeleton/src/draw_passes/cons.rs22
1 files changed, 18 insertions, 4 deletions
diff --git a/stockton-skeleton/src/draw_passes/cons.rs b/stockton-skeleton/src/draw_passes/cons.rs
index 51c06a6..dea42af 100644
--- a/stockton-skeleton/src/draw_passes/cons.rs
+++ b/stockton-skeleton/src/draw_passes/cons.rs
@@ -32,12 +32,26 @@ macro_rules! cons_shared_impl {
}
fn handle_surface_change(
- &mut self,
+ mut self,
session: &Session,
context: &mut RenderingContext,
- ) -> Result<()> {
- self.a.handle_surface_change(session, context)?;
- self.b.handle_surface_change(session, context)
+ ) -> Result<Self> {
+ match self.a.handle_surface_change(session, context) {
+ Ok(a) => self.a = a,
+ Err(e) => {
+ self.b.deactivate(context)?;
+ return Err(e);
+ }
+ }
+ match self.b.handle_surface_change(session, context) {
+ Ok(b) => self.b = b,
+ Err(e) => {
+ self.a.deactivate(context)?;
+ return Err(e);
+ }
+ }
+
+ Ok(self)
}
};
}