35 paint.setAntiAlias(
true);
40 SkDebugf(
"%s: %.10g, %.10g, %.10g, %.10g, %.10g, %.10g, %.10g, %.10g\n",
42 (
float)crv[0].fX, (
float)crv[0].fY,
43 (
float)crv[1].fX, (
float)crv[1].fY,
44 (
float)crv[2].fX, (
float)crv[2].fY,
45 (
float)crv[3].fX, (
float)crv[3].fY);
53 for (
int i = 0;
i < 4;
i++) {
71 crv[0].
fX = x0; crv[0].
fY = y0;
72 crv[1].
fX = x1; crv[1].
fY = y1;
73 crv[2].
fX = x2; crv[2].
fY = y2;
74 crv[3].
fX = x3; crv[3].
fY = y3;
88 SkPoint clipped[4], shouldbe[4];
91 const float tol = 1e-4f;
96 success = clipper.
clipCubic(crv, clipped);
99 0, 0, 2, 3, 1, 10, 4, 12, shouldbe), tol));
104 success = clipper.
clipCubic(crv, clipped);
107 0, 0, 2, 3, 1, 10, 4, 12, shouldbe), tol));
112 success = clipper.
clipCubic(crv, clipped);
115 0, 0, 2, 3, 1, 10, 4, 12, shouldbe), tol));
120 success = clipper.
clipCubic(crv, clipped);
126 success = clipper.
clipCubic(crv, clipped);
130 1.841195941f, 4.337081432f,
131 1.297019958f, 10.19801331f,
138 success = clipper.
clipCubic(crv, clipped);
142 1.767683744f, 5.400758266f,
143 1.55052948f, 10.36701965f,
150 success = clipper.
clipCubic(crv, clipped);
154 1.742904663f, 2.614356995f,
155 1.207521796f, 8.266430855f,
162 success = clipper.
clipCubic(crv, clipped);
166 1.551193237f, 2.326789856f,
167 1.297736168f, 7.059780121f,
178 paint.setAntiAlias(
true);
218 path.moveTo(-30/64.0, -31/64.0);
219 path.cubicTo(-31/64.0, -31/64,-31/64.0, -31/64,-31/64.0, 100);
220 path.lineTo(100, 100);
225 path.moveTo(-30/64.0f, -31/64.0f + 1/256.0f);
226 path.cubicTo(-31/64.0f + 1/256.0f, -31/64.0f + 1/256.0f,
227 -31/64.0f + 1/256.0f, -31/64.0f + 1/256.0f,
228 -31/64.0f + 1/256.0f, 100);
229 path.lineTo(100, 100);
static bool CurvesAreEqual(const SkPoint c0[4], const SkPoint c1[4], float tol)
static SkPoint * SetCurve(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3, SkPoint crv[4])
DEF_TEST(ClipCubic, reporter)
static void PrintCurve(const char *name, const SkPoint crv[4])
static void test_giantClip()
constexpr SkColor SK_ColorTRANSPARENT
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static float SkBits2Float(uint32_t bits)
#define REPORTER_ASSERT(r, cond,...)
void allocN32Pixels(int width, int height, bool isOpaque=false)
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
void clear(SkColor color)
void drawPath(const SkPath &path, const SkPaint &paint)
bool clipCubic(const SkPoint src[4], SkPoint dst[4])
void setClip(const SkIRect &clip)
static SkPath Polygon(const SkPoint pts[], int count, bool isClosed, SkPathFillType=SkPathFillType::kWinding, bool isVolatile=false)
clipRect(r.rect, r.opAA.op(), r.opAA.aa())) template<> void Draw
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
DEF_SWITCHES_START aot vmservice shared library name
static SkImageInfo MakeN32Premul(int width, int height)