aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHal Canary <halcanary@google.com>2018-08-09 16:23:36 -0400
committerHal Canary <halcanary@google.com>2018-08-20 17:13:33 +0000
commit4dd13f2491ef968f450c515e09982a28abe625a5 (patch)
tree02fcc7dbee2ea7415ade3f008414d7e2dd6d259b
parent64b864c0b2fe2d589ff83f5a0be722232aba7260 (diff)
downloadskqp-4dd13f2491ef968f450c515e09982a28abe625a5.tar.gz
SkQP: relax six tests
In response to last minute request from vendor. Bug: 112641048 Change-Id: I304fe2015481433b3558ec77d31123cc382a8dc8 Reviewed-on: https://skia-review.googlesource.com/146647 Reviewed-by: Derek Sollenberger <djsollen@google.com> Auto-Submit: Hal Canary <halcanary@google.com>
-rw-r--r--tools/skqp/gm_knowledge.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/tools/skqp/gm_knowledge.cpp b/tools/skqp/gm_knowledge.cpp
index 9441dadeac..ccfcd9d9e4 100644
--- a/tools/skqp/gm_knowledge.cpp
+++ b/tools/skqp/gm_knowledge.cpp
@@ -45,6 +45,29 @@
////////////////////////////////////////////////////////////////////////////////
+// TODO(halcanary) SkQP version 2 (for Q-release) should have a much cleaner mechanism.
+static bool good_enough(const char* name, int64_t badnessMetric) {
+ static const struct {
+ const char* name;
+ int64_t tolerance;
+ } allowedBadnesses[] = {
+ // These values are rounded up from failing tests reported by vendor.
+ // The failures were perceptually good.
+ { "circular_arcs_stroke_and_fill_round", 110 },
+ { "circular_arcs_weird", 12000 },
+ { "drawTextRSXform", 1000 },
+ { "patheffect", 260 },
+ { "strokes_poly", 1100 },
+ { "stroketext", 700 },
+ };
+ for (auto allowedBadness : allowedBadnesses) {
+ if (0 == strcmp(allowedBadness.name, name)) {
+ return badnessMetric < allowedBadness.tolerance;
+ }
+ }
+ return badnessMetric < SK_SKQP_BADNESS_TOLERANCE;
+}
+
static int get_error(uint32_t value, uint32_t value_max, uint32_t value_min) {
int error = 0;
for (int j : {0, 8, 16, 24}) {
@@ -236,7 +259,7 @@ float Check(const uint32_t* pixels,
}
}
int64_t badnessMetric = badness * badPixelCount;
- if (badnessMetric < SK_SKQP_BADNESS_TOLERANCE) {
+ if (good_enough(name, badnessMetric)) {
std::lock_guard<std::mutex> lock(gMutex);
gErrors.push_back(Run{SkString(backend), SkString(name), 0, 0});
if (error_out) {