From ce1d293880da7d37da984090ed40320e0e3a6ca7 Mon Sep 17 00:00:00 2001 From: Yuqian Li Date: Fri, 18 Nov 2016 10:18:15 -0500 Subject: Add test for QuickFDot6Div This test will catch our (1 << 10) bug (which should be 1 << 9) BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4986 Change-Id: I25b607d1535a647284cee3b304a6f567f389e7f6 Reviewed-on: https://skia-review.googlesource.com/4986 Reviewed-by: Cary Clark Commit-Queue: Yuqian Li --- tests/MathTest.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'tests/MathTest.cpp') diff --git a/tests/MathTest.cpp b/tests/MathTest.cpp index 35b4136b44..0bd3cf5da5 100644 --- a/tests/MathTest.cpp +++ b/tests/MathTest.cpp @@ -9,6 +9,7 @@ #include "SkColorPriv.h" #include "SkEndian.h" +#include "SkFDot6.h" #include "SkFixed.h" #include "SkFloatBits.h" #include "SkFloatingPoint.h" @@ -36,6 +37,38 @@ static void test_clz(skiatest::Reporter* reporter) { } } +static void test_quick_div(skiatest::Reporter* reporter) { + /* + The inverse table is generated by turning on SkDebugf in the following test code + */ + SkFixed storage[kInverseTableSize * 2]; + SkFixed* table = storage + kInverseTableSize; + + // SkDebugf("static const int gFDot6INVERSE[] = {"); + for (SkFDot6 i=-kInverseTableSize; i struct PairRec { -- cgit v1.2.3