| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 #include "GrAtlasTextContext.h" | 7 #include "GrAtlasTextContext.h" |
| 8 | 8 |
| 9 #include "GrBatch.h" | 9 #include "GrBatch.h" |
| 10 #include "GrBatchFontCache.h" | 10 #include "GrBatchFontCache.h" |
| 11 #include "GrBatchTarget.h" | 11 #include "GrBatchTarget.h" |
| 12 #include "GrBatchTest.h" | 12 #include "GrBatchTest.h" |
| 13 #include "GrDefaultGeoProcFactory.h" | 13 #include "GrDefaultGeoProcFactory.h" |
| 14 #include "GrDrawTarget.h" | 14 #include "GrDrawContext.h" |
| 15 #include "GrFontScaler.h" | 15 #include "GrFontScaler.h" |
| 16 #include "GrIndexBuffer.h" | 16 #include "GrIndexBuffer.h" |
| 17 #include "GrResourceProvider.h" | 17 #include "GrResourceProvider.h" |
| 18 #include "GrStrokeInfo.h" | 18 #include "GrStrokeInfo.h" |
| 19 #include "GrTextBlobCache.h" | 19 #include "GrTextBlobCache.h" |
| 20 #include "GrTexturePriv.h" | 20 #include "GrTexturePriv.h" |
| 21 #include "GrVertexBuffer.h" | 21 #include "GrVertexBuffer.h" |
| 22 | 22 |
| 23 #include "SkAutoKern.h" | 23 #include "SkAutoKern.h" |
| 24 #include "SkColorPriv.h" | 24 #include "SkColorPriv.h" |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 skPaint.getScalerContextDescriptor(&run->fDescriptor, &fDeviceProperties, vi
ewMatrix, noGamma); | 343 skPaint.getScalerContextDescriptor(&run->fDescriptor, &fDeviceProperties, vi
ewMatrix, noGamma); |
| 344 run->fTypeface.reset(SkSafeRef(skPaint.getTypeface())); | 344 run->fTypeface.reset(SkSafeRef(skPaint.getTypeface())); |
| 345 return SkGlyphCache::DetachCache(run->fTypeface, run->fDescriptor.getDesc())
; | 345 return SkGlyphCache::DetachCache(run->fTypeface, run->fDescriptor.getDesc())
; |
| 346 } | 346 } |
| 347 | 347 |
| 348 void GrAtlasTextContext::drawTextBlob(GrRenderTarget* rt, const GrClip& clip, | 348 void GrAtlasTextContext::drawTextBlob(GrRenderTarget* rt, const GrClip& clip, |
| 349 const SkPaint& skPaint, const SkMatrix& vi
ewMatrix, | 349 const SkPaint& skPaint, const SkMatrix& vi
ewMatrix, |
| 350 const SkTextBlob* blob, SkScalar x, SkScal
ar y, | 350 const SkTextBlob* blob, SkScalar x, SkScal
ar y, |
| 351 SkDrawFilter* drawFilter, const SkIRect& c
lipBounds) { | 351 SkDrawFilter* drawFilter, const SkIRect& c
lipBounds) { |
| 352 // If we have been abandoned, then don't draw | 352 // If we have been abandoned, then don't draw |
| 353 if (!fContext->getTextTarget()) { | 353 if (fContext->abandoned()) { |
| 354 return; | 354 return; |
| 355 } | 355 } |
| 356 | 356 |
| 357 GrDrawContext* drawContext = fContext->drawContext(); |
| 358 if (!drawContext) { |
| 359 return; |
| 360 } |
| 361 |
| 357 SkAutoTUnref<BitmapTextBlob> cacheBlob; | 362 SkAutoTUnref<BitmapTextBlob> cacheBlob; |
| 358 SkMaskFilter::BlurRec blurRec; | 363 SkMaskFilter::BlurRec blurRec; |
| 359 BitmapTextBlob::Key key; | 364 BitmapTextBlob::Key key; |
| 360 // It might be worth caching these things, but its not clear at this time | 365 // It might be worth caching these things, but its not clear at this time |
| 361 // TODO for animated mask filters, this will fill up our cache. We need a s
afeguard here | 366 // TODO for animated mask filters, this will fill up our cache. We need a s
afeguard here |
| 362 const SkMaskFilter* mf = skPaint.getMaskFilter(); | 367 const SkMaskFilter* mf = skPaint.getMaskFilter(); |
| 363 bool canCache = !(skPaint.getPathEffect() || | 368 bool canCache = !(skPaint.getPathEffect() || |
| 364 (mf && !mf->asABlur(&blurRec)) || | 369 (mf && !mf->asABlur(&blurRec)) || |
| 365 drawFilter); | 370 drawFilter); |
| 366 | 371 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 cacheBlob.reset(SkRef(fCache->createCachedBlob(blob, key, blurRec, s
kPaint, | 426 cacheBlob.reset(SkRef(fCache->createCachedBlob(blob, key, blurRec, s
kPaint, |
| 422 kGrayTextVASize))); | 427 kGrayTextVASize))); |
| 423 } else { | 428 } else { |
| 424 cacheBlob.reset(fCache->createBlob(blob, kGrayTextVASize)); | 429 cacheBlob.reset(fCache->createBlob(blob, kGrayTextVASize)); |
| 425 } | 430 } |
| 426 this->regenerateTextBlob(cacheBlob, skPaint, grPaint.getColor(), viewMat
rix, blob, x, y, | 431 this->regenerateTextBlob(cacheBlob, skPaint, grPaint.getColor(), viewMat
rix, blob, x, y, |
| 427 drawFilter, clipRect, rt, clip, grPaint); | 432 drawFilter, clipRect, rt, clip, grPaint); |
| 428 } | 433 } |
| 429 | 434 |
| 430 cacheBlob->fPaintColor = skPaint.getColor(); | 435 cacheBlob->fPaintColor = skPaint.getColor(); |
| 431 this->flush(fContext->getTextTarget(), blob, cacheBlob, rt, skPaint, grPaint
, drawFilter, | 436 this->flush(drawContext, blob, cacheBlob, rt, skPaint, grPaint, drawFilter, |
| 432 clip, viewMatrix, clipBounds, x, y, transX, transY); | 437 clip, viewMatrix, clipBounds, x, y, transX, transY); |
| 433 } | 438 } |
| 434 | 439 |
| 435 inline bool GrAtlasTextContext::canDrawAsDistanceFields(const SkPaint& skPaint, | 440 inline bool GrAtlasTextContext::canDrawAsDistanceFields(const SkPaint& skPaint, |
| 436 const SkMatrix& viewMatr
ix) { | 441 const SkMatrix& viewMatr
ix) { |
| 437 // TODO: support perspective (need getMaxScale replacement) | 442 // TODO: support perspective (need getMaxScale replacement) |
| 438 if (viewMatrix.hasPerspective()) { | 443 if (viewMatrix.hasPerspective()) { |
| 439 return false; | 444 return false; |
| 440 } | 445 } |
| 441 | 446 |
| 442 SkScalar maxScale = viewMatrix.getMaxScale(); | 447 SkScalar maxScale = viewMatrix.getMaxScale(); |
| 443 SkScalar scaledTextSize = maxScale*skPaint.getTextSize(); | 448 SkScalar scaledTextSize = maxScale*skPaint.getTextSize(); |
| 444 // Hinted text looks far better at small resolutions | 449 // Hinted text looks far better at small resolutions |
| 445 // Scaling up beyond 2x yields undesireable artifacts | 450 // Scaling up beyond 2x yields undesireable artifacts |
| 446 if (scaledTextSize < kMinDFFontSize || scaledTextSize > kLargeDFFontLimit) { | 451 if (scaledTextSize < kMinDFFontSize || scaledTextSize > kLargeDFFontLimit) { |
| 447 return false; | 452 return false; |
| 448 } | 453 } |
| 449 | 454 |
| 450 if (!fEnableDFRendering && !skPaint.isDistanceFieldTextTEMP() && | 455 if (!fEnableDFRendering && !skPaint.isDistanceFieldTextTEMP() && |
| 451 scaledTextSize < kLargeDFFontSize) { | 456 scaledTextSize < kLargeDFFontSize) { |
| 452 return false; | 457 return false; |
| 453 } | 458 } |
| 454 | 459 |
| 455 // rasterizers and mask filters modify alpha, which doesn't | 460 // rasterizers and mask filters modify alpha, which doesn't |
| 456 // translate well to distance | 461 // translate well to distance |
| 457 if (skPaint.getRasterizer() || skPaint.getMaskFilter() || | 462 if (skPaint.getRasterizer() || skPaint.getMaskFilter() || |
| 458 !fContext->getTextTarget()->caps()->shaderCaps()->shaderDerivativeSuppor
t()) { | 463 !fContext->shaderDerivativeSupport()) { |
| 459 return false; | 464 return false; |
| 460 } | 465 } |
| 461 | 466 |
| 462 // TODO: add some stroking support | 467 // TODO: add some stroking support |
| 463 if (skPaint.getStyle() != SkPaint::kFill_Style) { | 468 if (skPaint.getStyle() != SkPaint::kFill_Style) { |
| 464 return false; | 469 return false; |
| 465 } | 470 } |
| 466 | 471 |
| 467 return true; | 472 return true; |
| 468 } | 473 } |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 768 SkGlyphCache::AttachCache(cache); | 773 SkGlyphCache::AttachCache(cache); |
| 769 } | 774 } |
| 770 return blob; | 775 return blob; |
| 771 } | 776 } |
| 772 | 777 |
| 773 void GrAtlasTextContext::onDrawText(GrRenderTarget* rt, const GrClip& clip, | 778 void GrAtlasTextContext::onDrawText(GrRenderTarget* rt, const GrClip& clip, |
| 774 const GrPaint& paint, const SkPaint& skPaint
, | 779 const GrPaint& paint, const SkPaint& skPaint
, |
| 775 const SkMatrix& viewMatrix, | 780 const SkMatrix& viewMatrix, |
| 776 const char text[], size_t byteLength, | 781 const char text[], size_t byteLength, |
| 777 SkScalar x, SkScalar y, const SkIRect& regio
nClipBounds) { | 782 SkScalar x, SkScalar y, const SkIRect& regio
nClipBounds) { |
| 778 SkAutoTUnref<BitmapTextBlob> blob( | 783 GrDrawContext* drawContext = fContext->drawContext(); |
| 784 if (drawContext) { |
| 785 SkAutoTUnref<BitmapTextBlob> blob( |
| 779 this->createDrawTextBlob(rt, clip, paint, skPaint, viewMatrix, | 786 this->createDrawTextBlob(rt, clip, paint, skPaint, viewMatrix, |
| 780 text, byteLength, x, y, regionClipBounds)); | 787 text, byteLength, x, y, regionClipBounds)); |
| 781 this->flush(fContext->getTextTarget(), blob, rt, skPaint, paint, clip, regio
nClipBounds); | 788 this->flush(drawContext, blob, rt, skPaint, paint, clip, regionClipBound
s); |
| 789 } |
| 782 } | 790 } |
| 783 | 791 |
| 784 void GrAtlasTextContext::onDrawPosText(GrRenderTarget* rt, const GrClip& clip, | 792 void GrAtlasTextContext::onDrawPosText(GrRenderTarget* rt, const GrClip& clip, |
| 785 const GrPaint& paint, const SkPaint& skPa
int, | 793 const GrPaint& paint, const SkPaint& skPa
int, |
| 786 const SkMatrix& viewMatrix, | 794 const SkMatrix& viewMatrix, |
| 787 const char text[], size_t byteLength, | 795 const char text[], size_t byteLength, |
| 788 const SkScalar pos[], int scalarsPerPosit
ion, | 796 const SkScalar pos[], int scalarsPerPosit
ion, |
| 789 const SkPoint& offset, const SkIRect& reg
ionClipBounds) { | 797 const SkPoint& offset, const SkIRect& reg
ionClipBounds) { |
| 790 SkAutoTUnref<BitmapTextBlob> blob( | 798 GrDrawContext* drawContext = fContext->drawContext(); |
| 799 if (drawContext) { |
| 800 SkAutoTUnref<BitmapTextBlob> blob( |
| 791 this->createDrawPosTextBlob(rt, clip, paint, skPaint, viewMatrix, | 801 this->createDrawPosTextBlob(rt, clip, paint, skPaint, viewMatrix, |
| 792 text, byteLength, | 802 text, byteLength, |
| 793 pos, scalarsPerPosition, | 803 pos, scalarsPerPosition, |
| 794 offset, regionClipBounds)); | 804 offset, regionClipBounds)); |
| 795 | 805 |
| 796 this->flush(fContext->getTextTarget(), blob, rt, skPaint, paint, clip, regio
nClipBounds); | 806 this->flush(drawContext, blob, rt, skPaint, paint, clip, regionClipBound
s); |
| 807 } |
| 797 } | 808 } |
| 798 | 809 |
| 799 void GrAtlasTextContext::internalDrawBMPText(BitmapTextBlob* blob, int runIndex, | 810 void GrAtlasTextContext::internalDrawBMPText(BitmapTextBlob* blob, int runIndex, |
| 800 SkGlyphCache* cache, const SkPaint&
skPaint, | 811 SkGlyphCache* cache, const SkPaint&
skPaint, |
| 801 GrColor color, | 812 GrColor color, |
| 802 const SkMatrix& viewMatrix, | 813 const SkMatrix& viewMatrix, |
| 803 const char text[], size_t byteLengt
h, | 814 const char text[], size_t byteLengt
h, |
| 804 SkScalar x, SkScalar y, const SkIRe
ct& clipRect) { | 815 SkScalar x, SkScalar y, const SkIRe
ct& clipRect) { |
| 805 SkASSERT(byteLength == 0 || text != NULL); | 816 SkASSERT(byteLength == 0 || text != NULL); |
| 806 | 817 |
| (...skipping 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2102 geometry.fRun = run; | 2113 geometry.fRun = run; |
| 2103 geometry.fSubRun = subRun; | 2114 geometry.fSubRun = subRun; |
| 2104 geometry.fColor = subRunColor; | 2115 geometry.fColor = subRunColor; |
| 2105 geometry.fTransX = transX; | 2116 geometry.fTransX = transX; |
| 2106 geometry.fTransY = transY; | 2117 geometry.fTransY = transY; |
| 2107 batch->init(); | 2118 batch->init(); |
| 2108 | 2119 |
| 2109 return batch; | 2120 return batch; |
| 2110 } | 2121 } |
| 2111 | 2122 |
| 2112 inline void GrAtlasTextContext::flushRun(GrDrawTarget* target, GrPipelineBuilder
* pipelineBuilder, | 2123 inline void GrAtlasTextContext::flushRun(GrDrawContext* drawContext, |
| 2124 GrPipelineBuilder* pipelineBuilder, |
| 2113 BitmapTextBlob* cacheBlob, int run, GrC
olor color, | 2125 BitmapTextBlob* cacheBlob, int run, GrC
olor color, |
| 2114 SkScalar transX, SkScalar transY, const
SkPaint& skPaint) { | 2126 SkScalar transX, SkScalar transY, |
| 2127 const SkPaint& skPaint) { |
| 2115 for (int subRun = 0; subRun < cacheBlob->fRuns[run].fSubRunInfo.count(); sub
Run++) { | 2128 for (int subRun = 0; subRun < cacheBlob->fRuns[run].fSubRunInfo.count(); sub
Run++) { |
| 2116 const PerSubRunInfo& info = cacheBlob->fRuns[run].fSubRunInfo[subRun]; | 2129 const PerSubRunInfo& info = cacheBlob->fRuns[run].fSubRunInfo[subRun]; |
| 2117 int glyphCount = info.fGlyphEndIndex - info.fGlyphStartIndex; | 2130 int glyphCount = info.fGlyphEndIndex - info.fGlyphStartIndex; |
| 2118 if (0 == glyphCount) { | 2131 if (0 == glyphCount) { |
| 2119 continue; | 2132 continue; |
| 2120 } | 2133 } |
| 2121 | 2134 |
| 2122 SkAutoTUnref<BitmapTextBatch> batch(this->createBatch(cacheBlob, info, g
lyphCount, run, | 2135 SkAutoTUnref<BitmapTextBatch> batch(this->createBatch(cacheBlob, info, g
lyphCount, run, |
| 2123 subRun, color, tra
nsX, transY, | 2136 subRun, color, tra
nsX, transY, |
| 2124 skPaint)); | 2137 skPaint)); |
| 2125 target->drawBatch(pipelineBuilder, batch); | 2138 drawContext->drawText(pipelineBuilder, batch); |
| 2126 } | 2139 } |
| 2127 } | 2140 } |
| 2128 | 2141 |
| 2129 inline void GrAtlasTextContext::flushBigGlyphs(BitmapTextBlob* cacheBlob, GrRend
erTarget* rt, | 2142 inline void GrAtlasTextContext::flushBigGlyphs(BitmapTextBlob* cacheBlob, GrRend
erTarget* rt, |
| 2130 const SkPaint& skPaint, | 2143 const SkPaint& skPaint, |
| 2131 SkScalar transX, SkScalar transY, | 2144 SkScalar transX, SkScalar transY, |
| 2132 const SkIRect& clipBounds) { | 2145 const SkIRect& clipBounds) { |
| 2133 if (!cacheBlob->fBigGlyphs.count()) { | 2146 if (!cacheBlob->fBigGlyphs.count()) { |
| 2134 return; | 2147 return; |
| 2135 } | 2148 } |
| 2136 | 2149 |
| 2137 SkMatrix pathMatrix; | 2150 SkMatrix pathMatrix; |
| 2138 if (!cacheBlob->fViewMatrix.invert(&pathMatrix)) { | 2151 if (!cacheBlob->fViewMatrix.invert(&pathMatrix)) { |
| 2139 SkDebugf("could not invert viewmatrix\n"); | 2152 SkDebugf("could not invert viewmatrix\n"); |
| 2140 return; | 2153 return; |
| 2141 } | 2154 } |
| 2142 | 2155 |
| 2143 for (int i = 0; i < cacheBlob->fBigGlyphs.count(); i++) { | 2156 for (int i = 0; i < cacheBlob->fBigGlyphs.count(); i++) { |
| 2144 BitmapTextBlob::BigGlyph& bigGlyph = cacheBlob->fBigGlyphs[i]; | 2157 BitmapTextBlob::BigGlyph& bigGlyph = cacheBlob->fBigGlyphs[i]; |
| 2145 bigGlyph.fVx += transX; | 2158 bigGlyph.fVx += transX; |
| 2146 bigGlyph.fVy += transY; | 2159 bigGlyph.fVy += transY; |
| 2147 SkMatrix translate = cacheBlob->fViewMatrix; | 2160 SkMatrix translate = cacheBlob->fViewMatrix; |
| 2148 translate.postTranslate(bigGlyph.fVx, bigGlyph.fVy); | 2161 translate.postTranslate(bigGlyph.fVx, bigGlyph.fVy); |
| 2149 | 2162 |
| 2150 fGpuDevice->internalDrawPath(bigGlyph.fPath, skPaint, translate, &pathMa
trix, clipBounds, | 2163 fGpuDevice->internalDrawPath(bigGlyph.fPath, skPaint, translate, &pathMa
trix, clipBounds, |
| 2151 false); | 2164 false); |
| 2152 } | 2165 } |
| 2153 } | 2166 } |
| 2154 | 2167 |
| 2155 void GrAtlasTextContext::flush(GrDrawTarget* target, | 2168 void GrAtlasTextContext::flush(GrDrawContext* drawContext, |
| 2156 const SkTextBlob* blob, | 2169 const SkTextBlob* blob, |
| 2157 BitmapTextBlob* cacheBlob, | 2170 BitmapTextBlob* cacheBlob, |
| 2158 GrRenderTarget* rt, | 2171 GrRenderTarget* rt, |
| 2159 const SkPaint& skPaint, | 2172 const SkPaint& skPaint, |
| 2160 const GrPaint& grPaint, | 2173 const GrPaint& grPaint, |
| 2161 SkDrawFilter* drawFilter, | 2174 SkDrawFilter* drawFilter, |
| 2162 const GrClip& clip, | 2175 const GrClip& clip, |
| 2163 const SkMatrix& viewMatrix, | 2176 const SkMatrix& viewMatrix, |
| 2164 const SkIRect& clipBounds, | 2177 const SkIRect& clipBounds, |
| 2165 SkScalar x, SkScalar y, | 2178 SkScalar x, SkScalar y, |
| 2166 SkScalar transX, SkScalar transY) { | 2179 SkScalar transX, SkScalar transY) { |
| 2167 // We loop through the runs of the blob, flushing each. If any run is too l
arge, then we flush | 2180 // We loop through the runs of the blob, flushing each. If any run is too l
arge, then we flush |
| 2168 // it as paths | 2181 // it as paths |
| 2169 GrPipelineBuilder pipelineBuilder; | 2182 GrPipelineBuilder pipelineBuilder; |
| 2170 pipelineBuilder.setFromPaint(grPaint, rt, clip); | 2183 pipelineBuilder.setFromPaint(grPaint, rt, clip); |
| 2171 | 2184 |
| 2172 GrColor color = grPaint.getColor(); | 2185 GrColor color = grPaint.getColor(); |
| 2173 | 2186 |
| 2174 SkTextBlob::RunIterator it(blob); | 2187 SkTextBlob::RunIterator it(blob); |
| 2175 for (int run = 0; !it.done(); it.next(), run++) { | 2188 for (int run = 0; !it.done(); it.next(), run++) { |
| 2176 if (cacheBlob->fRuns[run].fDrawAsPaths) { | 2189 if (cacheBlob->fRuns[run].fDrawAsPaths) { |
| 2177 this->flushRunAsPaths(it, skPaint, drawFilter, viewMatrix, clipBound
s, x, y); | 2190 this->flushRunAsPaths(it, skPaint, drawFilter, viewMatrix, clipBound
s, x, y); |
| 2178 continue; | 2191 continue; |
| 2179 } | 2192 } |
| 2180 cacheBlob->fRuns[run].fVertexBounds.offset(transX, transY); | 2193 cacheBlob->fRuns[run].fVertexBounds.offset(transX, transY); |
| 2181 this->flushRun(target, &pipelineBuilder, cacheBlob, run, color, transX,
transY, skPaint); | 2194 this->flushRun(drawContext, &pipelineBuilder, cacheBlob, run, color, |
| 2195 transX, transY, skPaint); |
| 2182 } | 2196 } |
| 2183 | 2197 |
| 2184 // Now flush big glyphs | 2198 // Now flush big glyphs |
| 2185 this->flushBigGlyphs(cacheBlob, rt, skPaint, transX, transY, clipBounds); | 2199 this->flushBigGlyphs(cacheBlob, rt, skPaint, transX, transY, clipBounds); |
| 2186 } | 2200 } |
| 2187 | 2201 |
| 2188 void GrAtlasTextContext::flush(GrDrawTarget* target, | 2202 void GrAtlasTextContext::flush(GrDrawContext* drawContext, |
| 2189 BitmapTextBlob* cacheBlob, | 2203 BitmapTextBlob* cacheBlob, |
| 2190 GrRenderTarget* rt, | 2204 GrRenderTarget* rt, |
| 2191 const SkPaint& skPaint, | 2205 const SkPaint& skPaint, |
| 2192 const GrPaint& grPaint, | 2206 const GrPaint& grPaint, |
| 2193 const GrClip& clip, | 2207 const GrClip& clip, |
| 2194 const SkIRect& clipBounds) { | 2208 const SkIRect& clipBounds) { |
| 2195 GrPipelineBuilder pipelineBuilder; | 2209 GrPipelineBuilder pipelineBuilder; |
| 2196 pipelineBuilder.setFromPaint(grPaint, rt, clip); | 2210 pipelineBuilder.setFromPaint(grPaint, rt, clip); |
| 2197 | 2211 |
| 2198 GrColor color = grPaint.getColor(); | 2212 GrColor color = grPaint.getColor(); |
| 2199 for (int run = 0; run < cacheBlob->fRunCount; run++) { | 2213 for (int run = 0; run < cacheBlob->fRunCount; run++) { |
| 2200 this->flushRun(target, &pipelineBuilder, cacheBlob, run, color, 0, 0, sk
Paint); | 2214 this->flushRun(drawContext, &pipelineBuilder, cacheBlob, run, color, 0,
0, skPaint); |
| 2201 } | 2215 } |
| 2202 | 2216 |
| 2203 // Now flush big glyphs | 2217 // Now flush big glyphs |
| 2204 this->flushBigGlyphs(cacheBlob, rt, skPaint, 0, 0, clipBounds); | 2218 this->flushBigGlyphs(cacheBlob, rt, skPaint, 0, 0, clipBounds); |
| 2205 } | 2219 } |
| 2206 | 2220 |
| 2207 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 2221 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
| 2208 | 2222 |
| 2209 #ifdef GR_TEST_UTILS | 2223 #ifdef GR_TEST_UTILS |
| 2210 | 2224 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2262 gTextContext->createDrawTextBlob(rt, clip, grPaint, skPaint, viewMat
rix, text, | 2276 gTextContext->createDrawTextBlob(rt, clip, grPaint, skPaint, viewMat
rix, text, |
| 2263 static_cast<size_t>(textLen), 0, 0,
noClip)); | 2277 static_cast<size_t>(textLen), 0, 0,
noClip)); |
| 2264 | 2278 |
| 2265 SkScalar transX = static_cast<SkScalar>(random->nextU()); | 2279 SkScalar transX = static_cast<SkScalar>(random->nextU()); |
| 2266 SkScalar transY = static_cast<SkScalar>(random->nextU()); | 2280 SkScalar transY = static_cast<SkScalar>(random->nextU()); |
| 2267 const GrAtlasTextContext::BitmapTextBlob::Run::SubRunInfo& info = blob->fRun
s[0].fSubRunInfo[0]; | 2281 const GrAtlasTextContext::BitmapTextBlob::Run::SubRunInfo& info = blob->fRun
s[0].fSubRunInfo[0]; |
| 2268 return gTextContext->createBatch(blob, info, textLen, 0, 0, color, transX, t
ransY, skPaint); | 2282 return gTextContext->createBatch(blob, info, textLen, 0, 0, color, transX, t
ransY, skPaint); |
| 2269 } | 2283 } |
| 2270 | 2284 |
| 2271 #endif | 2285 #endif |
| OLD | NEW |