Reland #3 "ICU API: only in SkParagraph, simplified."
This is the fix for google3 failure.
This reverts commit e36a4667237dd4672f68cd4cb411d41881cd4be2.
Reason for revert: Trying to fix google3 build brake
Original change's description:
> Revert "Reland "ICU API: only in SkParagraph, simplified (relanding reverted).""
>
> This reverts commit 16fbc2477205aa06efb03e9bdaa0e4a5e94ee865.
>
> Reason for revert: Checking to see if this is blocking the G3 roll
>
> Original change's description:
> > Reland "ICU API: only in SkParagraph, simplified (relanding reverted)."
> >
> > This reverts commit a30095d17c879f0af0bfa799b25c97bcacd0b4fc.
> >
> > Reason for revert: Fixing the build
> >
> > Original change's description:
> > > Revert "ICU API: only in SkParagraph, simplified (relanding reverted)."
> > >
> > > This reverts commit 7479eda3b6d2884c089b62d9fc489574716ab3b7.
> > >
> > > Reason for revert: Breaking build
> > >
> > > Original change's description:
> > > > ICU API: only in SkParagraph, simplified (relanding reverted).
> > > >
> > > > Reverted commit: https://skia-review.googlesource.com/c/skia/+/296128/
> > > >
> > > > Change-Id: Iaf793bff94a6060579c7d6176d477e598c047be6
> > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303261
> > > > Reviewed-by: Mike Reed <reed@google.com>
> > > > Commit-Queue: Julia Lavrova <jlavrova@google.com>
> > >
> > > TBR=reed@google.com,jlavrova@google.com
> > >
> > > Change-Id: Idd4c41e22aa59e24bdbd07f2fa5e9258c1bbb7a7
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303358
> > > Reviewed-by: Julia Lavrova <jlavrova@google.com>
> > > Commit-Queue: Julia Lavrova <jlavrova@google.com>
> >
> > TBR=reed@google.com,jlavrova@google.com
> >
> > Change-Id: Iea5da4535ea2e388e8e632e6c556b66c8781631a
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303377
> > Reviewed-by: Ben Wagner <bungeman@google.com>
> > Reviewed-by: Julia Lavrova <jlavrova@google.com>
> > Commit-Queue: Julia Lavrova <jlavrova@google.com>
>
> TBR=bungeman@google.com,reed@google.com,jlavrova@google.com
>
> Change-Id: I1edfecc56add670b251adf44892265088fd32c42
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304058
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
TBR=bungeman@google.com,robertphillips@google.com,reed@google.com,jlavrova@google.com
Change-Id: Ife73aa21539e870d69bda6b5892979646732d778
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304060
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/modules/skparagraph/src/ParagraphImpl.h b/modules/skparagraph/src/ParagraphImpl.h
index bda3d1f..c43233c 100644
--- a/modules/skparagraph/src/ParagraphImpl.h
+++ b/modules/skparagraph/src/ParagraphImpl.h
@@ -23,9 +23,9 @@
#include "modules/skparagraph/include/TextShadow.h"
#include "modules/skparagraph/include/TextStyle.h"
#include "modules/skparagraph/src/Run.h"
+#include "modules/skshaper/src/SkUnicode.h"
#include "src/core/SkSpan.h"
-#include <unicode/ubrk.h>
#include <memory>
#include <string>
#include <vector>
@@ -83,14 +83,14 @@
SkFont fFont;
TextIndex fTextStart;
};
-
+/*
struct BidiRegion {
BidiRegion(size_t start, size_t end, uint8_t dir)
: text(start, end), direction(dir) { }
TextRange text;
uint8_t direction;
};
-
+*/
class ParagraphImpl final : public Paragraph {
public:
@@ -186,8 +186,6 @@
void resolveStrut();
bool computeCodeUnitProperties();
- bool computeWords();
- bool getBidiRegions();
void buildClusterTable();
void spaceGlyphs();
@@ -219,6 +217,8 @@
bool codeUnitHasProperty(size_t index, CodeUnitFlags property) const { return (fCodeUnitProperties[index] & property) == property; }
+ SkUnicode* getICU() { return fICU.get(); }
+
private:
friend class ParagraphBuilder;
friend class ParagraphCacheKey;
@@ -250,7 +250,7 @@
SkTArray<CodeUnitFlags> fCodeUnitProperties;
SkTArray<size_t> fClustersIndexFromCodeUnit;
std::vector<size_t> fWords;
- SkTArray<BidiRegion> fBidiRegions;
+ std::vector<BidiRegion> fBidiRegions;
// These two arrays are used in measuring methods (getRectsForRange, getGlyphPositionAtCoordinate)
// They are filled lazily whenever they need and cached
SkTArray<TextIndex, true> fUTF8IndexForUTF16Index;
@@ -269,6 +269,8 @@
SkScalar fOldHeight;
SkScalar fMaxWidthWithTrailingSpaces;
SkRect fOrigin;
+
+ std::unique_ptr<SkUnicode> fICU;
};
} // namespace textlayout
} // namespace skia