@@ -191,11 +191,8 @@ impl Tile {
191
191
192
192
/// Destroy a tile, optionally returning a handle and cache descriptor,
193
193
/// if this surface was valid and may be useful on the next scene.
194
- fn destroy (
195
- self ,
196
- resource_cache : & ResourceCache ,
197
- ) -> Option < ( TileDescriptor , TextureCacheHandle ) > {
198
- if self . is_valid && resource_cache. texture_cache . is_allocated ( & self . handle ) {
194
+ fn destroy ( self ) -> Option < ( TileDescriptor , TextureCacheHandle ) > {
195
+ if self . is_valid {
199
196
Some ( ( self . descriptor , self . handle ) )
200
197
} else {
201
198
None
@@ -424,12 +421,6 @@ impl TileCache {
424
421
// coordinate system (which is the common case!) then we are effectively drawing
425
422
// in a local space anyway, so don't care about that transform for the purposes
426
423
// of validating the surface cache contents.
427
- let raster_spatial_node = & frame_context
428
- . clip_scroll_tree
429
- . spatial_nodes [ raster_spatial_node_index. 0 ] ;
430
- let surface_spatial_node = & frame_context
431
- . clip_scroll_tree
432
- . spatial_nodes [ surface_spatial_node_index. 0 ] ;
433
424
434
425
let mut key = CoordinateSpaceMapping :: < LayoutPixel , PicturePixel > :: new (
435
426
raster_spatial_node_index,
@@ -438,10 +429,8 @@ impl TileCache {
438
429
) . expect ( "bug: unable to get coord mapping" ) . into ( ) ;
439
430
440
431
if let TransformKey :: ScaleOffset ( ref mut key) = key {
441
- if raster_spatial_node. coordinate_system_id == surface_spatial_node. coordinate_system_id {
442
- key. offset_x = 0.0 ;
443
- key. offset_y = 0.0 ;
444
- }
432
+ key. offset_x = 0.0 ;
433
+ key. offset_y = 0.0 ;
445
434
}
446
435
447
436
key
@@ -873,9 +862,7 @@ impl TileCache {
873
862
// TODO(gw): Maybe it's worth keeping them around for a bit longer in
874
863
// some cases?
875
864
for ( _, handle) in retained_tiles. drain ( ) {
876
- if resource_cache. texture_cache . is_allocated ( & handle) {
877
- resource_cache. texture_cache . mark_unused ( & handle) ;
878
- }
865
+ resource_cache. texture_cache . mark_unused ( & handle) ;
879
866
}
880
867
881
868
self . dirty_region = if dirty_rect. is_empty ( ) {
@@ -1387,14 +1374,11 @@ impl PicturePrimitive {
1387
1374
pub fn destroy (
1388
1375
mut self ,
1389
1376
retained_tiles : & mut FastHashMap < TileDescriptor , TextureCacheHandle > ,
1390
- resource_cache : & ResourceCache ,
1391
1377
) {
1392
1378
if let Some ( tile_cache) = self . tile_cache . take ( ) {
1393
1379
debug_assert ! ( tile_cache. old_tiles. is_empty( ) ) ;
1394
1380
for tile in tile_cache. tiles {
1395
- if let Some ( ( descriptor, texture_handle) ) = tile. destroy ( resource_cache) {
1396
- retained_tiles. insert ( descriptor, texture_handle) ;
1397
- }
1381
+ retained_tiles. extend ( tile. destroy ( ) ) ;
1398
1382
}
1399
1383
}
1400
1384
}
0 commit comments