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

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

Issue 1988923002: Remove GrRenderTarget from GrPipelineBuilder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update to ToT Created 4 years, 6 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/GrAtlasTextContext.h ('k') | src/gpu/vk/GrVkStencilAttachment.cpp » ('j') | 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 00ec451bb16036b12b8808d4a25af5a3487f804b..5673c3934669fa54c3c143028a9439e9e4b3fcca 100644
--- a/src/gpu/text/GrStencilAndCoverTextContext.cpp
+++ b/src/gpu/text/GrStencilAndCoverTextContext.cpp
@@ -82,8 +82,7 @@ void GrStencilAndCoverTextContext::drawText(GrContext* context, GrDrawContext* d
} else if (this->canDraw(skPaint, viewMatrix)) {
if (skPaint.getTextSize() > 0) {
TextRun run(skPaint);
- GrPipelineBuilder pipelineBuilder(paint, dc->isUnifiedMultisampled());
- pipelineBuilder.setRenderTarget(dc->accessRenderTarget());
+ GrPipelineBuilder pipelineBuilder(paint, dc->isUnifiedMultisampled());
run.setText(text, byteLength, x, y);
run.draw(context, dc, &pipelineBuilder, clip, paint.getColor(), viewMatrix, props, 0, 0,
clipBounds, fFallbackTextContext, skPaint);
@@ -118,8 +117,7 @@ void GrStencilAndCoverTextContext::drawPosText(GrContext* context, GrDrawContext
} else if (this->canDraw(skPaint, viewMatrix)) {
if (skPaint.getTextSize() > 0) {
TextRun run(skPaint);
- GrPipelineBuilder pipelineBuilder(paint, dc->isUnifiedMultisampled());
- pipelineBuilder.setRenderTarget(dc->accessRenderTarget());
+ GrPipelineBuilder pipelineBuilder(paint, dc->isUnifiedMultisampled());
run.setPosText(text, byteLength, pos, scalarsPerPosition, offset);
run.draw(context, dc, &pipelineBuilder, clip, paint.getColor(), viewMatrix, props, 0, 0,
clipBounds, fFallbackTextContext, skPaint);
@@ -227,8 +225,7 @@ void GrStencilAndCoverTextContext::drawTextBlob(GrContext* context, GrDrawContex
}
const TextBlob& blob = this->findOrCreateTextBlob(skBlob, skPaint);
- GrPipelineBuilder pipelineBuilder(paint, dc->isUnifiedMultisampled());
- pipelineBuilder.setRenderTarget(dc->accessRenderTarget());
+ GrPipelineBuilder pipelineBuilder(paint, dc->isUnifiedMultisampled());
TextBlob::Iter iter(blob);
for (TextRun* run = iter.get(); run; run = iter.next()) {
@@ -598,7 +595,7 @@ inline void GrStencilAndCoverTextContext::TextRun::appendGlyph(const SkGlyph& gl
}
void GrStencilAndCoverTextContext::TextRun::draw(GrContext* ctx,
- GrDrawContext* dc,
+ GrDrawContext* drawContext,
GrPipelineBuilder* pipelineBuilder,
const GrClip& clip,
GrColor color,
@@ -609,7 +606,7 @@ void GrStencilAndCoverTextContext::TextRun::draw(GrContext* ctx,
GrAtlasTextContext* fallbackTextContext,
const SkPaint& originalSkPaint) const {
SkASSERT(fInstanceData);
- SkASSERT(dc->accessRenderTarget()->isStencilBufferMultisampled() || !fFont.isAntiAlias());
+ SkASSERT(drawContext->isStencilBufferMultisampled() || !fFont.isAntiAlias());
if (fInstanceData->count()) {
pipelineBuilder->setState(GrPipelineBuilder::kHWAntialias_Flag, fFont.isAntiAlias());
@@ -638,8 +635,7 @@ void GrStencilAndCoverTextContext::TextRun::draw(GrContext* ctx,
// NV_path_rendering will also support NV_blend_equation_advanced.
// For clipping we'll just skip any optimizations based on the bounds. This does, however,
// hurt batching.
- SkRect bounds = SkRect::MakeIWH(pipelineBuilder->getRenderTarget()->width(),
- pipelineBuilder->getRenderTarget()->height());
+ const SkRect bounds = SkRect::MakeIWH(drawContext->width(), drawContext->height());
SkAutoTUnref<GrDrawBatch> batch(
GrDrawPathRangeBatch::Create(viewMatrix, fTextRatio, fTextInverseRatio * x,
@@ -647,7 +643,7 @@ void GrStencilAndCoverTextContext::TextRun::draw(GrContext* ctx,
GrPathRendering::kWinding_FillType, glyphs, fInstanceData,
bounds));
- dc->drawBatch(*pipelineBuilder, clip, batch);
+ drawContext->drawBatch(*pipelineBuilder, clip, batch);
}
if (fFallbackTextBlob) {
@@ -657,8 +653,8 @@ void GrStencilAndCoverTextContext::TextRun::draw(GrContext* ctx,
fallbackSkPaint.setStrokeWidth(fStyle.strokeRec().getWidth() * fTextRatio);
}
- fallbackTextContext->drawTextBlob(ctx, dc, clip, fallbackSkPaint, viewMatrix, props,
- fFallbackTextBlob, x, y, nullptr, clipBounds);
+ fallbackTextContext->drawTextBlob(ctx, drawContext, clip, fallbackSkPaint, viewMatrix,
+ props, fFallbackTextBlob, x, y, nullptr, clipBounds);
}
}
« no previous file with comments | « src/gpu/text/GrAtlasTextContext.h ('k') | src/gpu/vk/GrVkStencilAttachment.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698