Commit 6c347e2
BlurCache: don't rebuild the cache when dirtyRegion is empty
When KWin paints the window with damage that doesn't intersect
backgroundRect (e.g. shadow-only damage on focus changes) the
dirtyRegion is empty: nothing behind the window was repainted, so
there are no fresh pixels to compare against and prepareCache()
bails before setting up the conditional render.
Previously this caused an *ungated* re-blur: all blur passes ran
and drawToCache() overwrote the cached texture - the only place
the cache was rewritten outside the conditional render. Besides
wasting GPU time on every such paint, this rebuilt the cache from
the reference blit alone, which can contain never-initialized
regions, and re-applied the noise and rounded corner passes to it.
Track this case as useCachedOnly in the paint data and skip the
scene blit, all blur passes and the cache writes, only drawing the
existing cached texture. If no cache entry exists yet there is
nothing valid to build one from - bail entirely; the on-screen
draw is clipped to the deviceRegion anyway.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent daf5688 commit 6c347e2
3 files changed
Lines changed: 47 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1021 | 1021 | | |
1022 | 1022 | | |
1023 | 1023 | | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
1024 | 1034 | | |
1025 | 1035 | | |
1026 | 1036 | | |
1027 | 1037 | | |
1028 | 1038 | | |
1029 | 1039 | | |
| 1040 | + | |
1030 | 1041 | | |
1031 | 1042 | | |
1032 | 1043 | | |
| |||
1143 | 1154 | | |
1144 | 1155 | | |
1145 | 1156 | | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
1146 | 1167 | | |
1147 | 1168 | | |
1148 | 1169 | | |
| |||
1204 | 1225 | | |
1205 | 1226 | | |
1206 | 1227 | | |
1207 | | - | |
1208 | | - | |
1209 | | - | |
1210 | | - | |
1211 | | - | |
1212 | | - | |
1213 | | - | |
1214 | 1228 | | |
1215 | 1229 | | |
1216 | 1230 | | |
| |||
1345 | 1359 | | |
1346 | 1360 | | |
1347 | 1361 | | |
| 1362 | + | |
1348 | 1363 | | |
1349 | 1364 | | |
1350 | 1365 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
| 195 | + | |
| 196 | + | |
195 | 197 | | |
196 | 198 | | |
197 | 199 | | |
| |||
330 | 332 | | |
331 | 333 | | |
332 | 334 | | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
337 | 340 | | |
338 | 341 | | |
339 | 342 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
195 | 200 | | |
196 | 201 | | |
197 | 202 | | |
| |||
216 | 221 | | |
217 | 222 | | |
218 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
219 | 237 | | |
220 | 238 | | |
221 | 239 | | |
| |||
0 commit comments