Basic repaint test for squashed layers. The entire squashing layer should not need repainting when only a portion of it is invalidated. Test interactively by using --show-paint-rects and hovering over elements to change their color. CASE 1, original layer tree: { "bounds": [800, 600], "children": [ { "bounds": [800, 600], "contentsOpaque": true, "drawsContent": true, "children": [ { "shouldFlattenTransform": false, "children": [ { "position": [60, 60], "bounds": [100, 100], "contentsOpaque": true, "drawsContent": true, "backgroundColor": "#808080" }, { "position": [140, 140], "bounds": [260, 260], "drawsContent": true } ] } ] } ] } CASE 2, overlap1 changes color: { "bounds": [800, 600], "children": [ { "bounds": [800, 600], "contentsOpaque": true, "drawsContent": true, "children": [ { "shouldFlattenTransform": false, "children": [ { "position": [60, 60], "bounds": [100, 100], "contentsOpaque": true, "drawsContent": true, "backgroundColor": "#808080" }, { "position": [140, 140], "bounds": [260, 260], "drawsContent": true, "repaintRects": [ [0, 0, 100, 100] ] } ] } ] } ] } CASE 3, overlap1 and overlap2 change color: { "bounds": [800, 600], "children": [ { "bounds": [800, 600], "contentsOpaque": true, "drawsContent": true, "children": [ { "shouldFlattenTransform": false, "children": [ { "position": [60, 60], "bounds": [100, 100], "contentsOpaque": true, "drawsContent": true, "backgroundColor": "#808080" }, { "position": [140, 140], "bounds": [260, 260], "drawsContent": true, "repaintRects": [ [80, 80, 100, 100], [0, 0, 100, 100] ] } ] } ] } ] } CASE 4, overlap2 and overlap3 change color: { "bounds": [800, 600], "children": [ { "bounds": [800, 600], "contentsOpaque": true, "drawsContent": true, "children": [ { "shouldFlattenTransform": false, "children": [ { "position": [60, 60], "bounds": [100, 100], "contentsOpaque": true, "drawsContent": true, "backgroundColor": "#808080" }, { "position": [140, 140], "bounds": [260, 260], "drawsContent": true, "repaintRects": [ [160, 160, 100, 100], [80, 80, 100, 100] ] } ] } ] } ] } CASE 5, overlap3 and overlap1 change color: { "bounds": [800, 600], "children": [ { "bounds": [800, 600], "contentsOpaque": true, "drawsContent": true, "children": [ { "shouldFlattenTransform": false, "children": [ { "position": [60, 60], "bounds": [100, 100], "contentsOpaque": true, "drawsContent": true, "backgroundColor": "#808080" }, { "position": [140, 140], "bounds": [260, 260], "drawsContent": true, "repaintRects": [ [160, 160, 100, 100], [0, 0, 100, 100] ] } ] } ] } ] }