@@ -187,20 +187,6 @@ impl ClipTree {
187
187
}
188
188
}
189
189
190
- pub fn reset ( & mut self ) {
191
- self . nodes . clear ( ) ;
192
- self . nodes . push ( ClipTreeNode {
193
- handle : ClipDataHandle :: INVALID ,
194
- children : Vec :: new ( ) ,
195
- parent : ClipNodeId :: NONE ,
196
- } ) ;
197
-
198
- self . leaves . clear ( ) ;
199
-
200
- self . clip_root_stack . clear ( ) ;
201
- self . clip_root_stack . push ( ClipNodeId :: NONE ) ;
202
- }
203
-
204
190
/// Add a set of clips to the provided tree node id, reusing existing
205
191
/// nodes in the tree where possible
206
192
fn add_impl (
@@ -444,24 +430,6 @@ impl ClipTreeBuilder {
444
430
}
445
431
}
446
432
447
- pub fn begin ( & mut self ) {
448
- self . clip_map . clear ( ) ;
449
- self . clip_chain_map . clear ( ) ;
450
- self . clip_chains . clear ( ) ;
451
- self . clip_stack . clear ( ) ;
452
- self . clip_stack . push ( ClipStackEntry {
453
- clip_node_id : ClipNodeId :: NONE ,
454
- last_clip_chain_cache : None ,
455
- seen_clips : FastHashSet :: default ( ) ,
456
- } ) ;
457
- self . tree . reset ( ) ;
458
- self . clip_handles_buffer . clear ( ) ;
459
- }
460
-
461
- pub fn recycle_tree ( & mut self , tree : ClipTree ) {
462
- self . tree = tree;
463
- }
464
-
465
433
/// Define a new rect clip
466
434
pub fn define_rect_clip (
467
435
& mut self ,
@@ -717,15 +685,8 @@ impl ClipTreeBuilder {
717
685
}
718
686
719
687
/// Finalize building and return the clip-tree
720
- pub fn finalize ( & mut self ) -> ClipTree {
721
- // Note: After this, the builder's clip tree does not hold allocations and
722
- // is not in valid state. `ClipTreeBuilder::begin()` must be called before
723
- // building can happen again.
724
- std:: mem:: replace ( & mut self . tree , ClipTree {
725
- nodes : Vec :: new ( ) ,
726
- leaves : Vec :: new ( ) ,
727
- clip_root_stack : Vec :: new ( ) ,
728
- } )
688
+ pub fn finalize ( self ) -> ClipTree {
689
+ self . tree
729
690
}
730
691
731
692
/// Get a clip node by id
@@ -1290,14 +1251,6 @@ impl ClipStore {
1290
1251
}
1291
1252
}
1292
1253
1293
- pub fn reset ( & mut self ) {
1294
- self . clip_node_instances . clear ( ) ;
1295
- self . mask_tiles . clear ( ) ;
1296
- self . active_clip_node_info . clear ( ) ;
1297
- self . active_local_clip_rect = None ;
1298
- self . active_pic_coverage_rect = PictureRect :: max_rect ( ) ;
1299
- }
1300
-
1301
1254
pub fn get_instance_from_range (
1302
1255
& self ,
1303
1256
node_range : & ClipNodeRange ,
@@ -1597,12 +1550,6 @@ impl ClipStore {
1597
1550
}
1598
1551
}
1599
1552
1600
- impl Default for ClipStore {
1601
- fn default ( ) -> Self {
1602
- ClipStore :: new ( )
1603
- }
1604
- }
1605
-
1606
1553
// The ClipItemKey is a hashable representation of the contents
1607
1554
// of a clip item. It is used during interning to de-duplicate
1608
1555
// clip nodes between frames and display lists. This allows quick
0 commit comments