Lines Matching refs:path
23 #include "draw/path.h"
54 OH_Drawing_Path* path = OH_Drawing_PathCreate();
55 EXPECT_EQ(path == nullptr, false);
56 OH_Drawing_PathDestroy(path);
193 OH_Drawing_Path* path = OH_Drawing_PathCreate();
195 OH_Drawing_PathAddRect(path, 50, 50, 250, 250, OH_Drawing_PathDirection::PATH_DIRECTION_CW);
196 EXPECT_TRUE(IsScalarAlmostEqual(reinterpret_cast<Path*>(path)->GetBounds().GetWidth(), 200.0));
197 EXPECT_TRUE(IsScalarAlmostEqual(reinterpret_cast<Path*>(path)->GetBounds().GetHeight(), 200.0));
198 OH_Drawing_PathDestroy(path);
210 OH_Drawing_Path* path = OH_Drawing_PathCreate();
214 OH_Drawing_PathAddRoundRect(path, roundRect, OH_Drawing_PathDirection::PATH_DIRECTION_CW);
215 EXPECT_TRUE(IsScalarAlmostEqual(reinterpret_cast<Path*>(path)->GetBounds().GetWidth(), 200.0));
216 EXPECT_TRUE(IsScalarAlmostEqual(reinterpret_cast<Path*>(path)->GetBounds().GetHeight(), 200.0));
217 OH_Drawing_PathDestroy(path);
231 OH_Drawing_Path* path = OH_Drawing_PathCreate();
234 OH_Drawing_PathAddArc(path, nullptr, 0, 180);
235 OH_Drawing_PathAddArc(path, rect, 0, 180);
236 EXPECT_TRUE(IsScalarAlmostEqual(reinterpret_cast<Path*>(path)->GetBounds().GetWidth(), 200.0));
237 EXPECT_TRUE(IsScalarAlmostEqual(reinterpret_cast<Path*>(path)->GetBounds().GetHeight(), 100.0));
238 OH_Drawing_PathDestroy(path);
251 OH_Drawing_Path* path = OH_Drawing_PathCreate();
252 OH_Drawing_PathAddRect(path, 50, 50, 250, 250, OH_Drawing_PathDirection::PATH_DIRECTION_CW);
254 bool ret = OH_Drawing_PathContains(path, 0, 0);
256 ret = OH_Drawing_PathContains(path, 60, 60);
258 OH_Drawing_PathDestroy(path);
270 OH_Drawing_Path* path = OH_Drawing_PathCreate();
271 OH_Drawing_PathAddRect(path, 50, 50, 250, 250, OH_Drawing_PathDirection::PATH_DIRECTION_CW);
274 OH_Drawing_PathTransform(path, nullptr);
276 bool ret = OH_Drawing_PathContains(path, 50, 50);
278 OH_Drawing_PathTransform(path, matrix);
279 ret = OH_Drawing_PathContains(path, 50, 50);
281 OH_Drawing_PathDestroy(path);
293 OH_Drawing_Path* path = OH_Drawing_PathCreate();
295 OH_Drawing_PathSetFillType(path, PATH_FILL_TYPE_WINDING);
297 OH_Drawing_PathLineTo(path, 50, 40);
298 OH_Drawing_PathClose(path);
299 EXPECT_TRUE(IsScalarAlmostEqual(reinterpret_cast<Path*>(path)->GetBounds().GetWidth(), 50.0));
300 EXPECT_TRUE(IsScalarAlmostEqual(reinterpret_cast<Path*>(path)->GetBounds().GetHeight(), 40.0));
301 float ret = OH_Drawing_PathGetLength(path, true);
302 EXPECT_TRUE(IsScalarAlmostEqual(ret, 128.062485)); // 128.062485 is length of path
303 OH_Drawing_PathDestroy(path);
314 OH_Drawing_Path* path = OH_Drawing_PathCreate();
315 OH_Drawing_PathConicTo(path, 0, 0, 30, 30, 1);
316 OH_Drawing_PathConicTo(path, -20.5f, -20.5f, 30, 0, 1);
317 EXPECT_TRUE(IsScalarAlmostEqual(reinterpret_cast<Path*>(path)->GetBounds().GetWidth(), 50.5));
318 EXPECT_TRUE(IsScalarAlmostEqual(reinterpret_cast<Path*>(path)->GetBounds().GetHeight(), 50.5));
319 OH_Drawing_PathDestroy(path);
331 OH_Drawing_Path* path = OH_Drawing_PathCreate();
333 OH_Drawing_PathAddRectWithInitialCorner(path, rect, PATH_DIRECTION_CW, 0);
334 EXPECT_TRUE(IsScalarAlmostEqual(reinterpret_cast<Path*>(path)->GetBounds().GetWidth(), 200.0));
335 EXPECT_TRUE(IsScalarAlmostEqual(reinterpret_cast<Path*>(path)->GetBounds().GetHeight(), 300.0));
336 OH_Drawing_PathClose(path);
337 OH_Drawing_PathDestroy(path);
350 OH_Drawing_Path* path = OH_Drawing_PathCreate();
352 OH_Drawing_PathAddRectWithInitialCorner(path, rect, PATH_DIRECTION_CW, 0);
354 OH_Drawing_PathAddPathWithMode(path2, path, PATH_ADD_MODE_APPEND);
357 OH_Drawing_PathDestroy(path);
371 OH_Drawing_Path* path = OH_Drawing_PathCreate();
373 OH_Drawing_PathAddRectWithInitialCorner(path, rect, PATH_DIRECTION_CW, 0);
375 OH_Drawing_PathAddPathWithOffsetAndMode(path2, path, 0, 0, PATH_ADD_MODE_APPEND);
378 OH_Drawing_PathDestroy(path);
392 OH_Drawing_Path* path = OH_Drawing_PathCreate();
394 OH_Drawing_PathAddRectWithInitialCorner(path, rect, PATH_DIRECTION_CW, 0);
398 OH_Drawing_PathAddPathWithMatrixAndMode(path2, path, matrix, PATH_ADD_MODE_APPEND);
416 OH_Drawing_PathDestroy(path);
432 OH_Drawing_Path* path = OH_Drawing_PathCreate();
434 OH_Drawing_PathOffset(path, path2, 50, 40);
435 OH_Drawing_PathReset(path);
436 EXPECT_TRUE(IsScalarAlmostEqual(reinterpret_cast<Path*>(path)->GetBounds().GetWidth(), 0.0));
437 EXPECT_TRUE(IsScalarAlmostEqual(reinterpret_cast<Path*>(path)->GetBounds().GetHeight(), 0.0));
438 OH_Drawing_PathDestroy(path);