/third_party/skia/tests/ |
H A D | PathCoverageTest.cpp | 59 static inline uint32_t compute_pointCount(SkScalar d, SkScalar tol) { in compute_pointCount() argument 60 if (d < tol) { in compute_pointCount() 63 int temp = SkScalarCeilToInt(SkScalarSqrt(d / tol)); in compute_pointCount() 74 static uint32_t quadraticPointCount_EC(const SkPoint points[], SkScalar tol) { in quadraticPointCount_EC() argument 76 return compute_pointCount(SkIntToScalar(distance), tol); in quadraticPointCount_EC() 84 static uint32_t quadraticPointCount_CC(const SkPoint points[], SkScalar tol) { in quadraticPointCount_CC() argument 86 return compute_pointCount(distance, tol); in quadraticPointCount_CC()
|
H A D | ClipCubicTest.cpp | 50 float tol) { in CurvesAreEqual() 52 if (SkScalarAbs(c0[i].fX - c1[i].fX) > tol || in CurvesAreEqual() 53 SkScalarAbs(c0[i].fY - c1[i].fY) > tol in CurvesAreEqual() 89 const float tol = 1e-4f; in DEF_TEST() local 97 0, 0, 2, 3, 1, 10, 4, 12, shouldbe), tol)); in DEF_TEST() 105 0, 0, 2, 3, 1, 10, 4, 12, shouldbe), tol)); in DEF_TEST() 113 0, 0, 2, 3, 1, 10, 4, 12, shouldbe), tol)); in DEF_TEST() 131 shouldbe), tol)); in DEF_TEST() 143 shouldbe), tol)); in DEF_TEST() 155 shouldbe), tol)); in DEF_TEST() 48 CurvesAreEqual(const SkPoint c0[4], const SkPoint c1[4], float tol) CurvesAreEqual() argument [all...] |
H A D | ReadWritePixelsGpuTest.cpp | 315 float tol = numer / (1 << rgbBits); in gpu_read_pixels_test_driver() 326 const float tols[4] = {tol, tol, tol, alphaTol}; in gpu_read_pixels_test_driver() 882 float tol = 2.f/(1 << rgbBits); in gpu_write_pixels_test_driver() 893 const float tols[4] = {tol, tol, tol, alphaTol}; in gpu_write_pixels_test_driver() 1212 float tol[] = {rgbTol, rgbTol, rgbTol, alphaTol}; in DEF_GPUTEST_FOR_RENDERING_CONTEXTS() local 1238 ComparePixels(a, b, tol, erro in DEF_GPUTEST_FOR_RENDERING_CONTEXTS() 1290 float tol[4] = {}; // expect exactly same pixels, no conversions. DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS() local [all...] |
H A D | TransferPixelsTest.cpp | 398 float tol[4]; in basic_transfer_from_test() local 399 determine_tolerances(allowedRead.fColorType, colorType, tol); in basic_transfer_from_test() 410 tol, in basic_transfer_from_test() local 448 tol, in basic_transfer_from_test() local
|
/third_party/vk-gl-cts/external/amber/src/src/ |
H A D | verifier.cc | 177 const auto& tol = command->GetTolerances(); in SetupToleranceForTexels() local 178 if (tol.size() == 4) { in SetupToleranceForTexels() 179 tolerance[0] = tol[0].value; in SetupToleranceForTexels() 180 tolerance[1] = tol[1].value; in SetupToleranceForTexels() 181 tolerance[2] = tol[2].value; in SetupToleranceForTexels() 182 tolerance[3] = tol[3].value; in SetupToleranceForTexels() 183 is_tolerance_percent[0] = tol[0].is_percent; in SetupToleranceForTexels() 184 is_tolerance_percent[1] = tol[1].is_percent; in SetupToleranceForTexels() 185 is_tolerance_percent[2] = tol[2].is_percent; in SetupToleranceForTexels() 186 is_tolerance_percent[3] = tol[ in SetupToleranceForTexels() [all...] |
/third_party/skia/src/gpu/ops/ |
H A D | TriangulatingPathRenderer.cpp | 58 static sk_sp<SkData> create_data(int numVertices, bool isLinear, SkScalar tol) { in create_data() argument 59 TessInfo info { numVertices, isLinear, tol }; in create_data() 63 bool cache_match(const SkData* data, SkScalar tol) { in cache_match() argument 68 return info->fIsLinear || info->fTolerance < 3.0f * tol; in cache_match() 255 // Triangulate the provided 'shape' in the shape's coordinate space. 'tol' should already 261 SkScalar tol, in Triangulate() 275 return GrTriangulator::PathToTriangles(path, tol, clipBounds, allocator, isLinear); in Triangulate() 286 SkScalar tol = GrPathUtils::scaleToleranceToSrc(GrPathUtils::kDefaultTolerance, in createNonAAMesh() local 291 if (cachedVerts && cache_match(data.get(), tol)) { in createNonAAMesh() 319 int vertexCount = Triangulate(&allocator, fViewMatrix, fShape, fDevClipBounds, tol, in createNonAAMesh() 257 Triangulate(GrEagerVertexAllocator* allocator, const SkMatrix& viewMatrix, const GrStyledShape& shape, const SkIRect& devClipBounds, SkScalar tol, bool* isLinear) Triangulate() argument 354 SkScalar tol = GrPathUtils::kDefaultTolerance; createAAMesh() local 445 SkScalar tol = GrPathUtils::scaleToleranceToSrc(GrPathUtils::kDefaultTolerance, global() variable [all...] |
H A D | DefaultPathRenderer.cpp | 599 SkScalar tol = GrPathUtils::kDefaultTolerance; in GR_DRAW_OP_TEST_DEFINE() local 600 SkScalar srcSpaceTol = GrPathUtils::scaleToleranceToSrc(tol, viewMatrix, bounds); in GR_DRAW_OP_TEST_DEFINE() 710 SkScalar tol = GrPathUtils::kDefaultTolerance; in internalDrawPath() local 711 SkScalar srcSpaceTol = GrPathUtils::scaleToleranceToSrc(tol, viewMatrix, path.getBounds()); in internalDrawPath()
|
/third_party/skia/samplecode/ |
H A D | SamplePath.cpp | 283 const SkScalar tol = 4; variable 284 const SkRect r = SkRect::MakeXYWH(x - tol, y - tol, tol * 2, tol * 2); 410 const SkScalar tol = 4; variable 411 const SkRect r = SkRect::MakeXYWH(x - tol, y - tol, tol * 2, tol * 518 const SkScalar tol = 8; global() variable 747 const SkScalar tol = 8; global() variable [all...] |
H A D | SampleSimpleStroker.cpp | 465 const SkScalar tol = 4; variable 466 const SkRect r = SkRect::MakeXYWH(x - tol, y - tol, tol * 2, tol * 2);
|
H A D | SampleVariableWidthStroker.cpp | 290 float tol, in ZeroSetRec() 299 if (lenP <= tol) { in ZeroSetRec() 313 ZeroSetRec(left, tmin, tmid, tol, result); in ZeroSetRec() 314 ZeroSetRec(right, tmid, tmax, tol, result); in ZeroSetRec() 1201 const SkScalar tol = 4; 1202 const SkRect r = SkRect::MakeXYWH(x - tol, y - tol, tol * 2, tol * 2); 287 ZeroSetRec(const ScalarBezCurve& curve, float tmin, float tmax, float tol, std::vector<float>* result) ZeroSetRec() argument
|
/third_party/mindspore/test/utils/ |
H A D | common.cpp | 130 float tol = 0; in allclose() local 157 tol = tol + fabs(a[i] - b[i]) / (fabs(b[i]) + 1); in allclose() 171 tol / fail_count); in allclose() 190 file << "," << tol / fail_count; in allclose() 205 if (tol / fail_count < 0.04) { in allclose() 219 float tol = 0; in allclose_int8() local 249 tol = tol + fabs(a[i] - b[i]) / (fabs(b[i]) + 1); in allclose_int8() 261 tol / fail_coun in allclose_int8() [all...] |
/third_party/libinput/test/ |
H A D | check-double-macros.h | 61 #define ck_assert_double_eq_tol(X, Y, tol) _ck_assert_double_eq(X, Y, tol) 63 #define ck_assert_double_ne_tol(X, Y, tol) _ck_assert_double_ne(X, Y, tol)
|
/third_party/python/Lib/test/ |
H A D | test_statistics.py | 82 def approx_equal(x, y, tol=1e-12, rel=1e-7): 83 """approx_equal(x, y [, tol [, rel]]) => True|False 90 an absolute error tol or a relative error rel, whichever is bigger. 92 If given, both tol and rel must be finite, non-negative numbers. If not 93 given, default values are tol=1e-12 and rel=1e-7. 95 >>> approx_equal(1.2589, 1.2587, tol=0.0003, rel=0) 97 >>> approx_equal(1.2589, 1.2587, tol=0.0001, rel=0) 101 tol, x and y are considered approximately equal. 116 if tol < 0 or rel < 0: 131 allowed_error = max(tol, re [all...] |
/third_party/skia/src/core/ |
H A D | SkCubicClipper.cpp | 38 const SkScalar tol = SK_Scalar1 / 16384; // This leaves 2 fixed noise bits. in ChopMonoAtY() local 54 converged = SkScalarAbs(t1 - t0) <= tol; // NaN-safe in ChopMonoAtY() 84 const SkScalar tol = SK_Scalar1 / 65536; // 1 for fixed, 1e-5 for float. in ChopMonoAtY() 101 } while (!(SkScalarAbs(tPos - tNeg) <= tol)); // Nan-safe in ChopMonoAtY()
|
H A D | SkPointPriv.h | 58 static bool EqualsWithinTolerance(const SkPoint& pt, const SkPoint& p, SkScalar tol) { in EqualsWithinTolerance() argument 59 return SkScalarNearlyZero(pt.fX - p.fX, tol) in EqualsWithinTolerance() 60 && SkScalarNearlyZero(pt.fY - p.fY, tol); in EqualsWithinTolerance()
|
H A D | SkGeometry.h | 341 bool asQuadTol(SkScalar tol) const; 347 int SK_SPI computeQuadPOW2(SkScalar tol) const; 499 const SkPoint* computeQuads(const SkConic& conic, SkScalar tol) { in computeQuads() argument 500 int pow2 = conic.computeQuadPOW2(tol); in computeQuads() 508 SkScalar tol) { in computeQuads() 511 return computeQuads(conic, tol); in computeQuads() 507 computeQuads(const SkPoint pts[3], SkScalar weight, SkScalar tol) computeQuads() argument
|
H A D | SkDraw_vertices.cpp | 242 constexpr float tol = 0.05f; in fill_triangle_3() local 243 // tol is the nudge away from zero, to keep the numerics nice. in fill_triangle_3() 246 // Return the point between curr and next where the fZ value crosses tol. in fill_triangle_3() 249 return lerp(curr, next, computeT(curr.fZ - tol, next.fZ - tol)); in fill_triangle_3() 262 if (pts[curr].fZ > tol) { in fill_triangle_3() 264 if (pts[next].fZ <= tol) { // curr is IN, next is OUT in fill_triangle_3() 268 if (pts[next].fZ > tol) { // curr is OUT, next is IN in fill_triangle_3()
|
H A D | SkBitmapProcState.cpp | 159 const SkScalar tol = SK_Scalar1 / 32768; 161 return SkScalarNearlyZero(matrix[SkMatrix::kMScaleX] - SK_Scalar1, tol) 162 && SkScalarNearlyZero(matrix[SkMatrix::kMScaleY] - SK_Scalar1, tol); 170 static constexpr SkScalar tol = SK_Scalar1 / 256; 173 && SkScalarNearlyEqual(m.getTranslateX(), SkScalarRoundToScalar(m.getTranslateX()), tol) 174 && SkScalarNearlyEqual(m.getTranslateY(), SkScalarRoundToScalar(m.getTranslateY()), tol);
|
H A D | SkGeometry.cpp | 1389 bool SkConic::asQuadTol(SkScalar tol) const { 1391 return (x * x + y * y) <= tol * tol; 1397 int SkConic::computeQuadPOW2(SkScalar tol) const { 1398 if (tol < 0 || !SkScalarIsFinite(tol) || !SkPointPriv::AreFinite(fPts, 3)) { 1407 if (error <= tol) { 1415 if (err <= tol) { 1418 SkScalar tol2 = tol * tol; [all...] |
H A D | SkScan_Hairline.cpp | 338 SkScalar tol = SK_Scalar1 / 8; 341 if (diff < tol) { 344 tol *= 4; 607 const SkScalar tol = SK_Scalar1 / 4; 608 const SkPoint* quadPts = converter.computeQuads(pts, *w, tol);
|
/third_party/skia/fuzz/ |
H A D | FuzzTriangulation.cpp | 20 SkScalar tol = GrPathUtils::scaleToleranceToSrc(GrPathUtils::kDefaultTolerance, in DEF_FUZZ() local 31 int count = GrTriangulator::PathToTriangles(path, tol, clipBounds, &allocator, &isLinear); in DEF_FUZZ()
|
/third_party/skia/src/gpu/tessellate/ |
H A D | StrokeTessellator.h | 140 auto tol = StrokeTolerances::ApproxNumRadialSegmentsPerRadian(fParametricPrecision, in fetchRadialSegmentsPerRadian() local 142 tol.store(fNumRadialSegmentsPerRadian); in fetchRadialSegmentsPerRadian()
|
/third_party/skia/src/gpu/geometry/ |
H A D | GrPathUtils.h | 44 uint32_t quadraticPointCount(const SkPoint points[], SkScalar tol); 57 uint32_t cubicPointCount(const SkPoint points[], SkScalar tol);
|
/third_party/FreeBSD/contrib/gdtoa/ |
H A D | strtodg.c | 330 double adj0, tol; local 971 tol = dval(&adj) * 5e-16; /* > max rel error */ 973 if (dval(&adj) < -tol) { 974 if (adj0 > tol) { 979 else if (dval(&adj) > tol && adj0 < 1. - tol) {
|
/third_party/skia/src/utils/ |
H A D | SkParsePath.cpp | 271 const SkScalar tol = SK_Scalar1 / 1024; // how close to a quad in ToSVGString() local 273 const SkPoint* quadPts = quadder.computeQuads(pts, iter.conicWeight(), tol); in ToSVGString()
|