[graphite] More testing infrastructure
With this CL we can run as: dm --src gm skp tests --config grmtl -v --nocpu --nogpu and not get all the non-Graphite unit tests. Bug: skia:12466 Change-Id: Ib3f04f315fe4b5731a54e4c72979a0c1e00baf24 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/457898 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
This commit is contained in:
parent
76f61debc6
commit
297d096cfb
16
dm/DM.cpp
16
dm/DM.cpp
@ -115,6 +115,7 @@ static DEFINE_bool2(veryVerbose, V, false, "tell individual tests to be verbose.
|
||||
|
||||
static DEFINE_bool(cpu, true, "Run CPU-bound work?");
|
||||
static DEFINE_bool(gpu, true, "Run GPU-bound work?");
|
||||
static DEFINE_bool(graphite, true, "Run Graphite work?");
|
||||
|
||||
static DEFINE_bool(dryRun, false,
|
||||
"just print the tests that would be run, without actually running them.");
|
||||
@ -944,9 +945,7 @@ static Sink* create_sink(const GrContextOptions& grCtxOptions, const SkCommandLi
|
||||
"GM tests will be skipped.\n", gpuConfig->getTag().c_str());
|
||||
return nullptr;
|
||||
}
|
||||
if (gpuConfig->getUseGraphite()) {
|
||||
return new GraphiteSink();
|
||||
} else if (gpuConfig->getTestThreading()) {
|
||||
if (gpuConfig->getTestThreading()) {
|
||||
SkASSERT(!gpuConfig->getTestPersistentCache());
|
||||
return new GPUThreadTestingSink(gpuConfig, grCtxOptions);
|
||||
} else if (gpuConfig->getTestPersistentCache()) {
|
||||
@ -962,6 +961,13 @@ static Sink* create_sink(const GrContextOptions& grCtxOptions, const SkCommandLi
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef SK_GRAPHITE_ENABLED
|
||||
if (FLAGS_graphite) {
|
||||
if (const SkCommandLineConfigGraphite *graphiteConfig = config->asConfigGraphite()) {
|
||||
return new GraphiteSink(graphiteConfig);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (const SkCommandLineConfigSvg* svgConfig = config->asConfigSvg()) {
|
||||
int pageIndex = svgConfig->getPageIndex();
|
||||
return new SVGSink(pageIndex);
|
||||
@ -1432,7 +1438,9 @@ static void gather_tests() {
|
||||
}
|
||||
if (test.needsGpu && FLAGS_gpu) {
|
||||
gSerialTests->push_back(test);
|
||||
} else if (!test.needsGpu && FLAGS_cpu) {
|
||||
} else if (test.fNeedsGraphite && FLAGS_graphite) {
|
||||
gSerialTests->push_back(test);
|
||||
} else if (!test.needsGpu && !test.fNeedsGraphite && FLAGS_cpu) {
|
||||
gParallelTests->push_back(test);
|
||||
}
|
||||
}
|
||||
|
@ -2117,8 +2117,6 @@ Result RasterSink::draw(const Src& src, SkBitmap* dst, SkWStream*, SkString*) co
|
||||
|
||||
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
|
||||
|
||||
GraphiteSink::GraphiteSink() {}
|
||||
|
||||
#ifdef SK_GRAPHITE_ENABLED
|
||||
|
||||
namespace {
|
||||
@ -2142,18 +2140,25 @@ void precompile(skgpu::Context* context) {
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
GraphiteSink::GraphiteSink(const SkCommandLineConfigGraphite* config)
|
||||
: fContextType(config->getContextType())
|
||||
, fColorType(config->getColorType())
|
||||
, fAlphaType(config->getAlphaType())
|
||||
, fTestPrecompile(config->getTestPrecompile()) {
|
||||
}
|
||||
|
||||
Result GraphiteSink::draw(const Src& src,
|
||||
SkBitmap* dst,
|
||||
SkWStream* dstStream,
|
||||
SkString* log) const {
|
||||
using ContextType = skiatest::graphite::ContextFactory::ContextType;
|
||||
|
||||
SkImageInfo ii = SkImageInfo::Make(src.size(), kRGBA_8888_SkColorType, kPremul_SkAlphaType);
|
||||
SkImageInfo ii = SkImageInfo::Make(src.size(), fColorType, fAlphaType);
|
||||
|
||||
skiatest::graphite::ContextFactory factory;
|
||||
auto [_, context] = factory.getContextInfo(ContextType::kMetal);
|
||||
auto [_, context] = factory.getContextInfo(fContextType);
|
||||
|
||||
precompile(context.get());
|
||||
if (fTestPrecompile) {
|
||||
precompile(context.get());
|
||||
}
|
||||
|
||||
sk_sp<SkSurface> surface = MakeGraphite(std::move(context), ii);
|
||||
if (!surface) {
|
||||
@ -2172,10 +2177,6 @@ Result GraphiteSink::draw(const Src& src,
|
||||
|
||||
return Result::Ok();
|
||||
}
|
||||
#else
|
||||
Result GraphiteSink::draw(const Src& src, SkBitmap*, SkWStream* dst, SkString*) const {
|
||||
return Result::Fatal("Graphite not enabled.");
|
||||
}
|
||||
#endif
|
||||
|
||||
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
|
||||
|
@ -579,15 +579,27 @@ private:
|
||||
int fPageIndex;
|
||||
};
|
||||
|
||||
#ifdef SK_GRAPHITE_ENABLED
|
||||
|
||||
class GraphiteSink : public Sink {
|
||||
public:
|
||||
GraphiteSink();
|
||||
using ContextType = skiatest::graphite::ContextFactory::ContextType;
|
||||
|
||||
GraphiteSink(const SkCommandLineConfigGraphite*);
|
||||
|
||||
Result draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override;
|
||||
const char* fileExtension() const override { return "png"; }
|
||||
SinkFlags flags() const override { return SinkFlags{ SinkFlags::kGPU, SinkFlags::kDirect }; }
|
||||
|
||||
private:
|
||||
ContextType fContextType;
|
||||
SkColorType fColorType;
|
||||
SkAlphaType fAlphaType;
|
||||
bool fTestPrecompile;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
|
||||
|
||||
class Via : public Sink {
|
||||
|
@ -36,20 +36,9 @@ struct GrContextOptions;
|
||||
#define TestCanvasWidth 1000
|
||||
#define TestCanvasHeight 600
|
||||
|
||||
#if !defined(SK_BUILD_FOR_UNIX)
|
||||
#undef DEF_TEST
|
||||
#define DEF_TEST(name, reporter) \
|
||||
static void test_##name(skiatest::Reporter* reporter, const GrContextOptions&); \
|
||||
skiatest::TestRegistry name##TestRegistry(skiatest::Test(#name, false, test_##name)); \
|
||||
void test_##name(skiatest::Reporter* reporter, const GrContextOptions&) { \
|
||||
/* SkDebugf("Disabled:"#name "\n"); */ \
|
||||
} \
|
||||
void disabled_##name(skiatest::Reporter* reporter, const GrContextOptions&)
|
||||
#endif
|
||||
|
||||
using namespace skia::text;
|
||||
|
||||
DEF_TEST(SkText_FontResolution1, reporter) {
|
||||
UNIX_ONLY_TEST(SkText_FontResolution1, reporter) {
|
||||
TrivialFontChain* fontChain = new TrivialFontChain("Roboto", 40.0f, SkFontStyle::Normal());
|
||||
if (fontChain->empty()) return;
|
||||
|
||||
@ -69,7 +58,7 @@ DEF_TEST(SkText_FontResolution1, reporter) {
|
||||
REPORTER_ASSERT(reporter, resolvedFonts.front().style == SkFontStyle::Normal());
|
||||
}
|
||||
|
||||
DEF_TEST(SkText_FontResolution3, reporter) {
|
||||
UNIX_ONLY_TEST(SkText_FontResolution3, reporter) {
|
||||
MultipleFontChain* fontChain = new MultipleFontChain({ "Roboto", "Noto Color Emoji", "Noto Serif CJK JP" }, 40.0f, SkFontStyle::Normal());
|
||||
if (fontChain->count() < 3) return;
|
||||
|
||||
|
@ -36,17 +36,6 @@ struct GrContextOptions;
|
||||
#define TestCanvasWidth 1000
|
||||
#define TestCanvasHeight 600
|
||||
|
||||
#if !defined(SK_BUILD_FOR_UNIX)
|
||||
#undef DEF_TEST
|
||||
#define DEF_TEST(name, reporter) \
|
||||
static void test_##name(skiatest::Reporter* reporter, const GrContextOptions&); \
|
||||
skiatest::TestRegistry name##TestRegistry(skiatest::Test(#name, false, test_##name)); \
|
||||
void test_##name(skiatest::Reporter* reporter, const GrContextOptions&) { \
|
||||
/* SkDebugf("Disabled:"#name "\n"); */ \
|
||||
} \
|
||||
void disabled_##name(skiatest::Reporter* reporter, const GrContextOptions&)
|
||||
#endif
|
||||
|
||||
using namespace skia::text;
|
||||
|
||||
struct TestLine {
|
||||
@ -102,7 +91,7 @@ public:
|
||||
std::vector<TestRun> fTestRuns;
|
||||
};
|
||||
|
||||
DEF_TEST(SkText_SelectableText_Bounds, reporter) {
|
||||
UNIX_ONLY_TEST(SkText_SelectableText_Bounds, reporter) {
|
||||
sk_sp<TrivialFontChain> fontChain = sk_make_sp<TrivialFontChain>("Roboto", 40.0f, SkFontStyle::Normal());
|
||||
if (fontChain->empty()) return;
|
||||
|
||||
@ -150,7 +139,7 @@ DEF_TEST(SkText_SelectableText_Bounds, reporter) {
|
||||
}
|
||||
}
|
||||
|
||||
DEF_TEST(SkText_SelectableText_Navigation_FirstLast, reporter) {
|
||||
UNIX_ONLY_TEST(SkText_SelectableText_Navigation_FirstLast, reporter) {
|
||||
sk_sp<TrivialFontChain> fontChain = sk_make_sp<TrivialFontChain>("Roboto", 40.0f, SkFontStyle::Normal());
|
||||
if (fontChain->empty()) return;
|
||||
|
||||
@ -192,7 +181,7 @@ DEF_TEST(SkText_SelectableText_Navigation_FirstLast, reporter) {
|
||||
REPORTER_ASSERT(reporter, SkScalarNearlyEqual(lastPosition.fBoundaries.height(), lastLine.bounds.height()));
|
||||
}
|
||||
|
||||
DEF_TEST(SkText_SelectableText_ScanRightByGraphemeClusters, reporter) {
|
||||
UNIX_ONLY_TEST(SkText_SelectableText_ScanRightByGraphemeClusters, reporter) {
|
||||
sk_sp<TrivialFontChain> fontChain = sk_make_sp<TrivialFontChain>("Roboto", 40.0f, SkFontStyle::Normal());
|
||||
if (fontChain->empty()) return;
|
||||
|
||||
@ -233,7 +222,7 @@ DEF_TEST(SkText_SelectableText_ScanRightByGraphemeClusters, reporter) {
|
||||
}
|
||||
}
|
||||
|
||||
DEF_TEST(SkText_SelectableText_ScanLeftByGraphemeClusters, reporter) {
|
||||
UNIX_ONLY_TEST(SkText_SelectableText_ScanLeftByGraphemeClusters, reporter) {
|
||||
sk_sp<TrivialFontChain> fontChain = sk_make_sp<TrivialFontChain>("Roboto", 40.0f, SkFontStyle::Normal());
|
||||
if (fontChain->empty()) return;
|
||||
|
||||
@ -274,7 +263,7 @@ DEF_TEST(SkText_SelectableText_ScanLeftByGraphemeClusters, reporter) {
|
||||
}
|
||||
}
|
||||
|
||||
DEF_TEST(SkText_SelectableText_Navigation_UpDown, reporter) {
|
||||
UNIX_ONLY_TEST(SkText_SelectableText_Navigation_UpDown, reporter) {
|
||||
sk_sp<TrivialFontChain> fontChain = sk_make_sp<TrivialFontChain>("Roboto", 40.0f, SkFontStyle::Normal());
|
||||
if (fontChain->empty()) return;
|
||||
|
||||
@ -309,4 +298,3 @@ DEF_TEST(SkText_SelectableText_Navigation_UpDown, reporter) {
|
||||
position = down;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,20 +36,9 @@ struct GrContextOptions;
|
||||
#define TestCanvasWidth 1000
|
||||
#define TestCanvasHeight 600
|
||||
|
||||
#if !defined(SK_BUILD_FOR_UNIX)
|
||||
#undef DEF_TEST
|
||||
#define DEF_TEST(name, reporter) \
|
||||
static void test_##name(skiatest::Reporter* reporter, const GrContextOptions&); \
|
||||
skiatest::TestRegistry name##TestRegistry(skiatest::Test(#name, false, test_##name)); \
|
||||
void test_##name(skiatest::Reporter* reporter, const GrContextOptions&) { \
|
||||
/* SkDebugf("Disabled:"#name "\n"); */ \
|
||||
} \
|
||||
void disabled_##name(skiatest::Reporter* reporter, const GrContextOptions&)
|
||||
#endif
|
||||
|
||||
using namespace skia::text;
|
||||
|
||||
DEF_TEST(SkText_ShapedText_LTR, reporter) {
|
||||
UNIX_ONLY_TEST(SkText_ShapedText_LTR, reporter) {
|
||||
TrivialFontChain* fontChain = new TrivialFontChain("Roboto", 40.0f, SkFontStyle::Normal());
|
||||
if (fontChain->empty()) return;
|
||||
|
||||
@ -68,7 +57,7 @@ DEF_TEST(SkText_ShapedText_LTR, reporter) {
|
||||
REPORTER_ASSERT(reporter, logicalRuns[1].getTextRange() == TextRange(newLine, newLine + 1));
|
||||
}
|
||||
|
||||
DEF_TEST(SkText_ShapedText_RTL, reporter) {
|
||||
UNIX_ONLY_TEST(SkText_ShapedText_RTL, reporter) {
|
||||
sk_sp<TrivialFontChain> fontChain = sk_make_sp<TrivialFontChain>("Roboto", 40.0f, SkFontStyle::Normal());
|
||||
if (fontChain->empty()) return;
|
||||
|
||||
|
@ -35,17 +35,6 @@ struct GrContextOptions;
|
||||
#define TestCanvasWidth 1000
|
||||
#define TestCanvasHeight 600
|
||||
|
||||
#if !defined(SK_BUILD_FOR_UNIX)
|
||||
#undef DEF_TEST
|
||||
#define DEF_TEST(name, reporter) \
|
||||
static void test_##name(skiatest::Reporter* reporter, const GrContextOptions&); \
|
||||
skiatest::TestRegistry name##TestRegistry(skiatest::Test(#name, false, test_##name)); \
|
||||
void test_##name(skiatest::Reporter* reporter, const GrContextOptions&) { \
|
||||
/* SkDebugf("Disabled:"#name "\n"); */ \
|
||||
} \
|
||||
void disabled_##name(skiatest::Reporter* reporter, const GrContextOptions&)
|
||||
#endif
|
||||
|
||||
using namespace skia::text;
|
||||
|
||||
namespace {
|
||||
@ -62,7 +51,7 @@ namespace {
|
||||
}
|
||||
}
|
||||
|
||||
DEF_TEST(SkText_UnicodeText_Flags, reporter) {
|
||||
UNIX_ONLY_TEST(SkText_UnicodeText_Flags, reporter) {
|
||||
REPORTER_ASSERT(reporter, true);
|
||||
// 01234567890 1234567890
|
||||
std::u16string utf16(u"Hello word\nHello world");
|
||||
|
@ -36,16 +36,6 @@ struct GrContextOptions;
|
||||
#define TestCanvasWidth 1000
|
||||
#define TestCanvasHeight 600
|
||||
|
||||
#if !defined(SK_BUILD_FOR_UNIX)
|
||||
#undef DEF_TEST
|
||||
#define DEF_TEST(name, reporter) \
|
||||
static void test_##name(skiatest::Reporter* reporter, const GrContextOptions&); \
|
||||
skiatest::TestRegistry name##TestRegistry(skiatest::Test(#name, false, test_##name)); \
|
||||
void test_##name(skiatest::Reporter* reporter, const GrContextOptions&) { \
|
||||
/* SkDebugf("Disabled:"#name "\n"); */ \
|
||||
} \
|
||||
void disabled_##name(skiatest::Reporter* reporter, const GrContextOptions&)
|
||||
#endif
|
||||
using namespace skia::text;
|
||||
|
||||
struct TestLine {
|
||||
@ -100,7 +90,7 @@ public:
|
||||
};
|
||||
|
||||
|
||||
DEF_TEST(SkText_WrappedText_Spaces, reporter) {
|
||||
UNIX_ONLY_TEST(SkText_WrappedText_Spaces, reporter) {
|
||||
sk_sp<TrivialFontChain> fontChain = sk_make_sp<TrivialFontChain>("Roboto", 40.0f, SkFontStyle::Normal());
|
||||
if (fontChain->empty()) return;
|
||||
|
||||
|
@ -327,6 +327,8 @@ metal_tests_sources = [
|
||||
|
||||
graphite_tests_sources = [
|
||||
"$_tests/graphite/CapsTest.cpp",
|
||||
"$_tests/graphite/MaskTest.cpp",
|
||||
"$_tests/graphite/RectTest.cpp",
|
||||
"$_tests/graphite/ShapeTest.cpp",
|
||||
]
|
||||
|
||||
@ -394,10 +396,6 @@ pathops_tests_sources = [
|
||||
"$_tests/PathOpsTightBoundsTest.cpp",
|
||||
"$_tests/PathOpsTypesTest.cpp",
|
||||
"$_tests/WangsFormulaTest.cpp",
|
||||
|
||||
# graphite
|
||||
"$_tests/graphite/MaskTest.cpp",
|
||||
"$_tests/graphite/RectTest.cpp",
|
||||
]
|
||||
|
||||
skgpu_v1_tests_sources = [
|
||||
|
@ -49,12 +49,6 @@ struct GrContextOptions;
|
||||
#define TestCanvasWidth 1000
|
||||
#define TestCanvasHeight 600
|
||||
|
||||
#define DEF_TEST_DISABLED(name, reporter) \
|
||||
static void test_##name(skiatest::Reporter* reporter, const GrContextOptions&); \
|
||||
skiatest::TestRegistry name##TestRegistry(skiatest::Test(#name, false, test_##name)); \
|
||||
void test_##name(skiatest::Reporter* reporter, const GrContextOptions&) { /* SkDebugf("Disabled:"#name "\n"); */ } \
|
||||
void disabled_##name(skiatest::Reporter* reporter, const GrContextOptions&)
|
||||
|
||||
using namespace skia::textlayout;
|
||||
namespace {
|
||||
|
||||
@ -201,7 +195,7 @@ private:
|
||||
|
||||
} // namespace
|
||||
|
||||
DEF_TEST(SkParagraph_SimpleParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_SimpleParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
const char* text = "Hello World Text Dialog";
|
||||
@ -239,7 +233,7 @@ DEF_TEST(SkParagraph_SimpleParagraph, reporter) {
|
||||
}
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_InlinePlaceholderParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_InlinePlaceholderParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
TestCanvas canvas("SkParagraph_InlinePlaceholderParagraph.png");
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
@ -338,7 +332,7 @@ DEF_TEST(SkParagraph_InlinePlaceholderParagraph, reporter) {
|
||||
REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[6].rect.bottom(), 50, EPSILON100));
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_InlinePlaceholderBaselineParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_InlinePlaceholderBaselineParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
TestCanvas canvas("SkParagraph_InlinePlaceholderBaselineParagraph.png");
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
@ -394,7 +388,7 @@ DEF_TEST(SkParagraph_InlinePlaceholderBaselineParagraph, reporter) {
|
||||
REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 44.694f, EPSILON100));
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_InlinePlaceholderAboveBaselineParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_InlinePlaceholderAboveBaselineParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
TestCanvas canvas("SkParagraph_InlinePlaceholderAboveBaselineParagraph.png");
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
@ -450,7 +444,7 @@ DEF_TEST(SkParagraph_InlinePlaceholderAboveBaselineParagraph, reporter) {
|
||||
REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 56, EPSILON100));
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_InlinePlaceholderBelowBaselineParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_InlinePlaceholderBelowBaselineParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
TestCanvas canvas("SkParagraph_InlinePlaceholderBelowBaselineParagraph.png");
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
@ -506,7 +500,7 @@ DEF_TEST(SkParagraph_InlinePlaceholderBelowBaselineParagraph, reporter) {
|
||||
REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 30.347f, EPSILON100));
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_InlinePlaceholderBottomParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_InlinePlaceholderBottomParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
TestCanvas canvas("SkParagraph_InlinePlaceholderBottomParagraph.png");
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
@ -560,7 +554,7 @@ DEF_TEST(SkParagraph_InlinePlaceholderBottomParagraph, reporter) {
|
||||
REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 50, EPSILON100));
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_InlinePlaceholderTopParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_InlinePlaceholderTopParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
TestCanvas canvas("SkParagraph_InlinePlaceholderTopParagraph.png");
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
@ -614,7 +608,7 @@ DEF_TEST(SkParagraph_InlinePlaceholderTopParagraph, reporter) {
|
||||
REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 30.468f, EPSILON100));
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_InlinePlaceholderMiddleParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_InlinePlaceholderMiddleParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
TestCanvas canvas("SkParagraph_InlinePlaceholderMiddleParagraph.png");
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
@ -668,7 +662,7 @@ DEF_TEST(SkParagraph_InlinePlaceholderMiddleParagraph, reporter) {
|
||||
REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 40.234f, EPSILON100));
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_InlinePlaceholderIdeographicBaselineParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_InlinePlaceholderIdeographicBaselineParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
TestCanvas canvas("SkParagraph_InlinePlaceholderIdeographicBaselineParagraph.png");
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
@ -721,7 +715,7 @@ DEF_TEST(SkParagraph_InlinePlaceholderIdeographicBaselineParagraph, reporter) {
|
||||
REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 42.065f, EPSILON100));
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_InlinePlaceholderBreakParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_InlinePlaceholderBreakParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
TestCanvas canvas("SkParagraph_InlinePlaceholderBreakParagraph.png");
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
@ -856,7 +850,7 @@ DEF_TEST(SkParagraph_InlinePlaceholderBreakParagraph, reporter) {
|
||||
REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[17].rect.bottom(), 113.5f, EPSILON100));
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_InlinePlaceholderGetRectsParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_InlinePlaceholderGetRectsParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
TestCanvas canvas("SkParagraph_InlinePlaceholderGetRectsParagraph.png");
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
@ -984,7 +978,7 @@ DEF_TEST(SkParagraph_InlinePlaceholderGetRectsParagraph, reporter) {
|
||||
REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[2].rect.bottom(), 120, EPSILON100));
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_SimpleRedParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_SimpleRedParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
const char* text = "I am RED";
|
||||
@ -1023,7 +1017,7 @@ DEF_TEST(SkParagraph_SimpleRedParagraph, reporter) {
|
||||
}
|
||||
|
||||
// Checked: DIFF+ (Space between 1 & 2 style blocks)
|
||||
DEF_TEST(SkParagraph_RainbowParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_RainbowParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
TestCanvas canvas("SkParagraph_RainbowParagraph.png");
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
@ -1146,7 +1140,7 @@ DEF_TEST(SkParagraph_RainbowParagraph, reporter) {
|
||||
REPORTER_ASSERT(reporter, index == 5);
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_DefaultStyleParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_DefaultStyleParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_DefaultStyleParagraph.png");
|
||||
@ -1185,7 +1179,7 @@ DEF_TEST(SkParagraph_DefaultStyleParagraph, reporter) {
|
||||
REPORTER_ASSERT(reporter, index == 1);
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_BoldParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_BoldParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_BoldParagraph.png");
|
||||
@ -1231,7 +1225,7 @@ DEF_TEST(SkParagraph_BoldParagraph, reporter) {
|
||||
REPORTER_ASSERT(reporter, index == 1);
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_HeightOverrideParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_HeightOverrideParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_HeightOverrideParagraph.png");
|
||||
@ -1286,7 +1280,7 @@ DEF_TEST(SkParagraph_HeightOverrideParagraph, reporter) {
|
||||
REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[1].rect.bottom(), 165.495f, EPSILON5));
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_BasicHalfLeading, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_BasicHalfLeading, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
|
||||
if (!fontCollection->fontsFound()) {
|
||||
@ -1347,7 +1341,7 @@ DEF_TEST(SkParagraph_BasicHalfLeading, reporter) {
|
||||
REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[1].rect.right(), 43.843f, EPSILON100));
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_NearZeroHeightMixedDistribution, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_NearZeroHeightMixedDistribution, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
|
||||
if (!fontCollection->fontsFound()) {
|
||||
@ -1440,7 +1434,7 @@ DEF_TEST(SkParagraph_NearZeroHeightMixedDistribution, reporter) {
|
||||
REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 0, EPSILON100));
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_StrutHalfLeading, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_StrutHalfLeading, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
|
||||
if (!fontCollection->fontsFound()) {
|
||||
@ -1507,7 +1501,7 @@ DEF_TEST(SkParagraph_StrutHalfLeading, reporter) {
|
||||
REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[1].rect.left(), 0, EPSILON100));
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_TrimLeadingDistribution, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_TrimLeadingDistribution, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
|
||||
if (!fontCollection->fontsFound()) {
|
||||
@ -1573,7 +1567,7 @@ DEF_TEST(SkParagraph_TrimLeadingDistribution, reporter) {
|
||||
REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[1].rect.right(), 43.843f, EPSILON100));
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_LeftAlignParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_LeftAlignParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_LeftAlignParagraph.png");
|
||||
@ -1657,7 +1651,7 @@ DEF_TEST(SkParagraph_LeftAlignParagraph, reporter) {
|
||||
REPORTER_ASSERT(reporter, impl->getGlyphPositionAtCoordinate(2000, 35).position == 134);
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_RightAlignParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_RightAlignParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_RightAlignParagraph.png");
|
||||
@ -1744,7 +1738,7 @@ DEF_TEST(SkParagraph_RightAlignParagraph, reporter) {
|
||||
paragraph_style.getTextAlign() == impl->paragraphStyle().getTextAlign());
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_CenterAlignParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_CenterAlignParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_CenterAlignParagraph.png");
|
||||
@ -1831,7 +1825,7 @@ DEF_TEST(SkParagraph_CenterAlignParagraph, reporter) {
|
||||
paragraph_style.getTextAlign() == impl->paragraphStyle().getTextAlign());
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_JustifyAlignParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_JustifyAlignParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_JustifyAlignParagraph.png");
|
||||
@ -1919,7 +1913,7 @@ DEF_TEST(SkParagraph_JustifyAlignParagraph, reporter) {
|
||||
}
|
||||
|
||||
// Checked: DIFF (ghost spaces as a separate box in TxtLib)
|
||||
DEF_TEST(SkParagraph_JustifyRTL, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_JustifyRTL, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>(true);
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_JustifyRTL.png");
|
||||
@ -1983,7 +1977,7 @@ DEF_TEST(SkParagraph_JustifyRTL, reporter) {
|
||||
REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 156, EPSILON100));
|
||||
}
|
||||
|
||||
DEF_TEST_DISABLED(SkParagraph_JustifyRTLNewLine, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_JustifyRTLNewLine, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>(true);
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_JustifyRTLNewLine.png");
|
||||
@ -2052,7 +2046,7 @@ DEF_TEST_DISABLED(SkParagraph_JustifyRTLNewLine, reporter) {
|
||||
}
|
||||
}
|
||||
|
||||
DEF_TEST_DISABLED(SkParagraph_LeadingSpaceRTL, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_LeadingSpaceRTL, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>(true);
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_LeadingSpaceRTL.png");
|
||||
@ -2095,7 +2089,7 @@ DEF_TEST_DISABLED(SkParagraph_LeadingSpaceRTL, reporter) {
|
||||
REPORTER_ASSERT(reporter, boxes.size() == 2ull);
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_DecorationsParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_DecorationsParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_DecorationsParagraph.png");
|
||||
@ -2216,7 +2210,7 @@ DEF_TEST(SkParagraph_DecorationsParagraph, reporter) {
|
||||
|
||||
// TODO: Add test for wavy decorations.
|
||||
|
||||
DEF_TEST(SkParagraph_ItalicsParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_ItalicsParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_ItalicsParagraph.png");
|
||||
@ -2280,7 +2274,7 @@ DEF_TEST(SkParagraph_ItalicsParagraph, reporter) {
|
||||
});
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_ChineseParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_ChineseParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_ChineseParagraph.png");
|
||||
@ -2329,7 +2323,7 @@ DEF_TEST(SkParagraph_ChineseParagraph, reporter) {
|
||||
}
|
||||
|
||||
// Checked: disabled for TxtLib
|
||||
DEF_TEST(SkParagraph_ArabicParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_ArabicParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_ArabicParagraph.png");
|
||||
@ -2374,7 +2368,7 @@ DEF_TEST(SkParagraph_ArabicParagraph, reporter) {
|
||||
}
|
||||
|
||||
// Checked: DIFF (2 boxes and each space is a word)
|
||||
DEF_TEST(SkParagraph_ArabicRectsParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_ArabicRectsParagraph, reporter) {
|
||||
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
@ -2425,7 +2419,7 @@ DEF_TEST(SkParagraph_ArabicRectsParagraph, reporter) {
|
||||
// This test shows now 2 boxes for [36:40) range:
|
||||
// [36:38) for arabic text and [38:39) for the last space
|
||||
// that has default paragraph direction (LTR) and is placed at the end of the paragraph
|
||||
DEF_TEST(SkParagraph_ArabicRectsLTRLeftAlignParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_ArabicRectsLTRLeftAlignParagraph, reporter) {
|
||||
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
@ -2473,7 +2467,7 @@ DEF_TEST(SkParagraph_ArabicRectsLTRLeftAlignParagraph, reporter) {
|
||||
}
|
||||
|
||||
// Checked DIFF+
|
||||
DEF_TEST(SkParagraph_ArabicRectsLTRRightAlignParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_ArabicRectsLTRRightAlignParagraph, reporter) {
|
||||
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
@ -2520,7 +2514,7 @@ DEF_TEST(SkParagraph_ArabicRectsLTRRightAlignParagraph, reporter) {
|
||||
REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 44, EPSILON100));
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_GetGlyphPositionAtCoordinateParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_GetGlyphPositionAtCoordinateParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_GetGlyphPositionAtCoordinateParagraph.png");
|
||||
@ -2584,7 +2578,7 @@ DEF_TEST(SkParagraph_GetGlyphPositionAtCoordinateParagraph, reporter) {
|
||||
REPORTER_ASSERT(reporter, paragraph->getGlyphPositionAtCoordinate(85, 10000).position == 75);
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_GetRectsForRangeParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_GetRectsForRangeParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_GetRectsForRangeParagraph.png");
|
||||
@ -2680,7 +2674,7 @@ DEF_TEST(SkParagraph_GetRectsForRangeParagraph, reporter) {
|
||||
}
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_GetRectsForRangeTight, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_GetRectsForRangeTight, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_GetRectsForRangeTight.png");
|
||||
@ -2752,7 +2746,7 @@ DEF_TEST(SkParagraph_GetRectsForRangeTight, reporter) {
|
||||
}
|
||||
|
||||
// Checked: DIFF+
|
||||
DEF_TEST(SkParagraph_GetRectsForRangeIncludeLineSpacingMiddle, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_GetRectsForRangeIncludeLineSpacingMiddle, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_GetRectsForRangeIncludeLineSpacingMiddle.png");
|
||||
@ -2874,7 +2868,7 @@ DEF_TEST(SkParagraph_GetRectsForRangeIncludeLineSpacingMiddle, reporter) {
|
||||
}
|
||||
|
||||
// Checked: NO DIFF+
|
||||
DEF_TEST(SkParagraph_GetRectsForRangeIncludeLineSpacingTop, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_GetRectsForRangeIncludeLineSpacingTop, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_GetRectsForRangeIncludeLineSpacingTop.png");
|
||||
@ -2996,7 +2990,7 @@ DEF_TEST(SkParagraph_GetRectsForRangeIncludeLineSpacingTop, reporter) {
|
||||
}
|
||||
|
||||
// Checked: NO DIFF+
|
||||
DEF_TEST(SkParagraph_GetRectsForRangeIncludeLineSpacingBottom, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_GetRectsForRangeIncludeLineSpacingBottom, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_GetRectsForRangeIncludeLineSpacingBottom.png");
|
||||
@ -3119,7 +3113,7 @@ DEF_TEST(SkParagraph_GetRectsForRangeIncludeLineSpacingBottom, reporter) {
|
||||
|
||||
// This is the test I cannot accommodate
|
||||
// Any text range gets a smallest glyph rectangle
|
||||
DEF_TEST_DISABLED(SkParagraph_GetRectsForRangeIncludeCombiningCharacter, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_GetRectsForRangeIncludeCombiningCharacter, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_GetRectsForRangeIncludeCombiningCharacter.png");
|
||||
@ -3182,7 +3176,7 @@ DEF_TEST_DISABLED(SkParagraph_GetRectsForRangeIncludeCombiningCharacter, reporte
|
||||
}
|
||||
|
||||
// Checked: NO DIFF
|
||||
DEF_TEST(SkParagraph_GetRectsForRangeCenterParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_GetRectsForRangeCenterParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_GetRectsForRangeCenterParagraph.png");
|
||||
@ -3280,7 +3274,7 @@ DEF_TEST(SkParagraph_GetRectsForRangeCenterParagraph, reporter) {
|
||||
}
|
||||
|
||||
// Checked DIFF+
|
||||
DEF_TEST(SkParagraph_GetRectsForRangeCenterParagraphNewlineCentered, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_GetRectsForRangeCenterParagraphNewlineCentered, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_GetRectsForRangeCenterParagraphNewlineCentered.png");
|
||||
@ -3342,7 +3336,7 @@ DEF_TEST(SkParagraph_GetRectsForRangeCenterParagraphNewlineCentered, reporter) {
|
||||
}
|
||||
|
||||
// Checked NO DIFF
|
||||
DEF_TEST(SkParagraph_GetRectsForRangeCenterMultiLineParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_GetRectsForRangeCenterMultiLineParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_GetRectsForRangeCenterMultiLineParagraph.png");
|
||||
@ -3444,7 +3438,7 @@ DEF_TEST(SkParagraph_GetRectsForRangeCenterMultiLineParagraph, reporter) {
|
||||
}
|
||||
|
||||
// Checked: DIFF (line height rounding error)
|
||||
DEF_TEST(SkParagraph_GetRectsForRangeStrut, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_GetRectsForRangeStrut, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_GetRectsForRangeStrut.png");
|
||||
@ -3491,7 +3485,7 @@ DEF_TEST(SkParagraph_GetRectsForRangeStrut, reporter) {
|
||||
}
|
||||
|
||||
// Checked: NO DIFF
|
||||
DEF_TEST(SkParagraph_GetRectsForRangeStrutFallback, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_GetRectsForRangeStrutFallback, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_GetRectsForRangeStrutFallback.png");
|
||||
@ -3531,7 +3525,7 @@ DEF_TEST(SkParagraph_GetRectsForRangeStrutFallback, reporter) {
|
||||
}
|
||||
|
||||
// Checked: DIFF (small in numbers)
|
||||
DEF_TEST(SkParagraph_GetWordBoundaryParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_GetWordBoundaryParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_GetWordBoundaryParagraph.png");
|
||||
@ -3607,7 +3601,7 @@ DEF_TEST(SkParagraph_GetWordBoundaryParagraph, reporter) {
|
||||
}
|
||||
|
||||
// Checked: DIFF (unclear)
|
||||
DEF_TEST(SkParagraph_SpacingParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_SpacingParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_SpacingParagraph.png");
|
||||
@ -3690,7 +3684,7 @@ DEF_TEST(SkParagraph_SpacingParagraph, reporter) {
|
||||
}
|
||||
|
||||
// Checked: NO DIFF
|
||||
DEF_TEST(SkParagraph_LongWordParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_LongWordParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_LongWordParagraph.png");
|
||||
@ -3733,7 +3727,7 @@ DEF_TEST(SkParagraph_LongWordParagraph, reporter) {
|
||||
}
|
||||
|
||||
// Checked: DIFF?
|
||||
DEF_TEST(SkParagraph_KernScaleParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_KernScaleParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_KernScaleParagraph.png");
|
||||
@ -3779,7 +3773,7 @@ DEF_TEST(SkParagraph_KernScaleParagraph, reporter) {
|
||||
}
|
||||
|
||||
// Checked: DIFF+
|
||||
DEF_TEST(SkParagraph_NewlineParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_NewlineParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_NewlineParagraph.png");
|
||||
@ -3820,7 +3814,7 @@ DEF_TEST(SkParagraph_NewlineParagraph, reporter) {
|
||||
}
|
||||
|
||||
// TODO: Fix underline
|
||||
DEF_TEST(SkParagraph_EmojiParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_EmojiParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_EmojiParagraph.png");
|
||||
@ -3864,7 +3858,7 @@ DEF_TEST(SkParagraph_EmojiParagraph, reporter) {
|
||||
}
|
||||
|
||||
// Checked: DIFF+
|
||||
DEF_TEST(SkParagraph_EmojiMultiLineRectsParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_EmojiMultiLineRectsParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_EmojiMultiLineRectsParagraph.png");
|
||||
@ -3925,7 +3919,7 @@ DEF_TEST(SkParagraph_EmojiMultiLineRectsParagraph, reporter) {
|
||||
}
|
||||
|
||||
// Checked: DIFF (line breaking)
|
||||
DEF_TEST(SkParagraph_RepeatLayoutParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_RepeatLayoutParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_RepeatLayoutParagraph.png");
|
||||
@ -3965,7 +3959,7 @@ DEF_TEST(SkParagraph_RepeatLayoutParagraph, reporter) {
|
||||
}
|
||||
|
||||
// Checked: NO DIFF
|
||||
DEF_TEST(SkParagraph_Ellipsize, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_Ellipsize, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_Ellipsize.png");
|
||||
@ -4005,7 +3999,7 @@ DEF_TEST(SkParagraph_Ellipsize, reporter) {
|
||||
}
|
||||
|
||||
// Checked: NO DIFF
|
||||
DEF_TEST(SkParagraph_UnderlineShiftParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_UnderlineShiftParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_UnderlineShiftParagraph.png");
|
||||
@ -4074,7 +4068,7 @@ DEF_TEST(SkParagraph_UnderlineShiftParagraph, reporter) {
|
||||
}
|
||||
|
||||
// Checked: NO DIFF
|
||||
DEF_TEST(SkParagraph_SimpleShadow, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_SimpleShadow, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_SimpleShadow.png");
|
||||
@ -4112,7 +4106,7 @@ DEF_TEST(SkParagraph_SimpleShadow, reporter) {
|
||||
}
|
||||
|
||||
// Checked: NO DIFF
|
||||
DEF_TEST(SkParagraph_ComplexShadow, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_ComplexShadow, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_ComplexShadow.png");
|
||||
@ -4182,7 +4176,7 @@ DEF_TEST(SkParagraph_ComplexShadow, reporter) {
|
||||
}
|
||||
|
||||
// Checked: NO DIFF
|
||||
DEF_TEST(SkParagraph_BaselineParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_BaselineParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_BaselineParagraph.png");
|
||||
@ -4229,7 +4223,7 @@ DEF_TEST(SkParagraph_BaselineParagraph, reporter) {
|
||||
}
|
||||
|
||||
// Checked: NO DIFF (number of runs only)
|
||||
DEF_TEST(SkParagraph_FontFallbackParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_FontFallbackParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_FontFallbackParagraph.png");
|
||||
@ -4319,7 +4313,7 @@ DEF_TEST(SkParagraph_FontFallbackParagraph, reporter) {
|
||||
}
|
||||
|
||||
// Checked: NO DIFF
|
||||
DEF_TEST(SkParagraph_StrutParagraph1, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_StrutParagraph1, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_StrutParagraph1.png");
|
||||
@ -4424,7 +4418,7 @@ DEF_TEST(SkParagraph_StrutParagraph1, reporter) {
|
||||
}
|
||||
|
||||
// Checked: NO DIFF
|
||||
DEF_TEST(SkParagraph_StrutParagraph2, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_StrutParagraph2, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_StrutParagraph2.png");
|
||||
@ -4531,7 +4525,7 @@ DEF_TEST(SkParagraph_StrutParagraph2, reporter) {
|
||||
}
|
||||
|
||||
// Checked: NO DIFF
|
||||
DEF_TEST(SkParagraph_StrutParagraph3, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_StrutParagraph3, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_StrutParagraph3.png");
|
||||
@ -4639,7 +4633,7 @@ DEF_TEST(SkParagraph_StrutParagraph3, reporter) {
|
||||
}
|
||||
|
||||
// Checked: NO DIFF
|
||||
DEF_TEST(SkParagraph_StrutForceParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_StrutForceParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_StrutForceParagraph.png");
|
||||
@ -4738,7 +4732,7 @@ DEF_TEST(SkParagraph_StrutForceParagraph, reporter) {
|
||||
}
|
||||
|
||||
// Checked: NO DIFF
|
||||
DEF_TEST(SkParagraph_StrutDefaultParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_StrutDefaultParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_StrutDefaultParagraph.png");
|
||||
@ -4801,7 +4795,7 @@ DEF_TEST(SkParagraph_StrutDefaultParagraph, reporter) {
|
||||
}
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_FontFeaturesParagraph, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_FontFeaturesParagraph, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_FontFeaturesParagraph.png");
|
||||
@ -4852,7 +4846,7 @@ DEF_TEST(SkParagraph_FontFeaturesParagraph, reporter) {
|
||||
}
|
||||
|
||||
// Not in Minikin
|
||||
DEF_TEST(SkParagraph_WhitespacesInMultipleFonts, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_WhitespacesInMultipleFonts, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
const char* text = "English English 字典 字典 😀😃😄 😀😃😄";
|
||||
@ -4884,7 +4878,7 @@ DEF_TEST(SkParagraph_WhitespacesInMultipleFonts, reporter) {
|
||||
}
|
||||
|
||||
// Disable until I sort out fonts
|
||||
DEF_TEST_DISABLED(SkParagraph_JSON1, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_JSON1, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
const char* text = "👨👩👧👦";
|
||||
@ -4923,7 +4917,7 @@ DEF_TEST_DISABLED(SkParagraph_JSON1, reporter) {
|
||||
}
|
||||
|
||||
// Disable until I sort out fonts
|
||||
DEF_TEST_DISABLED(SkParagraph_JSON2, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_JSON2, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
const char* text = "p〠q";
|
||||
@ -4966,7 +4960,7 @@ DEF_TEST_DISABLED(SkParagraph_JSON2, reporter) {
|
||||
REPORTER_ASSERT(reporter, cluster <= 2);
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_CacheText, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_CacheText, reporter) {
|
||||
ParagraphCache cache;
|
||||
cache.turnOn(true);
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
@ -5001,7 +4995,7 @@ DEF_TEST(SkParagraph_CacheText, reporter) {
|
||||
test("text3", 2, false);
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_CacheFonts, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_CacheFonts, reporter) {
|
||||
ParagraphCache cache;
|
||||
cache.turnOn(true);
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
@ -5041,7 +5035,7 @@ DEF_TEST(SkParagraph_CacheFonts, reporter) {
|
||||
test(2, false);
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_CacheFontRanges, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_CacheFontRanges, reporter) {
|
||||
ParagraphCache cache;
|
||||
cache.turnOn(true);
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
@ -5086,7 +5080,7 @@ DEF_TEST(SkParagraph_CacheFontRanges, reporter) {
|
||||
test("text", "", "Roboto", "Homemade Apple", 4, true);
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_CacheStyles, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_CacheStyles, reporter) {
|
||||
ParagraphCache cache;
|
||||
cache.turnOn(true);
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
@ -5126,7 +5120,7 @@ DEF_TEST(SkParagraph_CacheStyles, reporter) {
|
||||
test(2, false);
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_EmptyParagraphWithLineBreak, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_EmptyParagraphWithLineBreak, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
fontCollection->setDefaultFontManager(SkFontMgr::RefDefault());
|
||||
@ -5152,7 +5146,7 @@ DEF_TEST(SkParagraph_EmptyParagraphWithLineBreak, reporter) {
|
||||
REPORTER_ASSERT(reporter, rect.size() == 1 && rect[0].rect.width() == 0);
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_NullInMiddleOfText, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_NullInMiddleOfText, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
fontCollection->setDefaultFontManager(SkFontMgr::RefDefault());
|
||||
@ -5172,7 +5166,7 @@ DEF_TEST(SkParagraph_NullInMiddleOfText, reporter) {
|
||||
paragraph->paint(canvas.get(), 0, 0);
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_PlaceholderOnly, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_PlaceholderOnly, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_PlaceholderOnly.png");
|
||||
@ -5189,7 +5183,7 @@ DEF_TEST(SkParagraph_PlaceholderOnly, reporter) {
|
||||
paragraph->paint(canvas.get(), 0, 0);
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_Fallbacks, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_Fallbacks, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
fontCollection->setDefaultFontManager(SkFontMgr::RefDefault(), "Arial");
|
||||
@ -5232,7 +5226,7 @@ DEF_TEST(SkParagraph_Fallbacks, reporter) {
|
||||
}
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_Bidi1, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_Bidi1, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
fontCollection->setDefaultFontManager(SkFontMgr::RefDefault());
|
||||
@ -5284,7 +5278,7 @@ DEF_TEST(SkParagraph_Bidi1, reporter) {
|
||||
paragraph->paint(canvas.get(), 0, 0);
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_Bidi2, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_Bidi2, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
fontCollection->setDefaultFontManager(SkFontMgr::RefDefault());
|
||||
@ -5325,7 +5319,7 @@ DEF_TEST(SkParagraph_Bidi2, reporter) {
|
||||
}
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_NewlineOnly, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_NewlineOnly, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
fontCollection->setDefaultFontManager(SkFontMgr::RefDefault());
|
||||
@ -5346,7 +5340,7 @@ DEF_TEST(SkParagraph_NewlineOnly, reporter) {
|
||||
REPORTER_ASSERT(reporter, paragraph->getHeight() == 28);
|
||||
}
|
||||
|
||||
DEF_TEST_DISABLED(SkParagraph_FontResolutions, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_FontResolutions, reporter) {
|
||||
TestCanvas canvas("SkParagraph_FontResolutions.png");
|
||||
|
||||
sk_sp<TestFontCollection> fontCollection =
|
||||
@ -5403,7 +5397,7 @@ DEF_TEST_DISABLED(SkParagraph_FontResolutions, reporter) {
|
||||
paragraph->paint(canvas.get(), 100, 100);
|
||||
}
|
||||
|
||||
DEF_TEST_DISABLED(SkParagraph_FontStyle, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_FontStyle, reporter) {
|
||||
TestCanvas canvas("SkParagraph_FontStyle.png");
|
||||
|
||||
sk_sp<TestFontCollection> fontCollection = sk_make_sp<TestFontCollection>(GetResourcePath("fonts").c_str(), false, true);
|
||||
@ -5441,7 +5435,7 @@ DEF_TEST_DISABLED(SkParagraph_FontStyle, reporter) {
|
||||
paragraph->paint(canvas.get(), 0, 0);
|
||||
}
|
||||
|
||||
DEF_TEST_DISABLED(SkParagraph_Shaping, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_Shaping, reporter) {
|
||||
TestCanvas canvas("SkParagraph_Shaping.png");
|
||||
|
||||
auto dir = "/usr/local/google/home/jlavrova/Sources/flutter/engine/src/out/host_debug_unopt_x86/gen/flutter/third_party/txt/assets";
|
||||
@ -5469,7 +5463,7 @@ DEF_TEST_DISABLED(SkParagraph_Shaping, reporter) {
|
||||
paragraph->paint(canvas.get(), 0, 0);
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_Ellipsis, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_Ellipsis, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
fontCollection->setDefaultFontManager(SkFontMgr::RefDefault());
|
||||
@ -5530,7 +5524,7 @@ DEF_TEST(SkParagraph_Ellipsis, reporter) {
|
||||
relayout(std::numeric_limits<size_t>::max(), false, 50, 200, 90, 950, SK_ColorGREEN);
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_MemoryLeak, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_MemoryLeak, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
fontCollection->setDefaultFontManager(SkFontMgr::RefDefault());
|
||||
@ -5561,7 +5555,7 @@ DEF_TEST(SkParagraph_MemoryLeak, reporter) {
|
||||
}
|
||||
};
|
||||
|
||||
DEF_TEST(SkParagraph_FormattingInfinity, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_FormattingInfinity, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
fontCollection->setDefaultFontManager(SkFontMgr::RefDefault());
|
||||
@ -5595,7 +5589,7 @@ DEF_TEST(SkParagraph_FormattingInfinity, reporter) {
|
||||
draw("justify", TextAlign::kJustify);
|
||||
};
|
||||
|
||||
DEF_TEST(SkParagraph_Infinity, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_Infinity, reporter) {
|
||||
SkASSERT(nearlyEqual(1, SK_ScalarInfinity) == false);
|
||||
SkASSERT(nearlyEqual(1, SK_ScalarNegativeInfinity) == false);
|
||||
SkASSERT(nearlyEqual(1, SK_ScalarNaN) == false);
|
||||
@ -5613,7 +5607,7 @@ DEF_TEST(SkParagraph_Infinity, reporter) {
|
||||
SkASSERT(nearlyEqual(SK_ScalarNaN, SK_ScalarNaN) == false);
|
||||
};
|
||||
|
||||
DEF_TEST(SkParagraph_LineMetrics, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_LineMetrics, reporter) {
|
||||
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
@ -5693,7 +5687,7 @@ DEF_TEST(SkParagraph_LineMetrics, reporter) {
|
||||
}
|
||||
};
|
||||
|
||||
DEF_TEST(SkParagraph_PlaceholderHeightInf, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_PlaceholderHeightInf, reporter) {
|
||||
TestCanvas canvas("SkParagraph_PlaceholderHeightInf.png");
|
||||
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
@ -5726,7 +5720,7 @@ DEF_TEST(SkParagraph_PlaceholderHeightInf, reporter) {
|
||||
REPORTER_ASSERT(reporter, SkScalarIsFinite(impl->getPicture()->cullRect().width()));
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_LineMetricsTextAlign, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_LineMetricsTextAlign, reporter) {
|
||||
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
@ -5770,7 +5764,7 @@ DEF_TEST(SkParagraph_LineMetricsTextAlign, reporter) {
|
||||
REPORTER_ASSERT(reporter, width[3] > width[0]); // delta == 0
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_FontResolutionInRTL, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_FontResolutionInRTL, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>(true);
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_FontResolutionInRTL.png");
|
||||
@ -5800,7 +5794,7 @@ DEF_TEST(SkParagraph_FontResolutionInRTL, reporter) {
|
||||
REPORTER_ASSERT(reporter, impl->runs().size() == (10 + 11));
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_FontResolutionInLTR, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_FontResolutionInLTR, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>(true);
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
TestCanvas canvas("SkParagraph_FontResolutionInLTR.png");
|
||||
@ -5832,7 +5826,7 @@ DEF_TEST(SkParagraph_FontResolutionInLTR, reporter) {
|
||||
REPORTER_ASSERT(reporter, impl->runs()[4].textRange().width() == 4); // " def"
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_Intrinsic, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_Intrinsic, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
SkString text(std::string(3000, 'a'));
|
||||
@ -5853,7 +5847,7 @@ DEF_TEST(SkParagraph_Intrinsic, reporter) {
|
||||
REPORTER_ASSERT(reporter, paragraph->getMinIntrinsicWidth() <= paragraph->getMaxIntrinsicWidth());
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_NoCache1, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_NoCache1, reporter) {
|
||||
|
||||
ParagraphCache cache;
|
||||
cache.turnOn(true);
|
||||
@ -5919,7 +5913,7 @@ DEF_TEST(SkParagraph_NoCache1, reporter) {
|
||||
test("different strings", "0123456789 0123456789 0123456789 0123456789 0123456789", false);
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_HeightCalculations, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_HeightCalculations, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
|
||||
@ -5951,7 +5945,7 @@ DEF_TEST(SkParagraph_HeightCalculations, reporter) {
|
||||
draw(TextHeightBehavior::kDisableFirstAscent, "Hello", 28);
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_RTL_With_Styles, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_RTL_With_Styles, reporter) {
|
||||
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
@ -5991,7 +5985,7 @@ DEF_TEST(SkParagraph_RTL_With_Styles, reporter) {
|
||||
paragraph->paint(canvas.get(), 0, 0);
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_PositionInsideEmoji, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_PositionInsideEmoji, reporter) {
|
||||
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
@ -6046,7 +6040,7 @@ DEF_TEST(SkParagraph_PositionInsideEmoji, reporter) {
|
||||
}
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_SingleLineHeight1, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_SingleLineHeight1, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
|
||||
@ -6075,7 +6069,7 @@ DEF_TEST(SkParagraph_SingleLineHeight1, reporter) {
|
||||
paint("");
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_SingleLineHeight2, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_SingleLineHeight2, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
|
||||
@ -6103,7 +6097,7 @@ DEF_TEST(SkParagraph_SingleLineHeight2, reporter) {
|
||||
paint("");
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_PlaceholderWidth, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_PlaceholderWidth, reporter) {
|
||||
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
@ -6147,7 +6141,7 @@ DEF_TEST(SkParagraph_PlaceholderWidth, reporter) {
|
||||
REPORTER_ASSERT(reporter, SkScalarNearlyEqual(len2, 250.0f));
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_GlyphPositionsInEmptyLines, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_GlyphPositionsInEmptyLines, reporter) {
|
||||
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
@ -6179,7 +6173,7 @@ DEF_TEST(SkParagraph_GlyphPositionsInEmptyLines, reporter) {
|
||||
REPORTER_ASSERT(reporter, res3.position == 3 && res3.affinity == Affinity::kDownstream);
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_RTLGlyphPositions, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_RTLGlyphPositions, reporter) {
|
||||
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
@ -6222,7 +6216,7 @@ DEF_TEST(SkParagraph_RTLGlyphPositions, reporter) {
|
||||
// 500.0f, res2.position, res2.affinity == Affinity::kUpstream ? "U" : "D");
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_RTLGlyphPositionsInEmptyLines, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_RTLGlyphPositionsInEmptyLines, reporter) {
|
||||
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
@ -6253,7 +6247,7 @@ DEF_TEST(SkParagraph_RTLGlyphPositionsInEmptyLines, reporter) {
|
||||
REPORTER_ASSERT(reporter, res3.position == 10 && res3.affinity == Affinity::kUpstream);
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_LTRGlyphPositionsForTrailingSpaces, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_LTRGlyphPositionsForTrailingSpaces, reporter) {
|
||||
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
@ -6294,7 +6288,7 @@ DEF_TEST(SkParagraph_LTRGlyphPositionsForTrailingSpaces, reporter) {
|
||||
test("hello ");
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_RTLGlyphPositionsForTrailingSpaces, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_RTLGlyphPositionsForTrailingSpaces, reporter) {
|
||||
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
@ -6351,7 +6345,7 @@ DEF_TEST(SkParagraph_RTLGlyphPositionsForTrailingSpaces, reporter) {
|
||||
test(" hello", -10);
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_LTRLineMetricsDoesNotIncludeNewLine, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_LTRLineMetricsDoesNotIncludeNewLine, reporter) {
|
||||
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
@ -6393,7 +6387,7 @@ DEF_TEST(SkParagraph_LTRLineMetricsDoesNotIncludeNewLine, reporter) {
|
||||
}
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_RTLLineMetricsDoesNotIncludeNewLine, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_RTLLineMetricsDoesNotIncludeNewLine, reporter) {
|
||||
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
@ -6468,7 +6462,7 @@ DEF_TEST(SkParagraph_RTLLineMetricsDoesNotIncludeNewLine, reporter) {
|
||||
}
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_PlaceholderPosition, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_PlaceholderPosition, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
|
||||
@ -6500,7 +6494,7 @@ DEF_TEST(SkParagraph_PlaceholderPosition, reporter) {
|
||||
REPORTER_ASSERT(reporter, result.position == 4 && result.affinity == Affinity::kDownstream);
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_LineEnd, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_LineEnd, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
|
||||
@ -6538,7 +6532,7 @@ DEF_TEST(SkParagraph_LineEnd, reporter) {
|
||||
REPORTER_ASSERT(reporter, lm[3].fEndExcludingWhitespaces == 25 && lm[3].fEndIndex == 28 && lm[3].fEndIncludingNewline == 29);
|
||||
}
|
||||
|
||||
DEF_TEST(SkParagraph_Utf16Indexes, reporter) {
|
||||
UNIX_ONLY_TEST(SkParagraph_Utf16Indexes, reporter) {
|
||||
sk_sp<ResourceFontCollection> fontCollection = sk_make_sp<ResourceFontCollection>();
|
||||
if (!fontCollection->fontsFound()) return;
|
||||
|
||||
|
73
tests/Test.h
73
tests/Test.h
@ -71,10 +71,19 @@ typedef void (*TestProc)(skiatest::Reporter*, const GrContextOptions&);
|
||||
typedef void (*ContextOptionsProc)(GrContextOptions*);
|
||||
|
||||
struct Test {
|
||||
Test(const char* n, bool g, TestProc p, ContextOptionsProc optionsProc = nullptr)
|
||||
: name(n), needsGpu(g), proc(p), fContextOptionsProc(optionsProc) {}
|
||||
Test(const char* n,
|
||||
bool gpu,
|
||||
bool needsGraphite,
|
||||
TestProc p,
|
||||
ContextOptionsProc optionsProc = nullptr)
|
||||
: name(n)
|
||||
, needsGpu(gpu)
|
||||
, fNeedsGraphite(needsGraphite)
|
||||
, proc(p)
|
||||
, fContextOptionsProc(optionsProc) {}
|
||||
const char* name;
|
||||
bool needsGpu;
|
||||
bool fNeedsGraphite;
|
||||
TestProc proc;
|
||||
ContextOptionsProc fContextOptionsProc;
|
||||
|
||||
@ -183,34 +192,52 @@ static inline SkString reporter_string(const char* fmt, Args... args) {
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define DEF_TEST(name, reporter) \
|
||||
static void test_##name(skiatest::Reporter*, const GrContextOptions&); \
|
||||
skiatest::TestRegistry name##TestRegistry(skiatest::Test(#name, false, test_##name)); \
|
||||
#define DEF_TEST(name, reporter) \
|
||||
static void test_##name(skiatest::Reporter*, const GrContextOptions&); \
|
||||
skiatest::TestRegistry name##TestRegistry( \
|
||||
skiatest::Test(#name, /*gpu*/ false, /*graphite*/ false, test_##name)); \
|
||||
void test_##name(skiatest::Reporter* reporter, const GrContextOptions&)
|
||||
|
||||
#define DEF_GRAPHITE_TEST(name, reporter) \
|
||||
static void test_##name(skiatest::Reporter*); \
|
||||
static void test_graphite_##name(skiatest::Reporter* reporter, \
|
||||
const GrContextOptions& /*unused*/) { \
|
||||
test_##name(reporter); \
|
||||
} \
|
||||
skiatest::TestRegistry name##TestRegistry( \
|
||||
skiatest::Test(#name, true, test_graphite_##name)); \
|
||||
#define DEF_TEST_DISABLED(name, reporter) \
|
||||
static void test_##name(skiatest::Reporter*, const GrContextOptions&); \
|
||||
skiatest::TestRegistry name##TestRegistry( \
|
||||
skiatest::Test(#name, /*gpu*/ false, /*graphite*/ false, test_##name)); \
|
||||
void test_##name(skiatest::Reporter* reporter, const GrContextOptions&) { \
|
||||
/* SkDebugf("Disabled:"#name "\n"); */ \
|
||||
} \
|
||||
void disabled_##name(skiatest::Reporter* reporter, const GrContextOptions&)
|
||||
|
||||
#ifdef SK_BUILD_FOR_UNIX
|
||||
#define UNIX_ONLY_TEST DEF_TEST
|
||||
#else
|
||||
#define UNIX_ONLY_TEST DEF_TEST_DISABLED
|
||||
#endif
|
||||
|
||||
#define DEF_GRAPHITE_TEST(name, reporter) \
|
||||
static void test_##name(skiatest::Reporter*); \
|
||||
static void test_graphite_##name(skiatest::Reporter* reporter, \
|
||||
const GrContextOptions& /*unused*/) { \
|
||||
test_##name(reporter); \
|
||||
} \
|
||||
skiatest::TestRegistry name##TestRegistry( \
|
||||
skiatest::Test(#name, /*gpu*/ false, /*graphite*/ true, test_graphite_##name)); \
|
||||
void test_##name(skiatest::Reporter* reporter)
|
||||
|
||||
#define DEF_GRAPHITE_TEST_FOR_CONTEXTS(name, reporter, graphite_context) \
|
||||
static void test_##name(skiatest::Reporter*, skgpu::Context*); \
|
||||
static void test_graphite_contexts_##name(skiatest::Reporter* _reporter, \
|
||||
const GrContextOptions& /*unused*/) { \
|
||||
skiatest::graphite::RunWithGraphiteTestContexts(test_##name, _reporter); \
|
||||
} \
|
||||
skiatest::TestRegistry name##TestRegistry( \
|
||||
skiatest::Test(#name, true, test_graphite_contexts_##name)); \
|
||||
#define DEF_GRAPHITE_TEST_FOR_CONTEXTS(name, reporter, graphite_context) \
|
||||
static void test_##name(skiatest::Reporter*, skgpu::Context*); \
|
||||
static void test_graphite_contexts_##name(skiatest::Reporter* _reporter, \
|
||||
const GrContextOptions& /*unused*/) { \
|
||||
skiatest::graphite::RunWithGraphiteTestContexts(test_##name, _reporter); \
|
||||
} \
|
||||
skiatest::TestRegistry name##TestRegistry( \
|
||||
skiatest::Test(#name, /*gpu*/ false, /*graphite*/ true, \
|
||||
test_graphite_contexts_##name)); \
|
||||
void test_##name(skiatest::Reporter* reporter, skgpu::Context* graphite_context)
|
||||
|
||||
#define DEF_GPUTEST(name, reporter, options) \
|
||||
static void test_##name(skiatest::Reporter*, const GrContextOptions&); \
|
||||
skiatest::TestRegistry name##TestRegistry(skiatest::Test(#name, true, test_##name)); \
|
||||
skiatest::TestRegistry name##TestRegistry( \
|
||||
skiatest::Test(#name, /*gpu*/ true, /*graphite*/ false, test_##name)); \
|
||||
void test_##name(skiatest::Reporter* reporter, const GrContextOptions& options)
|
||||
|
||||
#define DEF_GPUTEST_FOR_CONTEXTS(name, context_filter, reporter, context_info, options_filter) \
|
||||
@ -220,7 +247,7 @@ static inline SkString reporter_string(const char* fmt, Args... args) {
|
||||
skiatest::RunWithGPUTestContexts(test_##name, context_filter, reporter, options); \
|
||||
} \
|
||||
skiatest::TestRegistry name##TestRegistry( \
|
||||
skiatest::Test(#name, true, test_gpu_contexts_##name, options_filter)); \
|
||||
skiatest::Test(#name, /*gpu*/ true, /*graphite*/ false, test_gpu_contexts_##name, options_filter)); \
|
||||
void test_##name(skiatest::Reporter* reporter, const sk_gpu_test::ContextInfo& context_info)
|
||||
|
||||
#define DEF_GPUTEST_FOR_ALL_CONTEXTS(name, reporter, context_info) \
|
||||
|
@ -19,7 +19,7 @@ SKGPU_MAKE_MASK_OPS(Flags);
|
||||
|
||||
using namespace skgpu;
|
||||
|
||||
DEF_TEST(skgpu_Mask, r) {
|
||||
DEF_GRAPHITE_TEST(skgpu_Mask, r) {
|
||||
Mask<Flags> flags = Flags::kNone;
|
||||
REPORTER_ASSERT(r, !flags);
|
||||
flags |= Flags::kA;
|
||||
|
@ -12,7 +12,7 @@ namespace skgpu {
|
||||
|
||||
#define CHECK(A) REPORTER_ASSERT(reporter, A)
|
||||
|
||||
DEF_TEST(skgpu_Rect, reporter) {
|
||||
DEF_GRAPHITE_TEST(skgpu_Rect, reporter) {
|
||||
const SkRect skRect = SkRect::MakeLTRB(1,-3,4,0);
|
||||
const Rect rect = skRect;
|
||||
CHECK(rect == rect);
|
||||
|
@ -33,6 +33,7 @@ static DEFINE_bool2(verbose, v, false, "enable verbose output from the test driv
|
||||
static DEFINE_bool2(veryVerbose, V, false, "tell individual tests to be verbose.");
|
||||
static DEFINE_bool(cpu, true, "Run CPU-bound work?");
|
||||
static DEFINE_bool(gpu, true, "Run GPU-bound work?");
|
||||
static DEFINE_bool(graphite, true, "Run Graphite work?");
|
||||
|
||||
static DEFINE_string2(match, m, nullptr,
|
||||
"[~][^]substring[$] [...] of name to run.\n"
|
||||
@ -129,16 +130,19 @@ private:
|
||||
Status* fStatus;
|
||||
};
|
||||
|
||||
static bool should_run(const char* testName, bool isGPUTest) {
|
||||
static bool should_run(const char* testName, bool isGPUTest, bool isGraphiteTest) {
|
||||
if (CommandLineFlags::ShouldSkip(FLAGS_match, testName)) {
|
||||
return false;
|
||||
}
|
||||
if (!FLAGS_cpu && !isGPUTest) {
|
||||
if (!FLAGS_cpu && !isGPUTest && !isGraphiteTest) {
|
||||
return false;
|
||||
}
|
||||
if (!FLAGS_gpu && isGPUTest) {
|
||||
return false;
|
||||
}
|
||||
if (!FLAGS_graphite && isGraphiteTest) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -221,7 +225,7 @@ int main(int argc, char** argv) {
|
||||
int toRun = 0;
|
||||
|
||||
for (const Test& test : TestRegistry::Range()) {
|
||||
if (should_run(test.name, test.needsGpu)) {
|
||||
if (should_run(test.name, test.needsGpu, test.fNeedsGraphite)) {
|
||||
toRun++;
|
||||
}
|
||||
total++;
|
||||
@ -237,9 +241,9 @@ int main(int argc, char** argv) {
|
||||
Status status(toRun);
|
||||
|
||||
for (const Test& test : TestRegistry::Range()) {
|
||||
if (!should_run(test.name, test.needsGpu)) {
|
||||
if (!should_run(test.name, test.needsGpu, test.fNeedsGraphite)) {
|
||||
++skipCount;
|
||||
} else if (test.needsGpu) {
|
||||
} else if (test.needsGpu || test.fNeedsGraphite) {
|
||||
gpuTests.push_back(&test);
|
||||
} else {
|
||||
cpuTests.add(SkTestRunnable(test, &status));
|
||||
|
@ -131,9 +131,14 @@ static const struct {
|
||||
#endif
|
||||
|
||||
#ifdef SK_GRAPHITE_ENABLED
|
||||
{ "grgl", "gpu", "api=gl,useGraphite=true" },
|
||||
#ifdef SK_DIRECT3D
|
||||
{ "grd3d", "graphite", "api=direct3d" },
|
||||
#endif
|
||||
#ifdef SK_METAL
|
||||
{ "grmtl", "gpu", "api=metal,useGraphite=true" },
|
||||
{ "grmtl", "graphite", "api=metal" },
|
||||
#endif
|
||||
#ifdef SK_VULKAN
|
||||
{ "grvk", "graphite", "api=vulkan" },
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -447,6 +452,37 @@ public:
|
||||
return parse_option_gpu_api(*optionValue, outContextType, outFakeGLESVersion2);
|
||||
}
|
||||
|
||||
#ifdef SK_GRAPHITE_ENABLED
|
||||
bool get_option_graphite_api(const char* optionKey,
|
||||
SkCommandLineConfigGraphite::ContextType* outContextType) const {
|
||||
using ContextType = skiatest::graphite::ContextFactory::ContextType;
|
||||
|
||||
SkString* optionValue = fOptionsMap.find(SkString(optionKey));
|
||||
if (optionValue == nullptr) {
|
||||
return false;
|
||||
}
|
||||
#ifdef SK_VULKAN
|
||||
if (optionValue->equals("vulkan")) {
|
||||
*outContextType = ContextType::kVulkan;
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
#ifdef SK_METAL
|
||||
if (optionValue->equals("metal")) {
|
||||
*outContextType = ContextType::kMetal;
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
#ifdef SK_DIRECT3D
|
||||
if (optionValue->equals("direct3d")) {
|
||||
*outContextType = ContextType::kDirect3D;
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool get_option_gpu_surf_type(const char* optionKey,
|
||||
SkCommandLineConfigGpu::SurfType* outSurfType,
|
||||
bool optional = true) const {
|
||||
@ -492,7 +528,6 @@ SkCommandLineConfigGpu::SkCommandLineConfigGpu(const SkString& tag,
|
||||
bool useDDLSink,
|
||||
bool OOPRish,
|
||||
bool reducedShaders,
|
||||
bool useGraphite,
|
||||
SurfType surfType)
|
||||
: SkCommandLineConfig(tag, SkString("gpu"), viaParts)
|
||||
, fContextType(contextType)
|
||||
@ -507,7 +542,6 @@ SkCommandLineConfigGpu::SkCommandLineConfigGpu(const SkString& tag,
|
||||
, fUseDDLSink(useDDLSink)
|
||||
, fOOPRish(OOPRish)
|
||||
, fReducedShaders(reducedShaders)
|
||||
, fUseGraphite(useGraphite)
|
||||
, fSurfType(surfType) {
|
||||
if (!useStencilBuffers) {
|
||||
fContextOverrides |= ContextOverrides::kAvoidStencilBuffers;
|
||||
@ -538,7 +572,6 @@ SkCommandLineConfigGpu* parse_command_line_config_gpu(const SkString&
|
||||
bool ooprish = false;
|
||||
bool reducedShaders = false;
|
||||
bool fakeGLESVersion2 = false;
|
||||
bool useGraphite = false;
|
||||
SkCommandLineConfigGpu::SurfType surfType = SkCommandLineConfigGpu::SurfType::kDefault;
|
||||
|
||||
bool parseSucceeded = false;
|
||||
@ -560,7 +593,6 @@ SkCommandLineConfigGpu* parse_command_line_config_gpu(const SkString&
|
||||
extendedOptions.get_option_bool("useDDLSink", &useDDLs) &&
|
||||
extendedOptions.get_option_bool("OOPRish", &ooprish) &&
|
||||
extendedOptions.get_option_bool("reducedShaders", &reducedShaders) &&
|
||||
extendedOptions.get_option_bool("useGraphite", &useGraphite) &&
|
||||
extendedOptions.get_option_gpu_surf_type("surf", &surfType);
|
||||
|
||||
// testing threading and the persistent cache are mutually exclusive.
|
||||
@ -591,10 +623,44 @@ SkCommandLineConfigGpu* parse_command_line_config_gpu(const SkString&
|
||||
useDDLs,
|
||||
ooprish,
|
||||
reducedShaders,
|
||||
useGraphite,
|
||||
surfType);
|
||||
}
|
||||
|
||||
#ifdef SK_GRAPHITE_ENABLED
|
||||
|
||||
SkCommandLineConfigGraphite* parse_command_line_config_graphite(const SkString& tag,
|
||||
const SkTArray<SkString>& vias,
|
||||
const SkString& options) {
|
||||
using ContextType = skiatest::graphite::ContextFactory::ContextType;
|
||||
|
||||
ContextType contextType = ContextType::kMetal;
|
||||
SkColorType colorType = kRGBA_8888_SkColorType;
|
||||
SkAlphaType alphaType = kPremul_SkAlphaType;
|
||||
bool testPrecompile = false;
|
||||
|
||||
bool parseSucceeded = false;
|
||||
ExtendedOptions extendedOptions(options, &parseSucceeded);
|
||||
if (!parseSucceeded) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool validOptions = extendedOptions.get_option_graphite_api("api", &contextType) &&
|
||||
extendedOptions.get_option_gpu_color("color", &colorType, &alphaType) &&
|
||||
extendedOptions.get_option_bool("testPrecompile", &testPrecompile);
|
||||
if (!validOptions) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return new SkCommandLineConfigGraphite(tag,
|
||||
vias,
|
||||
contextType,
|
||||
colorType,
|
||||
alphaType,
|
||||
testPrecompile);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
SkCommandLineConfigSvg::SkCommandLineConfigSvg(const SkString& tag,
|
||||
const SkTArray<SkString>& viaParts,
|
||||
int pageIndex)
|
||||
@ -668,6 +734,11 @@ void ParseConfigs(const CommandLineFlags::StringArray& configs,
|
||||
if (extendedBackend.equals("gpu")) {
|
||||
parsedConfig = parse_command_line_config_gpu(tag, vias, extendedOptions);
|
||||
}
|
||||
#ifdef SK_GRAPHITE_ENABLED
|
||||
if (extendedBackend.equals("graphite")) {
|
||||
parsedConfig = parse_command_line_config_graphite(tag, vias, extendedOptions);
|
||||
}
|
||||
#endif
|
||||
if (extendedBackend.equals("svg")) {
|
||||
parsedConfig = parse_command_line_config_svg(tag, vias, extendedOptions);
|
||||
}
|
||||
|
@ -14,6 +14,7 @@
|
||||
DECLARE_string(config);
|
||||
|
||||
class SkCommandLineConfigGpu;
|
||||
class SkCommandLineConfigGraphite;
|
||||
class SkCommandLineConfigSvg;
|
||||
|
||||
// SkCommandLineConfig represents a Skia rendering configuration string.
|
||||
@ -29,6 +30,7 @@ public:
|
||||
const SkTArray<SkString>& viaParts);
|
||||
virtual ~SkCommandLineConfig();
|
||||
virtual const SkCommandLineConfigGpu* asConfigGpu() const { return nullptr; }
|
||||
virtual const SkCommandLineConfigGraphite* asConfigGraphite() const { return nullptr; }
|
||||
virtual const SkCommandLineConfigSvg* asConfigSvg() const { return nullptr; }
|
||||
const SkString& getTag() const { return fTag; }
|
||||
const SkString& getBackend() const { return fBackend; }
|
||||
@ -68,7 +70,6 @@ public:
|
||||
bool useDDLSink,
|
||||
bool OOPRish,
|
||||
bool reducedShaders,
|
||||
bool useGraphite,
|
||||
SurfType);
|
||||
|
||||
const SkCommandLineConfigGpu* asConfigGpu() const override { return this; }
|
||||
@ -84,7 +85,6 @@ public:
|
||||
bool getUseDDLSink() const { return fUseDDLSink; }
|
||||
bool getOOPRish() const { return fOOPRish; }
|
||||
bool getReducedShaders() const { return fReducedShaders; }
|
||||
bool getUseGraphite() const { return fUseGraphite; }
|
||||
SurfType getSurfType() const { return fSurfType; }
|
||||
|
||||
private:
|
||||
@ -100,10 +100,45 @@ private:
|
||||
bool fUseDDLSink;
|
||||
bool fOOPRish;
|
||||
bool fReducedShaders;
|
||||
bool fUseGraphite;
|
||||
SurfType fSurfType;
|
||||
};
|
||||
|
||||
#ifdef SK_GRAPHITE_ENABLED
|
||||
|
||||
#include "tools/graphite/ContextFactory.h"
|
||||
|
||||
class SkCommandLineConfigGraphite : public SkCommandLineConfig {
|
||||
public:
|
||||
using ContextType = skiatest::graphite::ContextFactory::ContextType;
|
||||
|
||||
SkCommandLineConfigGraphite(const SkString& tag,
|
||||
const SkTArray<SkString>& viaParts,
|
||||
ContextType contextType,
|
||||
SkColorType colorType,
|
||||
SkAlphaType alphaType,
|
||||
bool testPrecompile)
|
||||
: SkCommandLineConfig(tag, SkString("graphite"), viaParts)
|
||||
, fContextType(contextType)
|
||||
, fColorType(colorType)
|
||||
, fAlphaType(alphaType)
|
||||
, fTestPrecompile(testPrecompile) {
|
||||
}
|
||||
const SkCommandLineConfigGraphite* asConfigGraphite() const override { return this; }
|
||||
|
||||
ContextType getContextType() const { return fContextType; }
|
||||
SkColorType getColorType() const { return fColorType; }
|
||||
SkAlphaType getAlphaType() const { return fAlphaType; }
|
||||
bool getTestPrecompile() const { return fTestPrecompile; }
|
||||
|
||||
private:
|
||||
ContextType fContextType;
|
||||
SkColorType fColorType;
|
||||
SkAlphaType fAlphaType;
|
||||
bool fTestPrecompile;
|
||||
};
|
||||
|
||||
#endif // SK_GRAPHITE_ENABLED
|
||||
|
||||
// SkCommandLineConfigSvg is a SkCommandLineConfig that extracts information out of the backend
|
||||
// part of the tag. It is constructed tags that have:
|
||||
// * backends of form "svg[option=value,option2=value,...]"
|
||||
|
@ -417,7 +417,7 @@ int main(int argc, char** argv) {
|
||||
|
||||
SkTHashMap<SkString, const skiatest::Test*> tests;
|
||||
for (const skiatest::Test& test : skiatest::TestRegistry::Range()) {
|
||||
if (test.needsGpu) {
|
||||
if (test.needsGpu || test.fNeedsGraphite) {
|
||||
continue; // TODO
|
||||
}
|
||||
if (FLAGS_listTests) {
|
||||
|
@ -15,7 +15,24 @@
|
||||
|
||||
namespace skiatest::graphite {
|
||||
|
||||
std::tuple<GraphiteTestContext*, sk_sp<skgpu::Context>> ContextFactory::getContextInfo(
|
||||
ContextFactory::ContextInfo::ContextInfo(ContextInfo&& other)
|
||||
: fType(other.fType)
|
||||
, fTestContext(std::move(other.fTestContext))
|
||||
, fContext(std::move(other.fContext)) {
|
||||
}
|
||||
|
||||
ContextFactory::ContextInfo::ContextInfo(ContextFactory::ContextType type,
|
||||
std::unique_ptr<GraphiteTestContext> testContext,
|
||||
sk_sp<skgpu::Context> context)
|
||||
: fType(type)
|
||||
, fTestContext(std::move(testContext))
|
||||
, fContext(std::move(context)) {
|
||||
}
|
||||
|
||||
sk_sp<skgpu::Context> ContextFactory::ContextInfo::refContext() const { return fContext; }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
std::tuple<GraphiteTestContext*, sk_sp<skgpu::Context>> ContextFactory::getContextInfo(
|
||||
ContextType type) {
|
||||
|
||||
for (ContextInfo& c : fContexts) {
|
||||
|
@ -22,25 +22,22 @@ namespace skiatest::graphite {
|
||||
class ContextFactory {
|
||||
public:
|
||||
enum class ContextType {
|
||||
kDirect3D,
|
||||
kMetal,
|
||||
kVulkan,
|
||||
kMock,
|
||||
};
|
||||
|
||||
class ContextInfo {
|
||||
public:
|
||||
ContextInfo() = default;
|
||||
ContextInfo(ContextInfo&& other)
|
||||
: fType(other.fType)
|
||||
, fTestContext(std::move(other.fTestContext))
|
||||
, fContext(std::move(other.fContext)) {
|
||||
}
|
||||
|
||||
ContextInfo(ContextInfo&& other);
|
||||
~ContextInfo() = default;
|
||||
|
||||
ContextFactory::ContextType type() const { return fType; }
|
||||
|
||||
skgpu::Context* context() const { return fContext.get(); }
|
||||
sk_sp<skgpu::Context> refContext() const { return fContext; }
|
||||
sk_sp<skgpu::Context> refContext() const;
|
||||
GraphiteTestContext* testContext() const { return fTestContext.get(); }
|
||||
|
||||
private:
|
||||
@ -48,11 +45,7 @@ public:
|
||||
|
||||
ContextInfo(ContextFactory::ContextType type,
|
||||
std::unique_ptr<GraphiteTestContext> testContext,
|
||||
sk_sp<skgpu::Context> context)
|
||||
: fType(type)
|
||||
, fTestContext(std::move(testContext))
|
||||
, fContext(std::move(context)) {
|
||||
}
|
||||
sk_sp<skgpu::Context> context);
|
||||
|
||||
ContextType fType = ContextType::kMock;
|
||||
std::unique_ptr<GraphiteTestContext> fTestContext;
|
||||
|
Loading…
Reference in New Issue
Block a user