| 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: |
| { |
| "layers": [ |
| { |
| "name": "Scrolling Contents Layer", |
| "bounds": [800, 600], |
| "contentsOpaque": true, |
| "backgroundColor": "#FFFFFF" |
| }, |
| { |
| "name": "LayoutBlockFlow (positioned) DIV class='composited'", |
| "bounds": [100, 100], |
| "contentsOpaque": true, |
| "backgroundColor": "#808080", |
| "transform": 1 |
| }, |
| { |
| "name": "Squashing Layer (first squashed layer: LayoutBlockFlow (positioned) DIV id='A' class='overlap1')", |
| "position": [80, 80], |
| "bounds": [260, 260], |
| "transform": 1 |
| } |
| ], |
| "transforms": [ |
| { |
| "id": 1, |
| "transform": [ |
| [1, 0, 0, 0], |
| [0, 1, 0, 0], |
| [0, 0, 1, 0], |
| [60, 60, 0, 1] |
| ] |
| } |
| ] |
| } |
| |
| CASE 2, overlap1 changes color: |
| { |
| "layers": [ |
| { |
| "name": "Scrolling Contents Layer", |
| "bounds": [800, 600], |
| "contentsOpaque": true, |
| "backgroundColor": "#FFFFFF" |
| }, |
| { |
| "name": "LayoutBlockFlow (positioned) DIV class='composited'", |
| "bounds": [100, 100], |
| "contentsOpaque": true, |
| "backgroundColor": "#808080", |
| "transform": 1 |
| }, |
| { |
| "name": "Squashing Layer (first squashed layer: LayoutBlockFlow (positioned) DIV id='A' class='overlap1')", |
| "position": [80, 80], |
| "bounds": [260, 260], |
| "paintInvalidations": [ |
| { |
| "object": "LayoutBlockFlow (positioned) DIV id='A' class='overlap1'", |
| "rect": [0, 0, 100, 100], |
| "reason": "background" |
| } |
| ], |
| "transform": 1 |
| } |
| ], |
| "transforms": [ |
| { |
| "id": 1, |
| "transform": [ |
| [1, 0, 0, 0], |
| [0, 1, 0, 0], |
| [0, 0, 1, 0], |
| [60, 60, 0, 1] |
| ] |
| } |
| ] |
| } |
| |
| CASE 3, overlap1 and overlap2 change color: |
| { |
| "layers": [ |
| { |
| "name": "Scrolling Contents Layer", |
| "bounds": [800, 600], |
| "contentsOpaque": true, |
| "backgroundColor": "#FFFFFF" |
| }, |
| { |
| "name": "LayoutBlockFlow (positioned) DIV class='composited'", |
| "bounds": [100, 100], |
| "contentsOpaque": true, |
| "backgroundColor": "#808080", |
| "transform": 1 |
| }, |
| { |
| "name": "Squashing Layer (first squashed layer: LayoutBlockFlow (positioned) DIV id='A' class='overlap1')", |
| "position": [80, 80], |
| "bounds": [260, 260], |
| "paintInvalidations": [ |
| { |
| "object": "LayoutBlockFlow (positioned) DIV id='B' class='overlap2'", |
| "rect": [80, 80, 100, 100], |
| "reason": "background" |
| }, |
| { |
| "object": "LayoutBlockFlow (positioned) DIV id='A' class='overlap1'", |
| "rect": [0, 0, 100, 100], |
| "reason": "background" |
| } |
| ], |
| "transform": 1 |
| } |
| ], |
| "transforms": [ |
| { |
| "id": 1, |
| "transform": [ |
| [1, 0, 0, 0], |
| [0, 1, 0, 0], |
| [0, 0, 1, 0], |
| [60, 60, 0, 1] |
| ] |
| } |
| ] |
| } |
| |
| CASE 4, overlap2 and overlap3 change color: |
| { |
| "layers": [ |
| { |
| "name": "Scrolling Contents Layer", |
| "bounds": [800, 600], |
| "contentsOpaque": true, |
| "backgroundColor": "#FFFFFF" |
| }, |
| { |
| "name": "LayoutBlockFlow (positioned) DIV class='composited'", |
| "bounds": [100, 100], |
| "contentsOpaque": true, |
| "backgroundColor": "#808080", |
| "transform": 1 |
| }, |
| { |
| "name": "Squashing Layer (first squashed layer: LayoutBlockFlow (positioned) DIV id='A' class='overlap1')", |
| "position": [80, 80], |
| "bounds": [260, 260], |
| "paintInvalidations": [ |
| { |
| "object": "LayoutBlockFlow (positioned) DIV id='C' class='overlap3'", |
| "rect": [160, 160, 100, 100], |
| "reason": "background" |
| }, |
| { |
| "object": "LayoutBlockFlow (positioned) DIV id='B' class='overlap2'", |
| "rect": [80, 80, 100, 100], |
| "reason": "background" |
| } |
| ], |
| "transform": 1 |
| } |
| ], |
| "transforms": [ |
| { |
| "id": 1, |
| "transform": [ |
| [1, 0, 0, 0], |
| [0, 1, 0, 0], |
| [0, 0, 1, 0], |
| [60, 60, 0, 1] |
| ] |
| } |
| ] |
| } |
| |
| CASE 5, overlap3 and overlap1 change color: |
| { |
| "layers": [ |
| { |
| "name": "Scrolling Contents Layer", |
| "bounds": [800, 600], |
| "contentsOpaque": true, |
| "backgroundColor": "#FFFFFF" |
| }, |
| { |
| "name": "LayoutBlockFlow (positioned) DIV class='composited'", |
| "bounds": [100, 100], |
| "contentsOpaque": true, |
| "backgroundColor": "#808080", |
| "transform": 1 |
| }, |
| { |
| "name": "Squashing Layer (first squashed layer: LayoutBlockFlow (positioned) DIV id='A' class='overlap1')", |
| "position": [80, 80], |
| "bounds": [260, 260], |
| "paintInvalidations": [ |
| { |
| "object": "LayoutBlockFlow (positioned) DIV id='C' class='overlap3'", |
| "rect": [160, 160, 100, 100], |
| "reason": "background" |
| }, |
| { |
| "object": "LayoutBlockFlow (positioned) DIV id='A' class='overlap1'", |
| "rect": [0, 0, 100, 100], |
| "reason": "background" |
| } |
| ], |
| "transform": 1 |
| } |
| ], |
| "transforms": [ |
| { |
| "id": 1, |
| "transform": [ |
| [1, 0, 0, 0], |
| [0, 1, 0, 0], |
| [0, 0, 1, 0], |
| [60, 60, 0, 1] |
| ] |
| } |
| ] |
| } |
| |