1673 {
1674 enum Style {
1679 };
1680
1681
1685 strokeRecs[
kStroke].setStrokeStyle(2.f);
1686 strokeRecs[
kHairline].setHairlineStyle();
1688
1689
1692
1693 static constexpr size_t kStyleCnt = std::size(strokeRecs);
1694
1695 auto index = [](bool inverted,
1698 Style style,
1699 bool dash) -> int {
1700 return inverted * (2 * 8 * kStyleCnt * 2) +
1701 (
int)
dir * ( 8 * kStyleCnt * 2) +
1702 start * ( kStyleCnt * 2) +
1703 style * ( 2) +
1704 dash;
1705 };
1707 const int cnt = index(true, kSecondDirection, 7, static_cast<Style>(kStyleCnt - 1), true) + 1;
1709 for (bool inverted : {false, true}) {
1713 for (bool dash : {false, true}) {
1715 shapes[index(inverted, dir,
start, style, dash)] =
1717 GrStyle(strokeRecs[style], std::move(pe)));
1718 }
1719 }
1720 }
1721 }
1722 }
1723
1724
1725
1727 static constexpr unsigned kExamplesStart = 0;
1728 const GrStyledShape& exampleFillCase = shapes[index(
false, kExamplesDir, kExamplesStart,
kFill,
1729 false)];
1730 Key exampleFillCaseKey;
1731 make_key(&exampleFillCaseKey, exampleFillCase);
1732
1733 const GrStyledShape& exampleStrokeAndFillCase = shapes[index(
false, kExamplesDir,
1734 kExamplesStart, kStrokeAndFill, false)];
1735 Key exampleStrokeAndFillCaseKey;
1736 make_key(&exampleStrokeAndFillCaseKey, exampleStrokeAndFillCase);
1737
1738 const GrStyledShape& exampleInvFillCase = shapes[index(
true, kExamplesDir,
1739 kExamplesStart,
kFill,
false)];
1740 Key exampleInvFillCaseKey;
1741 make_key(&exampleInvFillCaseKey, exampleInvFillCase);
1742
1743 const GrStyledShape& exampleInvStrokeAndFillCase = shapes[index(
true, kExamplesDir,
1744 kExamplesStart, kStrokeAndFill,
1745 false)];
1746 Key exampleInvStrokeAndFillCaseKey;
1747 make_key(&exampleInvStrokeAndFillCaseKey, exampleInvStrokeAndFillCase);
1748
1749 const GrStyledShape& exampleStrokeCase = shapes[index(
false, kExamplesDir, kExamplesStart,
1751 Key exampleStrokeCaseKey;
1752 make_key(&exampleStrokeCaseKey, exampleStrokeCase);
1753
1754 const GrStyledShape& exampleInvStrokeCase = shapes[index(
true, kExamplesDir, kExamplesStart,
1756 Key exampleInvStrokeCaseKey;
1757 make_key(&exampleInvStrokeCaseKey, exampleInvStrokeCase);
1758
1759 const GrStyledShape& exampleHairlineCase = shapes[index(
false, kExamplesDir, kExamplesStart,
1761 Key exampleHairlineCaseKey;
1762 make_key(&exampleHairlineCaseKey, exampleHairlineCase);
1763
1764 const GrStyledShape& exampleInvHairlineCase = shapes[index(
true, kExamplesDir, kExamplesStart,
1766 Key exampleInvHairlineCaseKey;
1767 make_key(&exampleInvHairlineCaseKey, exampleInvHairlineCase);
1768
1769
1772 unsigned queryStart = ~0
U;
1773 bool queryInverted = true;
1774
1780
1782 &queryInverted));
1787
1789 &queryInverted));
1794
1796 &queryInverted));
1801
1803 &queryInverted));
1808
1810 &queryInverted));
1815
1821
1823 &queryInverted));
1828
1829
1831 REPORTER_ASSERT(r, exampleFillCaseKey == exampleStrokeAndFillCaseKey);
1832 REPORTER_ASSERT(r, exampleFillCaseKey != exampleInvStrokeAndFillCaseKey);
1837 REPORTER_ASSERT(r, exampleInvStrokeAndFillCaseKey == exampleInvFillCaseKey);
1838 REPORTER_ASSERT(r, exampleInvStrokeAndFillCaseKey == exampleInvStrokeCaseKey);
1839 REPORTER_ASSERT(r, exampleInvStrokeAndFillCaseKey == exampleInvHairlineCaseKey);
1840
1841 for (bool inverted : {false, true}) {
1844 for (bool dash : {false, true}) {
1846 dash)];
1849
1851 kStrokeAndFill, dash)];
1852 Key strokeAndFillCaseKey;
1853 make_key(&strokeAndFillCaseKey, strokeAndFillCase);
1854
1855
1856
1860 TestCase b(inverted ? exampleInvFillCase : exampleFillCase, r);
1862 TestCase d(inverted ? exampleInvStrokeAndFillCase
1863 : exampleStrokeAndFillCase, r);
1864 a.compare(r,
b, TestCase::kAllSame_ComparisonExpecation);
1865 c.compare(r,
d, TestCase::kAllSame_ComparisonExpecation);
1866
1868 dash)];
1871
1874
1875
1876 if (dash) {
1877
1883
1885 &queryInverted));
1891 &queryInverted));
1896
1897
1898
1900 e.compare(r, f, TestCase::kSameUpToPE_ComparisonExpecation);
1901 g.compare(r,
h, TestCase::kSameUpToPE_ComparisonExpecation);
1902 } else {
1903 e.compare(r, f, TestCase::kAllDifferent_ComparisonExpecation);
1904 g.compare(r,
h, TestCase::kAllDifferent_ComparisonExpecation);
1905 }
1906 } else {
1907 TestCase f(inverted ? exampleInvStrokeCase : exampleStrokeCase, r);
1908 TestCase h(inverted ? exampleInvHairlineCase : exampleHairlineCase, r);
1911 e.compare(r, f, TestCase::kAllSame_ComparisonExpecation);
1912 g.compare(r,
h, TestCase::kAllSame_ComparisonExpecation);
1913 }
1914 }
1915 }
1916 }
1917 }
1918}
unsigned canonicalize_rrect_start(int s, const SkRRect &rrect)
static constexpr bool SkToBool(const T &x)
SkPathEffect * pathEffect() const
bool asRRect(SkRRect *rrect, SkPathDirection *dir, unsigned *start, bool *inverted) const
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
@ kStrokeAndFill
both strokes and fills shapes
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 to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets dir