Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/repaint_overlay.py

Issue 1896243002: Fix repaint overlay in layout test results (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/repaint_overlay_unittest.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import re 5 import re
6 6
7 7
8 def result_contains_repaint_rects(text): 8 def result_contains_repaint_rects(text):
9 return isinstance(text, str) and ( 9 return isinstance(text, str) and (
10 re.search('"repaintRects": \[$', text, re.MULTILINE) != None or 10 re.search('"paintInvalidations": \[$', text, re.MULTILINE) is not None o r
11 text.find('Minimum repaint:') != -1) 11 text.find('Minimum repaint:') != -1)
12 12
13 13
14 def extract_layer_tree(input_str): 14 def extract_layer_tree(input_str):
15 if not isinstance(input_str, str): 15 if not isinstance(input_str, str):
16 return '{}' 16 return '{}'
17 17
18 if input_str[0:2] == '{\n': 18 if input_str[0:2] == '{\n':
19 start = 0 19 start = 0
20 else: 20 else:
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 context.save(); 132 context.save();
133 if (result.position) 133 if (result.position)
134 context.translate(result.position[0], result.position[1]); 134 context.translate(result.position[0], result.position[1]);
135 var t = result.transform; 135 var t = result.transform;
136 if (t) { 136 if (t) {
137 var origin = result.transformOrigin || [result.bounds[0] / 2, result.bou nds[1] / 2]; 137 var origin = result.transformOrigin || [result.bounds[0] / 2, result.bou nds[1] / 2];
138 context.translate(origin[0], origin[1]); 138 context.translate(origin[0], origin[1]);
139 context.transform(t[0][0], t[0][1], t[1][0], t[1][1], t[3][0], t[3][1]); 139 context.transform(t[0][0], t[0][1], t[1][0], t[1][1], t[3][0], t[3][1]);
140 context.translate(-origin[0], -origin[1]); 140 context.translate(-origin[0], -origin[1]);
141 } 141 }
142 if (result.repaintRects) { 142 if (result.paintInvalidations) {
143 draw_rects(context, result.repaintRects);
144 } else if (result.paintInvalidations) {
145 var rects = []; 143 var rects = [];
146 for (var i = 0; i < result.paintInvalidations.length; ++i) 144 for (var i = 0; i < result.paintInvalidations.length; ++i) {
147 rects.push(result.paintInvalidations[i].rect); 145 if (result.paintInvalidations[i].rect)
146 rects.push(result.paintInvalidations[i].rect);
147 }
148 draw_rects(context, rects); 148 draw_rects(context, rects);
149 } 149 }
150 if (result.children) { 150 if (result.children) {
151 for (var i = 0; i < result.children.length; ++i) 151 for (var i = 0; i < result.children.length; ++i)
152 draw_layer_rects(context, result.children[i]); 152 draw_layer_rects(context, result.children[i]);
153 } 153 }
154 context.restore(); 154 context.restore();
155 } 155 }
156 156
157 var expected_canvas = document.getElementById('expected'); 157 var expected_canvas = document.getElementById('expected');
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 setInterval(flip, 3000); 206 setInterval(flip, 3000);
207 </script> 207 </script>
208 </body> 208 </body>
209 </html> 209 </html>
210 """ % { 210 """ % {
211 'title': test_name, 211 'title': test_name,
212 'expected': expected_layer_tree, 212 'expected': expected_layer_tree,
213 'actual': actual_layer_tree, 213 'actual': actual_layer_tree,
214 'minimum_repaint': minimum_repaint, 214 'minimum_repaint': minimum_repaint,
215 } 215 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/repaint_overlay_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698