aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrAtlasTextContext.cpp
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@google.com>2015-05-19 07:15:28 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-05-19 07:15:28 -0700
commitd3a560fa80bfb3e2d2e989f951bb3b1c52316654 (patch)
tree6702bf0af4281910271596fe9b11316902194d79 /src/gpu/GrAtlasTextContext.cpp
parentcbfe91d82500f4ae8c3ff7bd74b3021a4b89fd84 (diff)
Revert of Preliminary attempt to remove batch tracker (patchset #3 id:40001 of https://codereview.chromium.org/1139723004/)
Reason for revert: breaking bots Original issue's description: > Preliminary attempt to remove batch tracker > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/cbfe91d82500f4ae8c3ff7bd74b3021a4b89fd84 TBR=robertphillips@google.com,joshualitt@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1132323003
Diffstat (limited to 'src/gpu/GrAtlasTextContext.cpp')
-rw-r--r--src/gpu/GrAtlasTextContext.cpp30
1 files changed, 20 insertions, 10 deletions
diff --git a/src/gpu/GrAtlasTextContext.cpp b/src/gpu/GrAtlasTextContext.cpp
index f2307574fb..dfb07ed820 100644
--- a/src/gpu/GrAtlasTextContext.cpp
+++ b/src/gpu/GrAtlasTextContext.cpp
@@ -1537,8 +1537,7 @@ public:
texture,
params,
fMaskFormat,
- localMatrix,
- this->usesLocalCoords()));
+ localMatrix));
}
FlushInfo flushInfo;
@@ -1548,7 +1547,7 @@ public:
get_vertex_stride_df(fMaskFormat, fUseLCDText) :
get_vertex_stride(fMaskFormat)));
- batchTarget->initDraw(gp, pipeline);
+ this->initDraw(batchTarget, gp, pipeline);
int glyphCount = this->numGlyphs();
int instanceCount = fInstanceCount;
@@ -1658,7 +1657,7 @@ public:
if (!fFontCache->hasGlyph(glyph) &&
!strike->addGlyphToAtlas(batchTarget, glyph, scaler)) {
this->flush(batchTarget, &flushInfo);
- batchTarget->initDraw(gp, pipeline);
+ this->initDraw(batchTarget, gp, pipeline);
brokenRun = glyphIdx > 0;
SkDEBUGCODE(bool success =) strike->addGlyphToAtlas(batchTarget,
@@ -1850,6 +1849,20 @@ private:
}
}
+ void initDraw(GrBatchTarget* batchTarget,
+ const GrGeometryProcessor* gp,
+ const GrPipeline* pipeline) {
+ batchTarget->initDraw(gp, pipeline);
+
+ // TODO remove this when batch is everywhere
+ GrPipelineInfo init;
+ init.fColorIgnored = fBatch.fColorIgnored;
+ init.fOverrideColor = GrColor_ILLEGAL;
+ init.fCoverageIgnored = fBatch.fCoverageIgnored;
+ init.fUsesLocalCoords = this->usesLocalCoords();
+ gp->initBatchTracker(batchTarget->currentBatchTracker(), init);
+ }
+
void flush(GrBatchTarget* batchTarget, FlushInfo* flushInfo) {
GrVertices vertices;
int maxGlyphsPerDraw = flushInfo->fIndexBuffer->maxQuads();
@@ -1979,8 +1992,7 @@ private:
texture,
params,
widthAdjust,
- flags,
- this->usesLocalCoords());
+ flags);
} else {
flags |= kColorAttr_DistanceFieldEffectFlag;
#ifdef SK_GAMMA_APPLY_TO_A8
@@ -1991,15 +2003,13 @@ private:
texture,
params,
correction,
- flags,
- this->usesLocalCoords());
+ flags);
#else
return GrDistanceFieldA8TextGeoProc::Create(color,
viewMatrix,
texture,
params,
- flags,
- this->usesLocalCoords());
+ flags);
#endif
}