22#![ allow( non_upper_case_globals) ]
33#![ allow( clippy:: upper_case_acronyms) ]
44#![ allow( non_camel_case_types) ]
5+ #![ allow( unused_variables) ]
56
67use std:: ops:: * ;
78
@@ -167,7 +168,7 @@ impl Matrix {
167168 unimplemented ! ( "This is mocked" )
168169 }
169170
170- pub fn set_rotate ( & self , _degrees : f32 , _pivot : impl Into < Option < Point > > ) -> & mut Self {
171+ pub fn set_rotate ( & mut self , _degrees : f32 , _pivot : impl Into < Option < Point > > ) -> & mut Self {
171172 unimplemented ! ( "This is mocked" )
172173 }
173174}
@@ -420,7 +421,7 @@ impl TextStyle {
420421 unimplemented ! ( "This is mocked" )
421422 }
422423
423- pub fn decoration_mut ( & mut self ) -> & mut Decoration {
424+ pub fn set_decoration ( & mut self , decoration : & Decoration ) {
424425 unimplemented ! ( "This is mocked" )
425426 }
426427
@@ -708,7 +709,7 @@ impl Paragraph {
708709 unimplemented ! ( "This is mocked" )
709710 }
710711
711- pub fn paint ( & self , _canvas : & mut Canvas , _p : impl Into < Point > ) {
712+ pub fn paint ( & self , _canvas : & Canvas , _p : impl Into < Point > ) {
712713 unimplemented ! ( "This is mocked" )
713714 }
714715
@@ -947,43 +948,43 @@ impl Canvas {
947948 unimplemented ! ( "This is mocked" )
948949 }
949950
950- pub fn concat ( & mut self , _matrix : & Matrix ) {
951+ pub fn concat ( & self , _matrix : & Matrix ) {
951952 unimplemented ! ( "This is mocked" )
952953 }
953954
954- pub fn clip_rect ( & mut self , _rect : Rect , _clip : ClipOp , _: bool ) {
955+ pub fn clip_rect ( & self , _rect : Rect , _clip : ClipOp , _: bool ) {
955956 unimplemented ! ( "This is mocked" )
956957 }
957958
958959 pub fn draw_image_nine (
959- & mut self ,
960+ & self ,
960961 _image : Image ,
961962 _center : IRect ,
962963 _dst : Rect ,
963964 _filter_mode : FilterMode ,
964965 _paint : Option < & Paint > ,
965- ) -> & mut Self {
966+ ) -> & Self {
966967 unimplemented ! ( "This is mocked" )
967968 }
968969
969- pub fn draw_rect ( & mut self , _rect : Rect , _paint : & Paint ) -> & mut Self {
970+ pub fn draw_rect ( & self , _rect : Rect , _paint : & Paint ) -> & Self {
970971 unimplemented ! ( "This is mocked" )
971972 }
972973
973- pub fn draw_path ( & mut self , _path : & Path , _paint : & Paint ) -> & mut Self {
974+ pub fn draw_path ( & self , _path : & Path , _paint : & Paint ) -> & Self {
974975 unimplemented ! ( "This is mocked" )
975976 }
976977
977978 pub fn clip_path (
978- & mut self ,
979+ & self ,
979980 _path : & Path ,
980981 _op : impl Into < Option < ClipOp > > ,
981982 _do_anti_alias : impl Into < Option < bool > > ,
982- ) -> & mut Self {
983+ ) -> & Self {
983984 unimplemented ! ( "This is mocked" )
984985 }
985986
986- pub fn translate ( & mut self , _d : impl Into < Point > ) -> & mut Self {
987+ pub fn translate ( & self , _d : impl Into < Point > ) -> & Self {
987988 unimplemented ! ( "This is mocked" )
988989 }
989990
@@ -995,21 +996,11 @@ impl Canvas {
995996 unimplemented ! ( "This is mocked" )
996997 }
997998
998- pub fn draw_line (
999- & mut self ,
1000- _p1 : impl Into < Point > ,
1001- _p2 : impl Into < Point > ,
1002- _paint : & Paint ,
1003- ) -> & mut Self {
999+ pub fn draw_line ( & self , _p1 : impl Into < Point > , _p2 : impl Into < Point > , _paint : & Paint ) -> & Self {
10041000 unimplemented ! ( "This is mocked" )
10051001 }
10061002
1007- pub fn draw_circle (
1008- & mut self ,
1009- _center : impl Into < Point > ,
1010- _radius : f32 ,
1011- _paint : & Paint ,
1012- ) -> & mut Self {
1003+ pub fn draw_circle ( & self , _center : impl Into < Point > , _radius : f32 , _paint : & Paint ) -> & Self {
10131004 unimplemented ! ( "This is mocked" )
10141005 }
10151006}
@@ -1132,7 +1123,7 @@ impl Image {
11321123pub struct Data ;
11331124
11341125impl Data {
1135- pub fn new_bytes ( _bytes : & [ u8 ] ) -> Self {
1126+ pub unsafe fn new_bytes ( _bytes : & [ u8 ] ) -> Self {
11361127 unimplemented ! ( "This is mocked" )
11371128 }
11381129}
@@ -1328,7 +1319,7 @@ pub mod svg {
13281319 unimplemented ! ( "This is mocked" )
13291320 }
13301321
1331- pub fn render ( & self , _canvas : & mut Canvas ) {
1322+ pub fn render ( & self , _canvas : & Canvas ) {
13321323 unimplemented ! ( "This is mocked" )
13331324 }
13341325 }
@@ -1353,7 +1344,7 @@ impl From<(i32, i32)> for Size {
13531344pub struct Surface ;
13541345
13551346impl Surface {
1356- pub fn canvas ( & self ) -> Canvas {
1347+ pub fn canvas ( & mut self ) -> Canvas {
13571348 unimplemented ! ( "This is mocked" )
13581349 }
13591350
@@ -1436,12 +1427,14 @@ impl DirectContext {
14361427use std:: ffi:: c_void;
14371428
14381429#[ repr( u8 ) ]
1430+ #[ derive( Debug , Copy , Clone , Hash , PartialEq , Eq ) ]
14391431pub enum Protected {
14401432 No ,
14411433 Yes ,
14421434}
14431435
1444- #[ derive( Clone , Copy ) ]
1436+ #[ derive( Copy , Clone , PartialEq , Eq , Debug ) ]
1437+ #[ repr( C ) ]
14451438pub struct FramebufferInfo {
14461439 pub fboid : i32 ,
14471440 pub format : Format ,
@@ -1450,11 +1443,7 @@ pub struct FramebufferInfo {
14501443
14511444impl Default for FramebufferInfo {
14521445 fn default ( ) -> Self {
1453- Self {
1454- fboid : 0 ,
1455- format : 0 ,
1456- protected : Protected :: No ,
1457- }
1446+ unimplemented ! ( "This is mocked" )
14581447 }
14591448}
14601449
@@ -1466,16 +1455,7 @@ pub fn wrap_backend_render_target(
14661455 color_space : impl Into < Option < ColorSpace > > ,
14671456 surface_props : Option < & SurfaceProps > ,
14681457) -> Option < Surface > {
1469- Surface :: from_ptr ( unsafe {
1470- sb:: C_SkSurfaces_WrapBackendRenderTarget (
1471- context. native_mut ( ) ,
1472- backend_render_target. native ( ) ,
1473- origin,
1474- color_type. into_native ( ) ,
1475- color_space. into ( ) . into_ptr_or_null ( ) ,
1476- surface_props. native_ptr_or_null ( ) ,
1477- )
1478- } )
1458+ unimplemented ! ( "This is mocked" )
14791459}
14801460
14811461pub struct Interface ;
@@ -1534,3 +1514,15 @@ impl BackendRenderTarget {
15341514 unimplemented ! ( "This is mocked" )
15351515 }
15361516}
1517+
1518+ pub mod backend_render_targets {
1519+ use crate :: prelude:: * ;
1520+ pub fn make_gl (
1521+ ( width, height) : ( i32 , i32 ) ,
1522+ sample_count : impl Into < Option < usize > > ,
1523+ stencil_bits : usize ,
1524+ info : FramebufferInfo ,
1525+ ) -> BackendRenderTarget {
1526+ unimplemented ! ( "This is mocked" )
1527+ }
1528+ }
0 commit comments