| Index: src/gpu/GrAtlasTextContext.cpp
|
| diff --git a/src/gpu/GrAtlasTextContext.cpp b/src/gpu/GrAtlasTextContext.cpp
|
| index f8004656c10207c976daf982525506565607ff70..5d1889d5156d930d07f4b2a335d665721bfe0c83 100644
|
| --- a/src/gpu/GrAtlasTextContext.cpp
|
| +++ b/src/gpu/GrAtlasTextContext.cpp
|
| @@ -390,7 +390,7 @@ void GrAtlasTextContext::drawTextBlob(GrDrawContext* dc, GrRenderTarget* rt,
|
| // Though for the time being runs in the textblob can override the paint, they only touch font
|
| // info.
|
| GrPaint grPaint;
|
| - if (!SkPaintToGrPaint(fContext, skPaint, viewMatrix, &grPaint)) {
|
| + if (!SkPaintToGrPaint(fContext, skPaint, viewMatrix, &grPaint, rt)) {
|
| return;
|
| }
|
|
|
| @@ -1453,6 +1453,9 @@ private:
|
| return;
|
| }
|
|
|
| + // This guy is only ever uploaded to
|
| + texture->setException(true);
|
| +
|
| bool usesDistanceFields = this->usesDistanceFields();
|
| GrMaskFormat maskFormat = this->maskFormat();
|
| bool isLCD = this->isLCD();
|
| @@ -1460,7 +1463,7 @@ private:
|
| SkAutoTUnref<const GrGeometryProcessor> gp;
|
| if (usesDistanceFields) {
|
| gp.reset(this->setupDfProcessor(this->viewMatrix(), fFilteredColor, this->color(),
|
| - texture));
|
| + texture, this->rt2()));
|
| } else {
|
| GrTextureParams params(SkShader::kClamp_TileMode, GrTextureParams::kNone_FilterMode);
|
| gp.reset(GrBitmapTextGeoProc::Create(this->color(),
|
| @@ -1468,7 +1471,7 @@ private:
|
| params,
|
| maskFormat,
|
| localMatrix,
|
| - this->usesLocalCoords()));
|
| + this->usesLocalCoords(), this->rt2()));
|
| }
|
|
|
| FlushInfo flushInfo;
|
| @@ -1606,7 +1609,7 @@ private:
|
| SkASSERT(success);
|
| }
|
| fFontCache->addGlyphToBulkAndSetUseToken(&info.fBulkUseToken, glyph,
|
| - target->currentToken());
|
| + target->currentToken1());
|
|
|
| // Texture coords are the last vertex attribute so we get a pointer to the
|
| // first one and then map with stride in regenerateTextureCoords
|
| @@ -1650,7 +1653,7 @@ private:
|
|
|
| // set use tokens for all of the glyphs in our subrun. This is only valid if we
|
| // have a valid atlas generation
|
| - fFontCache->setUseTokenBulk(info.fBulkUseToken, target->currentToken(), maskFormat);
|
| + fFontCache->setUseTokenBulk(info.fBulkUseToken, target->currentToken1(), maskFormat);
|
| }
|
|
|
| // now copy all vertices
|
| @@ -1842,7 +1845,7 @@ private:
|
| // TODO just use class params
|
| // TODO trying to figure out why lcd is so whack
|
| GrGeometryProcessor* setupDfProcessor(const SkMatrix& viewMatrix, SkColor filteredColor,
|
| - GrColor color, GrTexture* texture) {
|
| + GrColor color, GrTexture* texture, GrRenderTarget* dst) {
|
| GrTextureParams params(SkShader::kClamp_TileMode, GrTextureParams::kBilerp_FilterMode);
|
| bool isLCD = this->isLCD();
|
| // set up any flags
|
| @@ -1873,7 +1876,7 @@ private:
|
| params,
|
| widthAdjust,
|
| flags,
|
| - this->usesLocalCoords());
|
| + this->usesLocalCoords(), dst);
|
| } else {
|
| flags |= kColorAttr_DistanceFieldEffectFlag;
|
| #ifdef SK_GAMMA_APPLY_TO_A8
|
| @@ -1885,7 +1888,7 @@ private:
|
| params,
|
| correction,
|
| flags,
|
| - this->usesLocalCoords());
|
| + this->usesLocalCoords(), dst);
|
| #else
|
| return GrDistanceFieldA8TextGeoProc::Create(color,
|
| viewMatrix,
|
| @@ -2014,7 +2017,8 @@ GrAtlasTextContext::createBatch(GrAtlasTextBlob* cacheBlob, const PerSubRunInfo&
|
| inline void GrAtlasTextContext::flushRun(GrDrawContext* dc, GrPipelineBuilder* pipelineBuilder,
|
| GrAtlasTextBlob* cacheBlob, int run, GrColor color,
|
| SkScalar transX, SkScalar transY,
|
| - const SkPaint& skPaint) {
|
| + const SkPaint& skPaint,
|
| + GrRenderTarget* rt) {
|
| for (int subRun = 0; subRun < cacheBlob->fRuns[run].fSubRunInfo.count(); subRun++) {
|
| const PerSubRunInfo& info = cacheBlob->fRuns[run].fSubRunInfo[subRun];
|
| int glyphCount = info.fGlyphEndIndex - info.fGlyphStartIndex;
|
| @@ -2081,7 +2085,7 @@ void GrAtlasTextContext::flush(const SkTextBlob* blob,
|
| }
|
| cacheBlob->fRuns[run].fVertexBounds.offset(transX, transY);
|
| this->flushRun(dc, &pipelineBuilder, cacheBlob, run, color,
|
| - transX, transY, skPaint);
|
| + transX, transY, skPaint, rt);
|
| }
|
|
|
| // Now flush big glyphs
|
| @@ -2099,7 +2103,7 @@ void GrAtlasTextContext::flush(GrAtlasTextBlob* cacheBlob,
|
|
|
| GrColor color = grPaint.getColor();
|
| for (int run = 0; run < cacheBlob->fRunCount; run++) {
|
| - this->flushRun(dc, &pipelineBuilder, cacheBlob, run, color, 0, 0, skPaint);
|
| + this->flushRun(dc, &pipelineBuilder, cacheBlob, run, color, 0, 0, skPaint, rt);
|
| }
|
|
|
| // Now flush big glyphs
|
| @@ -2147,7 +2151,7 @@ DRAW_BATCH_TEST_DEFINE(TextBlobBatch) {
|
| skPaint.setSubpixelText(random->nextBool());
|
|
|
| GrPaint grPaint;
|
| - if (!SkPaintToGrPaint(context, skPaint, viewMatrix, &grPaint)) {
|
| + if (!SkPaintToGrPaint(context, skPaint, viewMatrix, &grPaint, rt)) {
|
| SkFAIL("couldn't convert paint\n");
|
| }
|
|
|
|
|