Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1549)

Unified Diff: src/gpu/text/GrStencilAndCoverTextContext.cpp

Issue 2155983003: Push GrPipelineBuilder down to the drawBatch calls in the TextContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/text/GrStencilAndCoverTextContext.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/text/GrStencilAndCoverTextContext.cpp
diff --git a/src/gpu/text/GrStencilAndCoverTextContext.cpp b/src/gpu/text/GrStencilAndCoverTextContext.cpp
index aba854d5d9c3a94b214307eaa27e375b4acd8dfd..dd930255262942825f24cafb72b6c223a41292fd 100644
--- a/src/gpu/text/GrStencilAndCoverTextContext.cpp
+++ b/src/gpu/text/GrStencilAndCoverTextContext.cpp
@@ -82,9 +82,8 @@ void GrStencilAndCoverTextContext::drawText(GrContext* context, GrDrawContext* d
} else if (this->canDraw(skPaint, viewMatrix)) {
if (skPaint.getTextSize() > 0) {
TextRun run(skPaint);
- GrPipelineBuilder pipelineBuilder(paint);
run.setText(text, byteLength, x, y);
- run.draw(context, dc, &pipelineBuilder, clip, paint.getColor(), viewMatrix, props, 0, 0,
+ run.draw(context, dc, paint, clip, paint.getColor(), viewMatrix, props, 0, 0,
clipBounds, fFallbackTextContext, skPaint);
}
return;
@@ -117,9 +116,8 @@ void GrStencilAndCoverTextContext::drawPosText(GrContext* context, GrDrawContext
} else if (this->canDraw(skPaint, viewMatrix)) {
if (skPaint.getTextSize() > 0) {
TextRun run(skPaint);
- GrPipelineBuilder pipelineBuilder(paint);
run.setPosText(text, byteLength, pos, scalarsPerPosition, offset);
- run.draw(context, dc, &pipelineBuilder, clip, paint.getColor(), viewMatrix, props, 0, 0,
+ run.draw(context, dc, paint, clip, paint.getColor(), viewMatrix, props, 0, 0,
clipBounds, fFallbackTextContext, skPaint);
}
return;
@@ -225,11 +223,10 @@ void GrStencilAndCoverTextContext::drawTextBlob(GrContext* context, GrDrawContex
}
const TextBlob& blob = this->findOrCreateTextBlob(skBlob, skPaint);
- GrPipelineBuilder pipelineBuilder(paint);
TextBlob::Iter iter(blob);
for (TextRun* run = iter.get(); run; run = iter.next()) {
- run->draw(context, dc, &pipelineBuilder, clip, paint.getColor(), viewMatrix, props, x, y,
+ run->draw(context, dc, paint, clip, paint.getColor(), viewMatrix, props, x, y,
clipBounds, fFallbackTextContext, skPaint);
run->releaseGlyphCache();
}
@@ -596,7 +593,7 @@ inline void GrStencilAndCoverTextContext::TextRun::appendGlyph(const SkGlyph& gl
void GrStencilAndCoverTextContext::TextRun::draw(GrContext* ctx,
GrDrawContext* drawContext,
- GrPipelineBuilder* pipelineBuilder,
+ const GrPaint& grPaint,
const GrClip& clip,
GrColor color,
const SkMatrix& viewMatrix,
@@ -609,8 +606,6 @@ void GrStencilAndCoverTextContext::TextRun::draw(GrContext* ctx,
SkASSERT(drawContext->isStencilBufferMultisampled() || !fFont.isAntiAlias());
if (fInstanceData->count()) {
- pipelineBuilder->setState(GrPipelineBuilder::kHWAntialias_Flag, fFont.isAntiAlias());
-
static constexpr GrUserStencilSettings kCoverPass(
GrUserStencilSettings::StaticInit<
0x0000,
@@ -621,8 +616,6 @@ void GrStencilAndCoverTextContext::TextRun::draw(GrContext* ctx,
0xffff>()
);
- pipelineBuilder->setUserStencil(&kCoverPass);
-
SkAutoTUnref<GrPathRange> glyphs(this->createGlyphs(ctx));
if (fLastDrawnGlyphsID != glyphs->getUniqueID()) {
// Either this is the first draw or the glyphs object was purged since last draw.
@@ -643,7 +636,11 @@ void GrStencilAndCoverTextContext::TextRun::draw(GrContext* ctx,
GrPathRendering::kWinding_FillType, glyphs, fInstanceData,
bounds));
- drawContext->drawBatch(*pipelineBuilder, clip, batch);
+ GrPipelineBuilder pipelineBuilder(grPaint);
+ pipelineBuilder.setState(GrPipelineBuilder::kHWAntialias_Flag, fFont.isAntiAlias());
+ pipelineBuilder.setUserStencil(&kCoverPass);
+
+ drawContext->drawBatch(pipelineBuilder, clip, batch);
}
if (fFallbackTextBlob) {
« no previous file with comments | « src/gpu/text/GrStencilAndCoverTextContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698