Remove preparePath from the SkStrikeInterface

This call is only used by the bitmap drawing. Just use SkStrike
for bitmap drawing.

Change-Id: Ib9313b21bb2f9c7de2b8ac084d905538ba45f51b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/224576
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This commit is contained in:
Herb Derby 2019-06-28 16:08:35 -04:00 committed by Skia Commit-Bot
parent ab013ebe9c
commit 1ddee02522
6 changed files with 3 additions and 29 deletions

View File

@ -149,7 +149,7 @@ void SkGlyphRunListPainter::drawForBitmapDevice(
SkStrikeSpec strikeSpec = SkStrikeSpec::MakePath(
runFont, runPaint, props, fScalerContextFlags);
SkScopedStrike strike = strikeSpec.findOrCreateScopedStrike(fStrikeCache);
auto strike = strikeSpec.findOrCreateExclusiveStrike();
auto glyphPosSpan = strike->prepareForDrawing(
glyphRun.glyphsIDs().data(),
@ -193,7 +193,7 @@ void SkGlyphRunListPainter::drawForBitmapDevice(
SkStrikeSpec strikeSpec = SkStrikeSpec::MakeMask(
runFont, runPaint, props, fScalerContextFlags, deviceMatrix);
SkScopedStrike strike = strikeSpec.findOrCreateScopedStrike(fStrikeCache);
auto strike = strikeSpec.findOrCreateExclusiveStrike();
// Add rounding and origin.
SkMatrix matrix = deviceMatrix;

View File

@ -523,24 +523,6 @@ SkVector SkStrikeServer::SkGlyphCacheState::rounding() const {
return SkStrikeCommon::PixelRounding(fIsSubpixel, fAxisAlignmentForHText);
}
// Because the strike calls between the Renderer and the GPU are mirror images of each other, the
// information needed to make the call in the Renderer needs to be sent to the GPU so it can also
// make the call. If there is a path then it should be sent, and the path is queued to be sent and
// true returned. Otherwise, false is returned signaling an empty glyph.
//
// A key reason for no path is the fact that the glyph is a color image or is a bitmap only
// font.
const SkPath* SkStrikeServer::SkGlyphCacheState::preparePath(SkGlyph* glyph) {
// Check to see if we have processed this glyph for a path before.
if (glyph->setPath(&fAlloc, fContext.get())) {
// A path was added make sure to send it to the GPU.
fCachedGlyphPaths.add(glyph->getPackedID());
fPendingGlyphPaths.push_back(glyph->getPackedID());
}
return glyph->path();
}
void SkStrikeServer::SkGlyphCacheState::writeGlyphPath(const SkPackedGlyphID& glyphID,
Serializer* serializer) const {
SkPath path;

View File

@ -44,8 +44,6 @@ public:
PreparationDetail detail,
SkGlyphPos results[]) override;
const SkPath* preparePath(SkGlyph* glyph) override;
void onAboutToExitScope() override {}
private:

View File

@ -60,7 +60,7 @@ public:
SkGlyph* mergeGlyphAndImage(SkPackedGlyphID toID, const SkGlyph& from);
// If the path has never been set, then use the scaler context to add the glyph.
const SkPath* preparePath(SkGlyph*) override;
const SkPath* preparePath(SkGlyph*);
// If the path has never been set, then add a path to glyph.
const SkPath* preparePath(SkGlyph* glyph, const SkPath* path);

View File

@ -42,10 +42,6 @@ public:
glyphIDs, positions, n, maxDimension, detail, results);
}
const SkPath* preparePath(SkGlyph* glyph) override {
return fStrike.preparePath(glyph);
}
const SkDescriptor& getDescriptor() const override {
return fStrike.getDescriptor();
}

View File

@ -70,8 +70,6 @@ public:
PreparationDetail detail,
SkGlyphPos results[]) = 0;
// If glyph does not have an existing path, then add a path to glyph using a scaler context.
virtual const SkPath* preparePath(SkGlyph* glyph) = 0;
virtual void onAboutToExitScope() = 0;
struct Deleter {