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

Unified Diff: src/gpu/text/GrAtlasTextBlob.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/GrAtlasTextBlob.h ('k') | src/gpu/text/GrStencilAndCoverTextContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/text/GrAtlasTextBlob.cpp
diff --git a/src/gpu/text/GrAtlasTextBlob.cpp b/src/gpu/text/GrAtlasTextBlob.cpp
index 0ead354204e9de1ad84900794ab81eac2e453fc3..9ab9c1230d0cdd362521a316f20f7a2d6ce010eb 100644
--- a/src/gpu/text/GrAtlasTextBlob.cpp
+++ b/src/gpu/text/GrAtlasTextBlob.cpp
@@ -302,9 +302,9 @@ inline GrDrawBatch* GrAtlasTextBlob::createBatch(
}
inline
-void GrAtlasTextBlob::flushRun(GrDrawContext* dc, GrPipelineBuilder* pipelineBuilder,
+void GrAtlasTextBlob::flushRun(GrDrawContext* dc, const GrPaint& grPaint,
const GrClip& clip, int run, const SkMatrix& viewMatrix, SkScalar x,
- SkScalar y, GrColor color,
+ SkScalar y,
const SkPaint& skPaint, const SkSurfaceProps& props,
const GrDistanceFieldAdjustTable* distanceAdjustTable,
GrBatchFontCache* cache) {
@@ -315,12 +315,17 @@ void GrAtlasTextBlob::flushRun(GrDrawContext* dc, GrPipelineBuilder* pipelineBui
continue;
}
+ GrColor color = grPaint.getColor();
+
SkAutoTUnref<GrDrawBatch> batch(this->createBatch(info, glyphCount, run,
subRun, viewMatrix, x, y, color,
skPaint, props,
distanceAdjustTable, dc->isGammaCorrect(),
cache));
- dc->drawBatch(*pipelineBuilder, clip, batch);
+
+ GrPipelineBuilder pipelineBuilder(grPaint, dc->mustUseHWAA(grPaint));
+
+ dc->drawBatch(pipelineBuilder, clip, batch);
}
}
@@ -419,10 +424,6 @@ void GrAtlasTextBlob::flushCached(GrContext* context,
SkScalar x, SkScalar y) {
// We loop through the runs of the blob, flushing each. If any run is too large, then we flush
// it as paths
- GrPipelineBuilder pipelineBuilder(grPaint, dc->mustUseHWAA(grPaint));
-
- GrColor color = grPaint.getColor();
-
SkTextBlobRunIterator it(blob);
for (int run = 0; !it.done(); it.next(), run++) {
if (fRuns[run].fDrawAsPaths) {
@@ -430,7 +431,7 @@ void GrAtlasTextBlob::flushCached(GrContext* context,
drawFilter, viewMatrix, clipBounds, x, y);
continue;
}
- this->flushRun(dc, &pipelineBuilder, clip, run, viewMatrix, x, y, color, skPaint, props,
+ this->flushRun(dc, grPaint, clip, run, viewMatrix, x, y, skPaint, props,
distanceAdjustTable, context->getBatchFontCache());
}
@@ -448,11 +449,8 @@ void GrAtlasTextBlob::flushThrowaway(GrContext* context,
const SkMatrix& viewMatrix,
const SkIRect& clipBounds,
SkScalar x, SkScalar y) {
- GrPipelineBuilder pipelineBuilder(grPaint, dc->mustUseHWAA(grPaint));
-
- GrColor color = grPaint.getColor();
for (int run = 0; run < fRunCount; run++) {
- this->flushRun(dc, &pipelineBuilder, clip, run, viewMatrix, x, y, color, skPaint, props,
+ this->flushRun(dc, grPaint, clip, run, viewMatrix, x, y, skPaint, props,
distanceAdjustTable, context->getBatchFontCache());
}
« no previous file with comments | « src/gpu/text/GrAtlasTextBlob.h ('k') | src/gpu/text/GrStencilAndCoverTextContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698