Revert "Remove obsolete paint copy"
This reverts commit cb969c76e7
.
Reason for revert: asserts triggering in PDF
Original change's description:
> Remove obsolete paint copy
>
> All the backends use the glyph run natively now, and
> glyph runs never interpret these fields in paint.
>
> Change-Id: I1c6fde1202057391e3a3f9be65f1e8a851205df5
> Reviewed-on: https://skia-review.googlesource.com/158720
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Herb Derby <herb@google.com>
TBR=mtklein@google.com,herb@google.com
Change-Id: I8ffcf633ffc41d4dc193ddf2a28a223cdaef9929
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/159061
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This commit is contained in:
parent
412dd56589
commit
6719fcc43b
@ -28,7 +28,7 @@ static SkTypeface::Encoding convert_encoding(SkPaint::TextEncoding encoding) {
|
|||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
// -- SkGlyphRun -----------------------------------------------------------------------------------
|
// -- SkGlyphRun -----------------------------------------------------------------------------------
|
||||||
SkGlyphRun::SkGlyphRun(const SkPaint& runPaint,
|
SkGlyphRun::SkGlyphRun(SkPaint&& runPaint,
|
||||||
SkSpan<const uint16_t> denseIndices,
|
SkSpan<const uint16_t> denseIndices,
|
||||||
SkSpan<const SkPoint> positions,
|
SkSpan<const SkPoint> positions,
|
||||||
SkSpan<const SkGlyphID> glyphIDs,
|
SkSpan<const SkGlyphID> glyphIDs,
|
||||||
@ -41,7 +41,7 @@ SkGlyphRun::SkGlyphRun(const SkPaint& runPaint,
|
|||||||
, fUniqueGlyphIDs{uniqueGlyphIDs}
|
, fUniqueGlyphIDs{uniqueGlyphIDs}
|
||||||
, fText{text}
|
, fText{text}
|
||||||
, fClusters{clusters}
|
, fClusters{clusters}
|
||||||
, fRunPaint{runPaint} {}
|
, fRunPaint{std::move(runPaint)} {}
|
||||||
|
|
||||||
void SkGlyphRun::eachGlyphToGlyphRun(SkGlyphRun::PerGlyph perGlyph) {
|
void SkGlyphRun::eachGlyphToGlyphRun(SkGlyphRun::PerGlyph perGlyph) {
|
||||||
SkPaint paint{fRunPaint};
|
SkPaint paint{fRunPaint};
|
||||||
@ -371,8 +371,12 @@ void SkGlyphRunBuilder::makeGlyphRun(
|
|||||||
|
|
||||||
// Ignore empty runs.
|
// Ignore empty runs.
|
||||||
if (!glyphIDs.empty()) {
|
if (!glyphIDs.empty()) {
|
||||||
|
SkPaint glyphRunPaint{runPaint};
|
||||||
|
glyphRunPaint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
|
||||||
|
glyphRunPaint.setTextAlign(SkPaint::kLeft_Align);
|
||||||
|
|
||||||
fGlyphRunListStorage.emplace_back(
|
fGlyphRunListStorage.emplace_back(
|
||||||
runPaint,
|
std::move(glyphRunPaint),
|
||||||
uniqueGlyphIDIndices,
|
uniqueGlyphIDIndices,
|
||||||
positions,
|
positions,
|
||||||
glyphIDs,
|
glyphIDs,
|
||||||
|
@ -85,7 +85,7 @@ public:
|
|||||||
class SkGlyphRun {
|
class SkGlyphRun {
|
||||||
public:
|
public:
|
||||||
SkGlyphRun() = default;
|
SkGlyphRun() = default;
|
||||||
SkGlyphRun(const SkPaint& runPaint,
|
SkGlyphRun(SkPaint&& runPaint,
|
||||||
SkSpan<const uint16_t> denseIndices,
|
SkSpan<const uint16_t> denseIndices,
|
||||||
SkSpan<const SkPoint> positions,
|
SkSpan<const SkPoint> positions,
|
||||||
SkSpan<const SkGlyphID> glyphIDs,
|
SkSpan<const SkGlyphID> glyphIDs,
|
||||||
|
@ -31,6 +31,7 @@ SkClusterator::SkClusterator(const SkGlyphRun& run)
|
|||||||
, fGlyphCount(SkToU32(run.shuntGlyphsIDs().size()))
|
, fGlyphCount(SkToU32(run.shuntGlyphsIDs().size()))
|
||||||
, fTextByteLength(SkToU32(run.text().size()))
|
, fTextByteLength(SkToU32(run.text().size()))
|
||||||
{
|
{
|
||||||
|
SkASSERT(SkPaint::kGlyphID_TextEncoding == run.paint().getTextEncoding());
|
||||||
if (fClusters) {
|
if (fClusters) {
|
||||||
SkASSERT(fUtf8Text && fTextByteLength > 0 && fGlyphCount > 0);
|
SkASSERT(fUtf8Text && fTextByteLength > 0 && fGlyphCount > 0);
|
||||||
fReversedChars = is_reversed(fClusters, fGlyphCount);
|
fReversedChars = is_reversed(fClusters, fGlyphCount);
|
||||||
|
Loading…
Reference in New Issue
Block a user