Flutter Engine
The Flutter Engine
PathOpsDLineTest.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2012 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
13#include "tests/Test.h"
14
15#include <array>
16#include <cstddef>
17
18static const SkDLine tests[] = {
19 {{{2, 1}, {2, 1}}},
20 {{{2, 1}, {1, 1}}},
21 {{{2, 1}, {2, 2}}},
22 {{{1, 1}, {2, 2}}},
23 {{{3, 0}, {2, 1}}},
24 {{{3, 2}, {1, 1}}},
25};
26
27static const size_t tests_count = std::size(tests);
28
29DEF_TEST(PathOpsLineUtilities, reporter) {
30 for (size_t index = 0; index < tests_count; ++index) {
31 const SkDLine& line = tests[index];
33 SkDLine line2;
34 SkPoint pts[2] = {line[0].asSkPoint(), line[1].asSkPoint()};
35 line2.set(pts);
36 REPORTER_ASSERT(reporter, line[0] == line2[0] && line[1] == line2[1]);
37 SkDPoint mid = line.ptAtT(.5);
38 REPORTER_ASSERT(reporter, approximately_equal((line[0].fX + line[1].fX) / 2, mid.fX));
39 REPORTER_ASSERT(reporter, approximately_equal((line[0].fY + line[1].fY) / 2, mid.fY));
40 }
41}
reporter
Definition: FontMgrTest.cpp:39
static const SkDLine tests[]
static const size_t tests_count
DEF_TEST(PathOpsLineUtilities, reporter)
bool ValidLine(const SkDLine &line)
#define SkASSERT(cond)
Definition: SkAssert.h:116
bool approximately_equal(double x, double y)
#define REPORTER_ASSERT(r, cond,...)
Definition: Test.h:286
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259
const SkDLine & set(const SkPoint pts[2])
Definition: SkPathOpsLine.h:20