Revert "Removing ICU dependencies from skparagraph BUILD.gn file"
This reverts commit f1711adb1a04595eba1e9984976bfb92d41d0035.
Reason for revert: Build break
Original change's description:
> 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>
TBR=bungeman@google.com,jlavrova@google.com
Change-Id: I1fce2436855e3e2a4cb7d1d7204b3ae49fd530e8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314540
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
diff --git a/modules/skparagraph/samples/SampleParagraph.cpp b/modules/skparagraph/samples/SampleParagraph.cpp
index d9e895c..71e879d 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,6 +28,7 @@
#include "tools/Resources.h"
#include "tools/flags/CommandLineFlags.h"
+
static DEFINE_bool(verboseParagraph, false, "paragraph samples very verbose.");
using namespace skia::textlayout;
@@ -745,15 +746,14 @@
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,14 +1608,15 @@
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);