@@ -254,7 +254,7 @@ impl<'s> RenderTarget for Surface<'s> {
254
254
type Context = SurfaceContext < ' s > ;
255
255
}
256
256
257
- impl < ' r , ' t , TC : TextureOwner > RenderTarget for TextureTarget < ' r , ' t , TC > {
257
+ impl < ' r , ' t , TC > RenderTarget for TextureTarget < ' r , ' t , TC > {
258
258
type Context = TC ;
259
259
}
260
260
@@ -440,9 +440,7 @@ impl Canvas<Window> {
440
440
}
441
441
}
442
442
443
- impl < T : RenderTarget > Canvas < T >
444
- where T :: Context : TextureOwner
445
- {
443
+ impl < T : RenderTarget > Canvas < T > {
446
444
/// Determine whether a window supports the use of render targets.
447
445
pub fn render_target_supported ( & self ) -> bool {
448
446
unsafe { ll:: SDL_RenderTargetSupported ( self . context . raw ) == 1 }
@@ -720,24 +718,15 @@ impl<T> TextureCreator<T> {
720
718
}
721
719
}
722
720
723
- pub struct TextureTarget < ' r , ' t , TC : TextureOwner > {
721
+ pub struct TextureTarget < ' r , ' t , TC > {
724
722
raw_renderer : & ' r * mut ll:: SDL_Renderer ,
725
723
_texture_marker : PhantomData < & ' t ( ) > ,
726
724
// unfortunately there is no way to know which kind of Renderer we have here at compile time,
727
725
// so this PhantomData is here to keep track of that.
728
726
_texture_target : PhantomData < TC > ,
729
727
}
730
728
731
- /// Represents structs that are the "source" of the Renderer.
732
- ///
733
- /// You should *not* implement this trait outside of this crate.
734
- pub trait TextureOwner { }
735
-
736
- impl < ' s > TextureOwner for SurfaceContext < ' s > { }
737
-
738
- impl TextureOwner for WindowContext { }
739
-
740
- impl < ' r , ' t , TC : TextureOwner > Drop for TextureTarget < ' r , ' t , TC > {
729
+ impl < ' r , ' t , TC > Drop for TextureTarget < ' r , ' t , TC > {
741
730
// `Drop` cannot be specialized. Get around this through run-time check of Target Kind
742
731
fn drop ( & mut self ) {
743
732
unsafe {
@@ -1192,7 +1181,7 @@ impl<T: RenderTarget> Canvas<T> {
1192
1181
/// ```
1193
1182
pub type TextureCanvas < ' r , ' t , TC > = Canvas < TextureTarget < ' r , ' t , TC > > ;
1194
1183
1195
- impl < ' r , ' t , TC : TextureOwner > Canvas < TextureTarget < ' r , ' t , TC > > {
1184
+ impl < ' r , ' t , TC > Canvas < TextureTarget < ' r , ' t , TC > > {
1196
1185
/// Replace the target of the `TextureCanvas` with a different `Texture`
1197
1186
///
1198
1187
/// Returns the new `TextureCanvas` and releases the `&mut` borrow on the old `Texture`
0 commit comments