From f18b1d88aa98f81d2c115a59d887265fea63f876 Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Fri, 27 Oct 2017 11:30:49 -0400 Subject: Add GrTextUtils::Target This abstracts the portion of GrRenderTargetContext that is used by GrAtlasTextContext and opens the door to creating alternative consumers of GrAtlasTextOps. Change-Id: Iaa48f93f4d7d49e231744d44427e9396c5d36fe7 Reviewed-on: https://skia-review.googlesource.com/64760 Reviewed-by: Jim Van Verth Commit-Queue: Brian Salomon --- src/gpu/text/GrStencilAndCoverTextContext.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/gpu/text/GrStencilAndCoverTextContext.cpp') diff --git a/src/gpu/text/GrStencilAndCoverTextContext.cpp b/src/gpu/text/GrStencilAndCoverTextContext.cpp index 4b8dd5188e..b072702105 100644 --- a/src/gpu/text/GrStencilAndCoverTextContext.cpp +++ b/src/gpu/text/GrStencilAndCoverTextContext.cpp @@ -83,8 +83,8 @@ void GrStencilAndCoverTextContext::drawText(GrContext* context, GrRenderTargetCo } return; } - fFallbackTextContext->drawText(context, rtc, clip, skPaint, viewMatrix, props, text, - byteLength, x, y, clipBounds); + fFallbackTextContext->drawText(context, rtc->textTarget(), clip, skPaint, viewMatrix, props, + text, byteLength, x, y, clipBounds); } void GrStencilAndCoverTextContext::drawPosText(GrContext* context, GrRenderTargetContext* rtc, @@ -105,8 +105,9 @@ void GrStencilAndCoverTextContext::drawPosText(GrContext* context, GrRenderTarge } return; } - fFallbackTextContext->drawPosText(context, rtc, clip, skPaint, viewMatrix, props, text, - byteLength, pos, scalarsPerPosition, offset, clipBounds); + fFallbackTextContext->drawPosText(context, rtc->textTarget(), clip, skPaint, viewMatrix, props, + text, byteLength, pos, scalarsPerPosition, offset, + clipBounds); } void GrStencilAndCoverTextContext::uncachedDrawTextBlob(GrContext* context, @@ -161,8 +162,8 @@ void GrStencilAndCoverTextContext::drawTextBlob(GrContext* context, GrRenderTarg } if (!this->internalCanDraw(skPaint)) { - fFallbackTextContext->drawTextBlob(context, rtc, clip, skPaint, viewMatrix, props, skBlob, - x, y, drawFilter, clipBounds); + fFallbackTextContext->drawTextBlob(context, rtc->textTarget(), clip, skPaint, viewMatrix, + props, skBlob, x, y, drawFilter, clipBounds); return; } @@ -598,9 +599,9 @@ void GrStencilAndCoverTextContext::TextRun::draw(GrContext* ctx, fallbackSkPaint.setStrokeWidth(fStyle.strokeRec().getWidth() * fTextRatio); } - fallbackTextContext->drawTextBlob(ctx, renderTargetContext, clip, fallbackSkPaint, - viewMatrix, props, fFallbackTextBlob.get(), x, y, nullptr, - clipBounds); + fallbackTextContext->drawTextBlob(ctx, renderTargetContext->textTarget(), clip, + fallbackSkPaint, viewMatrix, props, + fFallbackTextBlob.get(), x, y, nullptr, clipBounds); } } -- cgit v1.2.3