aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkGlyphRun.cpp
diff options
context:
space:
mode:
authorGravatar Herb Derby <herb@google.com>2018-07-16 11:19:04 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-19 16:25:55 +0000
commitcddab25218c52327ee1c527d726e69aa89540917 (patch)
tree91a8bd583444bed7903bc51953c35e4b6f02c92b /src/core/SkGlyphRun.cpp
parent297c3c8e85bdb7ed79aaa6a596f52874d79e7a25 (diff)
Use SkGlyphRunListIterator in gpu
Instead of using the text blob through the stack start using the glyph run list. This CL is similar to a portion of https://skia-review.googlesource.com/c/skia/+/137224 which was reverted. Change-Id: I1f0619bd2d13523f9af1a68ab27fb26abd086add Reviewed-on: https://skia-review.googlesource.com/141543 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Jim Van Verth <jvanverth@google.com>
Diffstat (limited to 'src/core/SkGlyphRun.cpp')
-rw-r--r--src/core/SkGlyphRun.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/core/SkGlyphRun.cpp b/src/core/SkGlyphRun.cpp
index e587dc55c6..b0bc59e760 100644
--- a/src/core/SkGlyphRun.cpp
+++ b/src/core/SkGlyphRun.cpp
@@ -45,7 +45,7 @@ SkGlyphRun::SkGlyphRun(SkPaint&& runPaint,
SkSpan<const uint32_t> clusters)
: fUniqueGlyphIDIndices{denseIndices}
, fPositions{positions}
- , fTemporaryShuntGlyphIDs{glyphIDs}
+ , fGlyphIDs{glyphIDs}
, fUniqueGlyphIDs{uniqueGlyphIDs}
, fText{text}
, fClusters{clusters}
@@ -66,10 +66,10 @@ void SkGlyphRun::eachGlyphToGlyphRun(SkGlyphRun::PerGlyph perGlyph) {
SkSpan<const uint32_t>{}
};
- auto runSize = fTemporaryShuntGlyphIDs.size();
+ auto runSize = fGlyphIDs.size();
auto runPaint = run.mutablePaint();
for (size_t i = 0; i < runSize; i++) {
- glyphID = fTemporaryShuntGlyphIDs[i];
+ glyphID = fGlyphIDs[i];
point = fPositions[i];
perGlyph(&run, runPaint);
}
@@ -80,21 +80,21 @@ void SkGlyphRun::temporaryShuntToDrawPosText(SkBaseDevice* device, SkPoint origi
auto pos = (const SkScalar*) this->positions().data();
- if (!fTemporaryShuntGlyphIDs.empty()) {
+ if (!fGlyphIDs.empty()) {
device->drawPosText(
- fTemporaryShuntGlyphIDs.data(), fTemporaryShuntGlyphIDs.size() * sizeof(SkGlyphID),
+ fGlyphIDs.data(), fGlyphIDs.size() * sizeof(SkGlyphID),
pos, 2, origin, fRunPaint);
}
}
void SkGlyphRun::temporaryShuntToCallback(TemporaryShuntCallback callback) {
- auto bytes = (const char *)fTemporaryShuntGlyphIDs.data();
+ auto bytes = (const char *)fGlyphIDs.data();
auto pos = (const SkScalar*) this->positions().data();
- callback(fTemporaryShuntGlyphIDs.size(), bytes, pos);
+ callback(fGlyphIDs.size(), bytes, pos);
}
void SkGlyphRun::filloutGlyphsAndPositions(SkGlyphID* glyphIDs, SkPoint* positions) {
- memcpy(glyphIDs, fTemporaryShuntGlyphIDs.data(), fTemporaryShuntGlyphIDs.size_bytes());
+ memcpy(glyphIDs, fGlyphIDs.data(), fGlyphIDs.size_bytes());
memcpy(positions, fPositions.data(), fPositions.size_bytes());
}
@@ -111,7 +111,7 @@ SkGlyphRunList::SkGlyphRunList(
, fGlyphRuns{glyphRunList} { }
SkGlyphRunList::SkGlyphRunList(SkGlyphRun* glyphRun)
- : fOriginalPaint{nullptr}
+ : fOriginalPaint{&glyphRun->paint()}
, fOriginalTextBlob{nullptr}
, fOrigin{SkPoint::Make(0, 0)}
, fGlyphRuns{SkSpan<SkGlyphRun>{glyphRun, 1}} {}