This repository was archived by the owner on Jul 9, 2025. It is now read-only.
Commit 39b7095
committed
Bug 1380649 - Part 1. Ensure SurfaceCache::CollectSizeOfSurfaces removes purged volatile buffer-backed surfaces. r=tnikkel
When we lookup a surface in the cache, we are careful to remove any
surfaces which were backed by volatile memory and got purged before we
could reacquire the buffer. We were not so careful in doing that when
generating memory reports. ISurfaceProvider::AddSizeOfExcludingThis will
cause us to acquire the buffer, and if it was purged, forget about its
purged status. Later when we performed a lookup, we would forget the
purged status, and assume we have the right data. This would appear as
completely transparent for BGRA surfaces, and completely black for BGRX
surfaces.
With this patch, we now properly remove purged surfaces instead of
including them in the report. This ensures that the cache state is
consistent. This also resolves memory reports of surfaces which reported
using no data -- they were purged when the report was generated.
Additionally, there was a bug in SurfaceCache::PruneImage where we did
not discard surfaces outside the module lock. Both PruneImage and
CollectSizeOfSurfaces now free any discarded surfaces outside the lock.1 parent ae25105 commit 39b7095
1 file changed
Lines changed: 45 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
614 | 614 | | |
615 | 615 | | |
616 | 616 | | |
| 617 | + | |
617 | 618 | | |
618 | | - | |
| 619 | + | |
| 620 | + | |
619 | 621 | | |
620 | 622 | | |
621 | | - | |
| 623 | + | |
622 | 624 | | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
623 | 640 | | |
624 | 641 | | |
625 | 642 | | |
| |||
1073 | 1090 | | |
1074 | 1091 | | |
1075 | 1092 | | |
| 1093 | + | |
| 1094 | + | |
1076 | 1095 | | |
1077 | 1096 | | |
1078 | 1097 | | |
| |||
1165 | 1184 | | |
1166 | 1185 | | |
1167 | 1186 | | |
1168 | | - | |
| 1187 | + | |
| 1188 | + | |
1169 | 1189 | | |
1170 | 1190 | | |
1171 | 1191 | | |
1172 | 1192 | | |
1173 | 1193 | | |
1174 | 1194 | | |
1175 | 1195 | | |
1176 | | - | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
1177 | 1202 | | |
1178 | 1203 | | |
1179 | 1204 | | |
| |||
1544 | 1569 | | |
1545 | 1570 | | |
1546 | 1571 | | |
1547 | | - | |
1548 | | - | |
1549 | | - | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
1550 | 1579 | | |
1551 | 1580 | | |
1552 | 1581 | | |
| |||
1568 | 1597 | | |
1569 | 1598 | | |
1570 | 1599 | | |
1571 | | - | |
1572 | | - | |
1573 | | - | |
1574 | | - | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
1575 | 1606 | | |
1576 | | - | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
1577 | 1610 | | |
1578 | 1611 | | |
1579 | 1612 | | |
| |||
0 commit comments