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

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

Issue 2418603002: Fix paint invalidation rect visualization (Closed)
Patch Set: Created 4 years, 2 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/repaint_overlay.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/repaint_overlay.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/repaint_overlay.py
index b7683c47ab85002958ef0df48392eb36d4a2c983..15e379b8da012345aeab99b77b62b937e721a0b4 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/repaint_overlay.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/repaint_overlay.py
@@ -66,10 +66,6 @@ def generate_repaint_overlay_html(test_name, actual_text, expected_text):
<label><input id="show-test" type="checkbox" checked onchange="toggle_test(this.checked)">Show test</label>
<label><input id="use-solid-colors" type="checkbox" onchange="toggle_solid_color(this.checked)">Use solid colors</label>
<br>
-<button title="See fast/repaint/resources/text-based-repaint.js for how this works" onclick="highlight_under_repaint()">
- Highlight under-repaint
-</button>
-<br>
<span id='type'>Expected Invalidations</span>
<div id=overlay>
<canvas id='expected' width='2000' height='2000'></canvas>
@@ -87,13 +83,6 @@ function toggle_solid_color(use_solid_color) {
draw_repaint_rects();
}
-function highlight_under_repaint() {
- document.getElementById('show-test').checked = false;
- toggle_test(false);
- document.getElementById('use-solid-colors').checked = true;
- toggle_solid_color(true);
-}
Xianzhu 2016/10/12 20:13:22 The above code has been no use since we removed th
-
var expected = %(expected)s;
var actual = %(actual)s;
@@ -127,13 +116,16 @@ function draw_layer_rects(context, result) {
}
draw_rects(context, rects);
}
- if (result.children) {
- for (var i = 0; i < result.children.length; ++i)
- draw_layer_rects(context, result.children[i]);
- }
context.restore();
}
+function draw_result_rects(context, result) {
+ if (result.layers) {
+ for (var i = 0; i < result.layers.length; ++i)
+ draw_layer_rects(context, result.layers[i]);
+ }
+}
+
var expected_canvas = document.getElementById('expected');
var actual_canvas = document.getElementById('actual');
@@ -141,12 +133,12 @@ function draw_repaint_rects() {
var expected_ctx = expected_canvas.getContext("2d");
expected_ctx.clearRect(0, 0, 2000, 2000);
expected_ctx.fillStyle = 'rgba(255, 0, 0, ' + overlay_opacity + ')';
- draw_layer_rects(expected_ctx, expected);
+ draw_result_rects(expected_ctx, expected);
var actual_ctx = actual_canvas.getContext("2d");
actual_ctx.clearRect(0, 0, 2000, 2000);
actual_ctx.fillStyle = 'rgba(0, 255, 0, ' + overlay_opacity + ')';
- draw_layer_rects(actual_ctx, actual);
+ draw_result_rects(actual_ctx, actual);
}
draw_repaint_rects();
« 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