@@ -381,34 +381,6 @@ impl Context2D{
381
381
} ) ;
382
382
}
383
383
384
- pub fn draw_drawable ( & mut self , drobble : & mut Option < Drawable > , src_rect : & Rect , dst_rect : & Rect ) {
385
- let mut paint = self . state . paint . clone ( ) ;
386
- paint. set_color ( self . color_with_alpha ( & BLACK ) ) ;
387
-
388
- if let Some ( drobble) = drobble{
389
- self . push ( ) ;
390
- self . with_canvas ( |canvas| {
391
- let size = ISize :: new ( dst_rect. width ( ) as i32 , dst_rect. height ( ) as i32 ) ;
392
- let mag = Point :: new ( dst_rect. width ( ) /src_rect. width ( ) , dst_rect. height ( ) /src_rect. height ( ) ) ;
393
- let mut matrix = Matrix :: new_identity ( ) ;
394
- matrix. pre_scale ( ( mag. x , mag. y ) , None )
395
- . pre_translate ( ( -src_rect. x ( ) , -src_rect. y ( ) ) ) ;
396
-
397
- if let Some ( shadow_paint) = self . paint_for_shadow ( & paint) {
398
- if let Some ( mut surface) = Surface :: new_raster_n32_premul ( size) {
399
- surface. canvas ( ) . draw_drawable ( drobble, Some ( & matrix) ) ;
400
- canvas. draw_image ( & surface. image_snapshot ( ) , ( dst_rect. x ( ) , dst_rect. y ( ) ) , Some ( & shadow_paint) ) ;
401
- }
402
- }
403
-
404
- matrix. pre_translate ( ( dst_rect. x ( ) /mag. x , dst_rect. y ( ) /mag. y ) ) ;
405
- canvas. clip_rect ( dst_rect, ClipOp :: Intersect , true )
406
- . draw_drawable ( drobble, Some ( & matrix) ) ;
407
- } ) ;
408
- self . pop ( ) ;
409
- }
410
- }
411
-
412
384
pub fn draw_picture ( & mut self , picture : & Option < Picture > , src_rect : & Rect , dst_rect : & Rect ) {
413
385
let paint = self . paint_for_image ( ) ;
414
386
let size = ISize :: new ( dst_rect. width ( ) as i32 , dst_rect. height ( ) as i32 ) ;
0 commit comments