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 #if SK_SUPPORT_GPU
/** Experimental /** Experimental
*/ */
virtual sk_sp<GrSlug> doConvertBlobToSlug( virtual sk_sp<GrSlug> onConvertGlyphRunListToSlug(
const SkTextBlob& blob, SkPoint origin, const SkPaint& paint); const SkGlyphRunList& glyphRunList, const SkPaint& paint);
/** Experimental /** Experimental
*/ */

View File

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