Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit b30d481

Browse files
RusinoSkia Commit-Bot
authored andcommitted
Yet another build fix
Change-Id: I606689930c9d07dbba3e743d1137e7c3c54790d4 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/253736 Commit-Queue: Julia Lavrova <jlavrova@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
1 parent 6e4aad9 commit b30d481

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

tests/SkParagraphTest.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#include "tools/Resources.h"
1414
#include "tools/ToolUtils.h"
1515

16+
#include "third_party/icu/SkLoadICU.h"
17+
1618
#define VeryLongCanvasWidth 1000000
1719
#define TestCanvasWidth 1000
1820
#define TestCanvasHeight 600
@@ -48,6 +50,10 @@ class ResourceFontCollection : public FontCollection {
4850
std::vector<SkString> fonts;
4951
SkOSFile::Iter iter(fResourceDir.c_str());
5052

53+
if (!SkLoadICU()) {
54+
SkDebugf("ICU not loaded, skipping all the tests\n");
55+
return;
56+
}
5157
SkString path;
5258
while (iter.next(&path)) {
5359
if (path.endsWith("Roboto-Italic.ttf")) {
@@ -57,6 +63,7 @@ class ResourceFontCollection : public FontCollection {
5763
}
5864

5965
if (!fFontsFound) {
66+
SkDebugf("Fonts not found, skipping all the tests\n");
6067
return;
6168
}
6269
// Only register fonts if we have to
@@ -72,8 +79,6 @@ class ResourceFontCollection : public FontCollection {
7279
this->setAssetFontManager(std::move(fFontProvider));
7380
}
7481
this->disableFontFallback();
75-
76-
if (!fFontsFound) SkDebugf("Fonts not found, skipping all the tests\n");
7782
}
7883

7984
~ResourceFontCollection() = default;
@@ -4844,7 +4849,7 @@ DEF_TEST(SkParagraph_NewlineOnly, reporter) {
48444849
REPORTER_ASSERT(reporter, paragraph->getHeight() == 28);
48454850
}
48464851

4847-
DEF_TEST(SkParagraph_FontResolutions, reporter) {
4852+
DEF_TEST_DISABLED(SkParagraph_FontResolutions, reporter) {
48484853
TestCanvas canvas("SkParagraph_FontResolutions.png");
48494854

48504855
sk_sp<TestFontCollection> fontCollection =
@@ -4901,7 +4906,7 @@ DEF_TEST(SkParagraph_FontResolutions, reporter) {
49014906
paragraph->paint(canvas.get(), 100, 100);
49024907
}
49034908

4904-
DEF_TEST(SkParagraph_FontStyle, reporter) {
4909+
DEF_TEST_DISABLED(SkParagraph_FontStyle, reporter) {
49054910
TestCanvas canvas("SkParagraph_FontStyle.png");
49064911

49074912
sk_sp<TestFontCollection> fontCollection = sk_make_sp<TestFontCollection>(GetResourcePath("fonts").c_str(), false, true);
@@ -4939,13 +4944,9 @@ DEF_TEST(SkParagraph_FontStyle, reporter) {
49394944
paragraph->paint(canvas.get(), 0, 0);
49404945
}
49414946

4942-
DEF_TEST(SkParagraph_Shaping, reporter) {
4947+
DEF_TEST_DISABLED(SkParagraph_Shaping, reporter) {
49434948
TestCanvas canvas("SkParagraph_Shaping.png");
49444949

4945-
//sk_sp<FontCollection> fontCollection = sk_make_sp<FontCollection>();
4946-
//fontCollection->setDefaultFontManager(SkFontMgr::RefDefault());
4947-
//fontCollection->enableFontFallback();
4948-
49494950
auto dir = "/usr/local/google/home/jlavrova/Sources/flutter/engine/src/out/host_debug_unopt_x86/gen/flutter/third_party/txt/assets";
49504951
sk_sp<TestFontCollection> fontCollection =
49514952
sk_make_sp<TestFontCollection>(dir, /*GetResourcePath("fonts").c_str(), */ false);

0 commit comments

Comments
 (0)