diff options
author | cdalton <cdalton@nvidia.com> | 2016-05-12 15:09:48 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-12 15:09:48 -0700 |
commit | 862cff30eaa16206d76d7de7594c9167375ca87e (patch) | |
tree | b8f177f4d401b8c0361141ce834eaa9898d7beb4 /src/gpu/text/GrStencilAndCoverTextContext.cpp | |
parent | 193d9cf8f2280cd4f8e509c6f3af6b47cea04935 (diff) |
Remove clip from GrPipelineBuilder
This eliminates a copy and will allow us to make the GrClip class
virutal.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1966903004
Review-Url: https://codereview.chromium.org/1966903004
Diffstat (limited to 'src/gpu/text/GrStencilAndCoverTextContext.cpp')
-rw-r--r-- | src/gpu/text/GrStencilAndCoverTextContext.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/gpu/text/GrStencilAndCoverTextContext.cpp b/src/gpu/text/GrStencilAndCoverTextContext.cpp index 8600582495..eb6abb39a8 100644 --- a/src/gpu/text/GrStencilAndCoverTextContext.cpp +++ b/src/gpu/text/GrStencilAndCoverTextContext.cpp @@ -82,9 +82,9 @@ void GrStencilAndCoverTextContext::drawText(GrContext* context, GrDrawContext* d } else if (this->canDraw(skPaint, viewMatrix)) { if (skPaint.getTextSize() > 0) { TextRun run(skPaint); - GrPipelineBuilder pipelineBuilder(paint, dc->accessRenderTarget(), clip); + GrPipelineBuilder pipelineBuilder(paint, dc->accessRenderTarget()); run.setText(text, byteLength, x, y); - run.draw(context, dc, &pipelineBuilder, paint.getColor(), viewMatrix, props, 0, 0, + run.draw(context, dc, &pipelineBuilder, clip, paint.getColor(), viewMatrix, props, 0, 0, clipBounds, fFallbackTextContext, skPaint); } return; @@ -117,9 +117,9 @@ void GrStencilAndCoverTextContext::drawPosText(GrContext* context, GrDrawContext } else if (this->canDraw(skPaint, viewMatrix)) { if (skPaint.getTextSize() > 0) { TextRun run(skPaint); - GrPipelineBuilder pipelineBuilder(paint, dc->accessRenderTarget(), clip); + GrPipelineBuilder pipelineBuilder(paint, dc->accessRenderTarget()); run.setPosText(text, byteLength, pos, scalarsPerPosition, offset); - run.draw(context, dc, &pipelineBuilder, paint.getColor(), viewMatrix, props, 0, 0, + run.draw(context, dc, &pipelineBuilder, clip, paint.getColor(), viewMatrix, props, 0, 0, clipBounds, fFallbackTextContext, skPaint); } return; @@ -225,11 +225,11 @@ void GrStencilAndCoverTextContext::drawTextBlob(GrContext* context, GrDrawContex } const TextBlob& blob = this->findOrCreateTextBlob(skBlob, skPaint); - GrPipelineBuilder pipelineBuilder(paint, dc->accessRenderTarget(), clip); + GrPipelineBuilder pipelineBuilder(paint, dc->accessRenderTarget()); TextBlob::Iter iter(blob); for (TextRun* run = iter.get(); run; run = iter.next()) { - run->draw(context, dc, &pipelineBuilder, paint.getColor(), viewMatrix, props, x, y, + run->draw(context, dc, &pipelineBuilder, clip, paint.getColor(), viewMatrix, props, x, y, clipBounds, fFallbackTextContext, skPaint); run->releaseGlyphCache(); } @@ -597,6 +597,7 @@ inline void GrStencilAndCoverTextContext::TextRun::appendGlyph(const SkGlyph& gl void GrStencilAndCoverTextContext::TextRun::draw(GrContext* ctx, GrDrawContext* dc, GrPipelineBuilder* pipelineBuilder, + const GrClip& clip, GrColor color, const SkMatrix& viewMatrix, const SkSurfaceProps& props, @@ -643,7 +644,7 @@ void GrStencilAndCoverTextContext::TextRun::draw(GrContext* ctx, GrPathRendering::kWinding_FillType, glyphs, fInstanceData, bounds)); - dc->drawBatch(pipelineBuilder, batch); + dc->drawBatch(pipelineBuilder, clip, batch); } if (fFallbackTextBlob) { @@ -653,9 +654,8 @@ void GrStencilAndCoverTextContext::TextRun::draw(GrContext* ctx, fallbackSkPaint.setStrokeWidth(fStyle.strokeRec().getWidth() * fTextRatio); } - fallbackTextContext->drawTextBlob(ctx, dc, pipelineBuilder->clip(), fallbackSkPaint, - viewMatrix, props, fFallbackTextBlob, x, y, nullptr, - clipBounds); + fallbackTextContext->drawTextBlob(ctx, dc, clip, fallbackSkPaint, viewMatrix, props, + fFallbackTextBlob, x, y, nullptr, clipBounds); } } |