Naive CPU large emoji
This CL uses the GPU prepare path code to calculate reject which are color. What is missing is a system for scaling glyphs to the screen from the cache. Or a way to draw glyphs directly with no cache. Change-Id: Id5072c3cbffb91bad06ad840549c2711f5063c5c Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255980 Auto-Submit: Herb Derby <herb@google.com> Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
This commit is contained in:
parent
0ee397aa82
commit
42ea8e6619
@ -97,6 +97,8 @@ void SkGlyphRunListPainter::drawForBitmapDevice(
|
||||
for (auto& glyphRun : glyphRunList) {
|
||||
const SkFont& runFont = glyphRun.font();
|
||||
|
||||
fRejects.setSource(glyphRun.source());
|
||||
|
||||
if (SkStrikeSpec::ShouldDrawAsPath(runPaint, runFont, deviceMatrix)) {
|
||||
|
||||
SkStrikeSpec strikeSpec = SkStrikeSpec::MakePath(
|
||||
@ -104,8 +106,9 @@ void SkGlyphRunListPainter::drawForBitmapDevice(
|
||||
|
||||
auto strike = strikeSpec.findOrCreateExclusiveStrike();
|
||||
|
||||
fDrawable.startSource(glyphRun.source(), origin);
|
||||
strike->prepareForDrawingPathsCPU(&fDrawable);
|
||||
fDrawable.startSource(fRejects.source(), origin);
|
||||
strike->prepareForPathDrawing(&fDrawable, &fRejects);
|
||||
fRejects.flipRejectsToSource();
|
||||
|
||||
// The paint we draw paths with must have the same anti-aliasing state as the runFont
|
||||
// allowing the paths to have the same edging as the glyph masks.
|
||||
@ -113,16 +116,21 @@ void SkGlyphRunListPainter::drawForBitmapDevice(
|
||||
pathPaint.setAntiAlias(runFont.hasSomeAntiAliasing());
|
||||
|
||||
bitmapDevice->paintPaths(&fDrawable, strikeSpec.strikeToSourceRatio(), pathPaint);
|
||||
} else {
|
||||
}
|
||||
|
||||
if (!fRejects.source().empty()) {
|
||||
SkStrikeSpec strikeSpec = SkStrikeSpec::MakeMask(
|
||||
runFont, runPaint, props, fScalerContextFlags, deviceMatrix);
|
||||
|
||||
auto strike = strikeSpec.findOrCreateExclusiveStrike();
|
||||
|
||||
fDrawable.startDevice(glyphRun.source(), origin, deviceMatrix, strike->roundingSpec());
|
||||
fDrawable.startDevice(fRejects.source(), origin, deviceMatrix, strike->roundingSpec());
|
||||
strike->prepareForDrawingMasksCPU(&fDrawable);
|
||||
bitmapDevice->paintMasks(&fDrawable, runPaint);
|
||||
}
|
||||
|
||||
// TODO: have the mask stage above reject the glyphs that are too big, and handle the
|
||||
// rejects in a more sophisticated stage.
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user