diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-12 14:27:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:35:20 +0000 |
commit | c30a6232df03e1efbd9f3b226777b07e087a1122 (patch) | |
tree | e992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/third_party/skia/gm/hittestpath.cpp | |
parent | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff) | |
download | qtwebengine-chromium-85-based.tar.gz |
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/third_party/skia/gm/hittestpath.cpp')
-rw-r--r-- | chromium/third_party/skia/gm/hittestpath.cpp | 52 |
1 files changed, 30 insertions, 22 deletions
diff --git a/chromium/third_party/skia/gm/hittestpath.cpp b/chromium/third_party/skia/gm/hittestpath.cpp index d482e49380c..694b9146cd3 100644 --- a/chromium/third_party/skia/gm/hittestpath.cpp +++ b/chromium/third_party/skia/gm/hittestpath.cpp @@ -34,32 +34,40 @@ static void test_hittest(SkCanvas* canvas, const SkPath& path) { } } -DEF_SIMPLE_GM(hittestpath, canvas, 700, 460) { - SkPath path; - SkRandom rand; +DEF_SIMPLE_GM_CAN_FAIL(hittestpath, canvas, errorMsg, 700, 460) { + if (canvas->getGrContext()) { + // GPU rasterization results vary greatly from platform to platform. We can't use them as + // an expected result for our internal SkPath::contains(). + *errorMsg = "This test is for CPU configs only."; + return skiagm::DrawResult::kSkip; + } - int scale = 300; - for (int i = 0; i < 4; ++i) { - // get the random values deterministically - SkScalar randoms[12]; - for (int index = 0; index < (int) SK_ARRAY_COUNT(randoms); ++index) { - randoms[index] = rand.nextUScalar1(); - } - path.lineTo(randoms[0] * scale, randoms[1] * scale); - path.quadTo(randoms[2] * scale, randoms[3] * scale, - randoms[4] * scale, randoms[5] * scale); - path.cubicTo(randoms[6] * scale, randoms[7] * scale, - randoms[8] * scale, randoms[9] * scale, - randoms[10] * scale, randoms[11] * scale); + SkPath path; + SkRandom rand; + + int scale = 300; + for (int i = 0; i < 4; ++i) { + // get the random values deterministically + SkScalar randoms[12]; + for (int index = 0; index < (int) SK_ARRAY_COUNT(randoms); ++index) { + randoms[index] = rand.nextUScalar1(); } + path.lineTo(randoms[0] * scale, randoms[1] * scale); + path.quadTo(randoms[2] * scale, randoms[3] * scale, + randoms[4] * scale, randoms[5] * scale); + path.cubicTo(randoms[6] * scale, randoms[7] * scale, + randoms[8] * scale, randoms[9] * scale, + randoms[10] * scale, randoms[11] * scale); + } - path.setFillType(SkPathFillType::kEvenOdd); - path.offset(SkIntToScalar(20), SkIntToScalar(20)); + path.setFillType(SkPathFillType::kEvenOdd); + path.offset(SkIntToScalar(20), SkIntToScalar(20)); - test_hittest(canvas, path); + test_hittest(canvas, path); - canvas->translate(SkIntToScalar(scale), 0); - path.setFillType(SkPathFillType::kWinding); + canvas->translate(SkIntToScalar(scale), 0); + path.setFillType(SkPathFillType::kWinding); - test_hittest(canvas, path); + test_hittest(canvas, path); + return skiagm::DrawResult::kOk; } |