divide the slug conversion calls at a better place

Change-Id: I1e7f7b01356582dcb507a2ef768c97df0e02c561
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/523999
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This commit is contained in:
Herb Derby 2022-03-23 16:03:44 -04:00 committed by SkCQ
parent 7183f29125
commit 396fa1cea1
2 changed files with 5 additions and 6 deletions

View File

@ -2271,8 +2271,8 @@ protected:
#if SK_SUPPORT_GPU
/** Experimental
*/
virtual sk_sp<GrSlug> doConvertBlobToSlug(
const SkTextBlob& blob, SkPoint origin, const SkPaint& paint);
virtual sk_sp<GrSlug> onConvertGlyphRunListToSlug(
const SkGlyphRunList& glyphRunList, const SkPaint& paint);
/** Experimental
*/

View File

@ -2332,13 +2332,12 @@ void SkCanvas::onDrawGlyphRunList(const SkGlyphRunList& glyphRunList, const SkPa
sk_sp<GrSlug> SkCanvas::convertBlobToSlug(
const SkTextBlob& blob, SkPoint origin, const SkPaint& paint) {
TRACE_EVENT0("skia", TRACE_FUNC);
return this->doConvertBlobToSlug(blob, origin, paint);
auto glyphRunList = fScratchGlyphRunBuilder->blobToGlyphRunList(blob, origin);
return this->onConvertGlyphRunListToSlug(glyphRunList, paint);
}
sk_sp<GrSlug>
SkCanvas::doConvertBlobToSlug(const SkTextBlob& blob, SkPoint origin, const SkPaint& paint) {
auto glyphRunList = fScratchGlyphRunBuilder->blobToGlyphRunList(blob, origin);
SkCanvas::onConvertGlyphRunListToSlug(const SkGlyphRunList& glyphRunList, const SkPaint& paint) {
SkRect bounds = glyphRunList.sourceBounds();
if (bounds.isEmpty() || !bounds.isFinite() || paint.nothingToDraw()) {
return nullptr;