File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
components/shared/webrender Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,22 @@ impl RenderingContext {
90
90
Ok ( RenderingContext ( Rc :: new ( data) ) )
91
91
}
92
92
93
+ pub fn create_surface (
94
+ & self ,
95
+ surface_type : SurfaceType < NativeWidget > ,
96
+ ) -> Result < Surface , Error > {
97
+ let device = & mut self . 0 . device . borrow_mut ( ) ;
98
+ let context = & self . 0 . context . borrow ( ) ;
99
+ let surface_access = SurfaceAccess :: GPUOnly ;
100
+ device. create_surface ( & context, surface_access, surface_type)
101
+ }
102
+
103
+ pub fn destroy_surface ( & self , mut surface : Surface ) -> Result < ( ) , Error > {
104
+ let device = & self . 0 . device . borrow ( ) ;
105
+ let context = & mut self . 0 . context . borrow_mut ( ) ;
106
+ device. destroy_surface ( context, & mut surface)
107
+ }
108
+
93
109
pub fn create_surface_texture ( & self , surface : Surface ) -> Result < SurfaceTexture , Error > {
94
110
let device = & self . 0 . device . borrow ( ) ;
95
111
let context = & mut self . 0 . context . borrow_mut ( ) ;
You can’t perform that action at this time.
0 commit comments