From 7348681933306c3b407cb3756ce4f01782791fb6 Mon Sep 17 00:00:00 2001 From: Henrique Nakashima Date: Wed, 10 Oct 2018 19:02:54 +0000 Subject: Document image comparison with safetynet_compare.py. Change-Id: I12a0bb92031173209b71a5ea5e06bff64a5d80a0 Reviewed-on: https://pdfium-review.googlesource.com/c/43730 Commit-Queue: Henrique Nakashima Reviewed-by: Lei Zhang --- docs/safetynet.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/safetynet.md b/docs/safetynet.md index 5dc482b420..bd0a791bf3 100644 --- a/docs/safetynet.md +++ b/docs/safetynet.md @@ -119,6 +119,11 @@ One advantage is that callgrind can generate `callgrind.out` files (by passing can be analyzed to find the cause of a regression. KCachegrind is a good visualizer for these files. +#### none + +Run without any profiler, giving a performance score of 1 always. useful for +running image comparisons or debugging the script. + ### Common Options Arguments commonly passed to safetynet_compare.py. @@ -181,3 +186,21 @@ The first time the job runs, it will just create a checkpoint as `~/job_results/last_revision_covered`. From then on, since a checkpoint is available, each run will compare performance with the last checkpoint and update the checkpoint. + +## Run image comparison + +Pass the `--png-dir` option pointing at an output directory to compare the output +images from rendering the "before" and the "after" branches with pdfium_test. + +```shell +$ mkdir ~/output_images +$ testing/tools/safetynet_compare.py ~/pdf_samples --branch-before before_visual_changes --branch-after after_visual_changes --png-dir ~/output_images +``` + +This will output and automatically open a `~/output_images/compare.html` file +showing the before/after and the diff. Hover the mouse cursor over the +before/after image on the left for an easier visual comparison. The "before" +image is displayed until the cursor hovers over the image, which is then +replaced with the "after" image. + +It is recommended to use `--profiler=none` with this option. -- cgit v1.2.3