Removing ICU dependencies from skparagraph BUILD.gn file
(and from the sources, too)
Change-Id: I9d8ff51c91aad4b770b1f183c04734d31252b851
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313148
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
diff --git a/modules/skparagraph/samples/SampleParagraph.cpp b/modules/skparagraph/samples/SampleParagraph.cpp
index 71e879d..d9e895c 100644
--- a/modules/skparagraph/samples/SampleParagraph.cpp
+++ b/modules/skparagraph/samples/SampleParagraph.cpp
@@ -17,9 +17,9 @@
#include "modules/skparagraph/include/TypefaceFontProvider.h"
#include "modules/skparagraph/src/ParagraphBuilderImpl.h"
#include "modules/skparagraph/src/ParagraphImpl.h"
-#include "modules/skparagraph/src/ParagraphUtil.h"
#include "modules/skparagraph/src/TextLine.h"
#include "modules/skparagraph/utils/TestFontCollection.h"
+#include "modules/skshaper/src/SkUnicode.h"
#include "samplecode/Sample.h"
#include "src/core/SkOSFile.h"
#include "src/shaders/SkColorShader.h"
@@ -28,7 +28,6 @@
#include "tools/Resources.h"
#include "tools/flags/CommandLineFlags.h"
-
static DEFINE_bool(verboseParagraph, false, "paragraph samples very verbose.");
using namespace skia::textlayout;
@@ -746,14 +745,15 @@
builder.addText(text4);
builder.pop();
} else {
- if (this->isVerbose()) {
- SkString str = SkStringFromU16String(text);
- SkDebugf("Text: %s\n", str.c_str());
- }
builder.addText(text + expected);
}
auto paragraph = builder.Build();
+ auto impl = static_cast<ParagraphImpl*>(paragraph.get());
+ if (this->isVerbose()) {
+ SkDebugf("Text: >%s<\n", impl->text().data());
+ }
+
paragraph->layout(w - margin * 2);
paragraph->paint(canvas, margin, margin);
}
@@ -1608,15 +1608,14 @@
ParagraphBuilderImpl builder(paragraph_style, fontCollection);
builder.pushStyle(text_style);
auto utf16text = zalgo.zalgo("SkParagraph");
- if (this->isVerbose()) {
- SkString str = SkStringFromU16String(utf16text);
- SkDebugf("Text:>%s<\n", str.c_str());
- }
builder.addText(utf16text);
fParagraph = builder.Build();
}
auto impl = static_cast<ParagraphImpl*>(fParagraph.get());
+ if (this->isVerbose()) {
+ SkDebugf("Text:>%s<\n", impl->text().data());
+ }
impl->setState(InternalState::kUnknown);
fParagraph->layout(1000);
fParagraph->paint(canvas, 300, 200);