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 "GrBlurUtils.h" | 9 #include "GrBlurUtils.h" |
10 #include "GrDrawContext.h" | 10 #include "GrDrawContext.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 #endif | 48 #endif |
49 | 49 |
50 SkDEBUGCODE(static const int kExpectedDistanceAdjustTableSize = 8;) | 50 SkDEBUGCODE(static const int kExpectedDistanceAdjustTableSize = 8;) |
51 }; | 51 }; |
52 | 52 |
53 GrAtlasTextContext::GrAtlasTextContext(GrContext* context, const SkSurfaceProps&
surfaceProps) | 53 GrAtlasTextContext::GrAtlasTextContext(GrContext* context, const SkSurfaceProps&
surfaceProps) |
54 : INHERITED(context, surfaceProps) | 54 : INHERITED(context, surfaceProps) |
55 , fDistanceAdjustTable(new DistanceAdjustTable) { | 55 , fDistanceAdjustTable(new DistanceAdjustTable) { |
56 // We overallocate vertices in our textblobs based on the assumption that A8
has the greatest | 56 // We overallocate vertices in our textblobs based on the assumption that A8
has the greatest |
57 // vertexStride | 57 // vertexStride |
58 static_assert(GrAtlasTextBatch::kGrayTextVASize >= GrAtlasTextBatch::kColorT
extVASize && | 58 static_assert(GrAtlasTextBlob::kGrayTextVASize >= GrAtlasTextBlob::kColorTex
tVASize && |
59 GrAtlasTextBatch::kGrayTextVASize >= GrAtlasTextBatch::kLCDTex
tVASize, | 59 GrAtlasTextBlob::kGrayTextVASize >= GrAtlasTextBlob::kLCDTextV
ASize, |
60 "vertex_attribute_changed"); | 60 "vertex_attribute_changed"); |
61 fCurrStrike = nullptr; | 61 fCurrStrike = nullptr; |
62 fCache = context->getTextBlobCache(); | 62 fCache = context->getTextBlobCache(); |
63 } | 63 } |
64 | 64 |
65 void GrAtlasTextContext::DistanceAdjustTable::buildDistanceAdjustTable() { | 65 void GrAtlasTextContext::DistanceAdjustTable::buildDistanceAdjustTable() { |
66 | 66 |
67 // This is used for an approximation of the mask gamma hack, used by raster
and bitmap | 67 // This is used for an approximation of the mask gamma hack, used by raster
and bitmap |
68 // text. The mask gamma hack is based off of guessing what the blend color i
s going to | 68 // text. The mask gamma hack is based off of guessing what the blend color i
s going to |
69 // be, and adjusting the mask so that when run through the linear blend will | 69 // be, and adjusting the mask so that when run through the linear blend will |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 } | 342 } |
343 | 343 |
344 if (cacheBlob) { | 344 if (cacheBlob) { |
345 if (MustRegenerateBlob(&transX, &transY, *cacheBlob, skPaint, grPaint.ge
tColor(), blurRec, | 345 if (MustRegenerateBlob(&transX, &transY, *cacheBlob, skPaint, grPaint.ge
tColor(), blurRec, |
346 viewMatrix, x, y)) { | 346 viewMatrix, x, y)) { |
347 // We have to remake the blob because changes may invalidate our mas
ks. | 347 // We have to remake the blob because changes may invalidate our mas
ks. |
348 // TODO we could probably get away reuse most of the time if the poi
nter is unique, | 348 // TODO we could probably get away reuse most of the time if the poi
nter is unique, |
349 // but we'd have to clear the subrun information | 349 // but we'd have to clear the subrun information |
350 fCache->remove(cacheBlob); | 350 fCache->remove(cacheBlob); |
351 cacheBlob.reset(SkRef(fCache->createCachedBlob(blob, key, blurRec, s
kPaint, | 351 cacheBlob.reset(SkRef(fCache->createCachedBlob(blob, key, blurRec, s
kPaint, |
352 GrAtlasTextBatch::kGr
ayTextVASize))); | 352 GrAtlasTextBlob::kGra
yTextVASize))); |
353 this->regenerateTextBlob(cacheBlob, skPaint, grPaint.getColor(), vie
wMatrix, | 353 this->regenerateTextBlob(cacheBlob, skPaint, grPaint.getColor(), vie
wMatrix, |
354 blob, x, y, drawFilter, clip); | 354 blob, x, y, drawFilter, clip); |
355 } else { | 355 } else { |
356 // If we can reuse the blob, then make sure we update the blob's vie
wmatrix, and x/y | 356 // If we can reuse the blob, then make sure we update the blob's vie
wmatrix, and x/y |
357 // offsets. Note, we offset the vertex bounds right before flushing | 357 // offsets. Note, we offset the vertex bounds right before flushing |
358 cacheBlob->fViewMatrix = viewMatrix; | 358 cacheBlob->fViewMatrix = viewMatrix; |
359 cacheBlob->fX = x; | 359 cacheBlob->fX = x; |
360 cacheBlob->fY = y; | 360 cacheBlob->fY = y; |
361 fCache->makeMRU(cacheBlob); | 361 fCache->makeMRU(cacheBlob); |
362 #ifdef CACHE_SANITY_CHECK | 362 #ifdef CACHE_SANITY_CHECK |
363 { | 363 { |
364 int glyphCount = 0; | 364 int glyphCount = 0; |
365 int runCount = 0; | 365 int runCount = 0; |
366 GrTextBlobCache::BlobGlyphCount(&glyphCount, &runCount, blob); | 366 GrTextBlobCache::BlobGlyphCount(&glyphCount, &runCount, blob); |
367 SkAutoTUnref<GrAtlasTextBlob> sanityBlob(fCache->createBlob(glyp
hCount, runCount, | 367 SkAutoTUnref<GrAtlasTextBlob> sanityBlob(fCache->createBlob(glyp
hCount, runCount, |
368 kGra
yTextVASize)); | 368 kGra
yTextVASize)); |
369 GrTextBlobCache::SetupCacheBlobKey(sanityBlob, key, blurRec, skP
aint); | 369 GrTextBlobCache::SetupCacheBlobKey(sanityBlob, key, blurRec, skP
aint); |
370 this->regenerateTextBlob(sanityBlob, skPaint, grPaint.getColor()
, viewMatrix, | 370 this->regenerateTextBlob(sanityBlob, skPaint, grPaint.getColor()
, viewMatrix, |
371 blob, x, y, drawFilter, clip); | 371 blob, x, y, drawFilter, clip); |
372 GrAtlasTextBlob::AssertEqual(*sanityBlob, *cacheBlob); | 372 GrAtlasTextBlob::AssertEqual(*sanityBlob, *cacheBlob); |
373 } | 373 } |
374 | 374 |
375 #endif | 375 #endif |
376 } | 376 } |
377 } else { | 377 } else { |
378 if (canCache) { | 378 if (canCache) { |
379 cacheBlob.reset(SkRef(fCache->createCachedBlob(blob, key, blurRec, s
kPaint, | 379 cacheBlob.reset(SkRef(fCache->createCachedBlob(blob, key, blurRec, s
kPaint, |
380 GrAtlasTextBatch::kGr
ayTextVASize))); | 380 GrAtlasTextBlob::kGra
yTextVASize))); |
381 } else { | 381 } else { |
382 cacheBlob.reset(fCache->createBlob(blob, GrAtlasTextBatch::kGrayText
VASize)); | 382 cacheBlob.reset(fCache->createBlob(blob, GrAtlasTextBlob::kGrayTextV
ASize)); |
383 } | 383 } |
384 this->regenerateTextBlob(cacheBlob, skPaint, grPaint.getColor(), viewMat
rix, | 384 this->regenerateTextBlob(cacheBlob, skPaint, grPaint.getColor(), viewMat
rix, |
385 blob, x, y, drawFilter, clip); | 385 blob, x, y, drawFilter, clip); |
386 } | 386 } |
387 | 387 |
388 this->flush(blob, cacheBlob, dc, skPaint, grPaint, drawFilter, | 388 this->flush(blob, cacheBlob, dc, skPaint, grPaint, drawFilter, |
389 clip, viewMatrix, clipBounds, x, y, transX, transY); | 389 clip, viewMatrix, clipBounds, x, y, transX, transY); |
390 } | 390 } |
391 | 391 |
392 inline bool GrAtlasTextContext::canDrawAsDistanceFields(const SkPaint& skPaint, | 392 inline bool GrAtlasTextContext::canDrawAsDistanceFields(const SkPaint& skPaint, |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 this->internalDrawBMPPosText(blob, runIndex, cache, skPaint, color, viewMatr
ix, | 617 this->internalDrawBMPPosText(blob, runIndex, cache, skPaint, color, viewMatr
ix, |
618 fallbackTxt.begin(), fallbackTxt.count(), | 618 fallbackTxt.begin(), fallbackTxt.count(), |
619 fallbackPos.begin(), scalarsPerPosition, offset
); | 619 fallbackPos.begin(), scalarsPerPosition, offset
); |
620 SkGlyphCache::AttachCache(cache); | 620 SkGlyphCache::AttachCache(cache); |
621 } | 621 } |
622 | 622 |
623 inline GrAtlasTextBlob* | 623 inline GrAtlasTextBlob* |
624 GrAtlasTextContext::setupDFBlob(int glyphCount, const SkPaint& origPaint, | 624 GrAtlasTextContext::setupDFBlob(int glyphCount, const SkPaint& origPaint, |
625 const SkMatrix& viewMatrix, SkPaint* dfPaint, | 625 const SkMatrix& viewMatrix, SkPaint* dfPaint, |
626 SkScalar* textRatio) { | 626 SkScalar* textRatio) { |
627 GrAtlasTextBlob* blob = fCache->createBlob(glyphCount, 1, GrAtlasTextBatch::
kGrayTextVASize); | 627 GrAtlasTextBlob* blob = fCache->createBlob(glyphCount, 1, GrAtlasTextBlob::k
GrayTextVASize); |
628 | 628 |
629 *dfPaint = origPaint; | 629 *dfPaint = origPaint; |
630 this->initDistanceFieldPaint(blob, dfPaint, textRatio, viewMatrix); | 630 this->initDistanceFieldPaint(blob, dfPaint, textRatio, viewMatrix); |
631 blob->fViewMatrix = viewMatrix; | 631 blob->fViewMatrix = viewMatrix; |
632 Run& run = blob->fRuns[0]; | 632 Run& run = blob->fRuns[0]; |
633 PerSubRunInfo& subRun = run.fSubRunInfo.back(); | 633 PerSubRunInfo& subRun = run.fSubRunInfo.back(); |
634 subRun.setUseLCDText(origPaint.isLCDRenderText()); | 634 subRun.setUseLCDText(origPaint.isLCDRenderText()); |
635 subRun.setDrawAsDistanceFields(); | 635 subRun.setDrawAsDistanceFields(); |
636 | 636 |
637 return blob; | 637 return blob; |
(...skipping 17 matching lines...) Expand all Loading... |
655 SkTDArray<SkScalar> fallbackPos; | 655 SkTDArray<SkScalar> fallbackPos; |
656 SkPoint offset; | 656 SkPoint offset; |
657 this->internalDrawDFText(blob, 0, dfPaint, paint.getColor(), viewMatrix,
text, | 657 this->internalDrawDFText(blob, 0, dfPaint, paint.getColor(), viewMatrix,
text, |
658 byteLength, x, y, textRatio, &fallbackTxt, &fal
lbackPos, | 658 byteLength, x, y, textRatio, &fallbackTxt, &fal
lbackPos, |
659 &offset, skPaint); | 659 &offset, skPaint); |
660 if (fallbackTxt.count()) { | 660 if (fallbackTxt.count()) { |
661 this->fallbackDrawPosText(blob, 0, clip, paint.getColor(), skPaint,
viewMatrix, | 661 this->fallbackDrawPosText(blob, 0, clip, paint.getColor(), skPaint,
viewMatrix, |
662 fallbackTxt, fallbackPos, 2, offset); | 662 fallbackTxt, fallbackPos, 2, offset); |
663 } | 663 } |
664 } else { | 664 } else { |
665 blob = fCache->createBlob(glyphCount, 1, GrAtlasTextBatch::kGrayTextVASi
ze); | 665 blob = fCache->createBlob(glyphCount, 1, GrAtlasTextBlob::kGrayTextVASiz
e); |
666 blob->fViewMatrix = viewMatrix; | 666 blob->fViewMatrix = viewMatrix; |
667 | 667 |
668 SkGlyphCache* cache = this->setupCache(&blob->fRuns[0], skPaint, &viewMa
trix, false); | 668 SkGlyphCache* cache = this->setupCache(&blob->fRuns[0], skPaint, &viewMa
trix, false); |
669 this->internalDrawBMPText(blob, 0, cache, skPaint, paint.getColor(), vie
wMatrix, text, | 669 this->internalDrawBMPText(blob, 0, cache, skPaint, paint.getColor(), vie
wMatrix, text, |
670 byteLength, x, y); | 670 byteLength, x, y); |
671 SkGlyphCache::AttachCache(cache); | 671 SkGlyphCache::AttachCache(cache); |
672 } | 672 } |
673 return blob; | 673 return blob; |
674 } | 674 } |
675 | 675 |
(...skipping 15 matching lines...) Expand all Loading... |
691 SkTDArray<char> fallbackTxt; | 691 SkTDArray<char> fallbackTxt; |
692 SkTDArray<SkScalar> fallbackPos; | 692 SkTDArray<SkScalar> fallbackPos; |
693 this->internalDrawDFPosText(blob, 0, dfPaint, paint.getColor(), viewMatr
ix, text, | 693 this->internalDrawDFPosText(blob, 0, dfPaint, paint.getColor(), viewMatr
ix, text, |
694 byteLength, pos, scalarsPerPosition, offset, | 694 byteLength, pos, scalarsPerPosition, offset, |
695 textRatio, &fallbackTxt, &fallbackPos); | 695 textRatio, &fallbackTxt, &fallbackPos); |
696 if (fallbackTxt.count()) { | 696 if (fallbackTxt.count()) { |
697 this->fallbackDrawPosText(blob, 0, clip, paint.getColor(), skPaint,
viewMatrix, | 697 this->fallbackDrawPosText(blob, 0, clip, paint.getColor(), skPaint,
viewMatrix, |
698 fallbackTxt, fallbackPos, scalarsPerPositi
on, offset); | 698 fallbackTxt, fallbackPos, scalarsPerPositi
on, offset); |
699 } | 699 } |
700 } else { | 700 } else { |
701 blob = fCache->createBlob(glyphCount, 1, GrAtlasTextBatch::kGrayTextVASi
ze); | 701 blob = fCache->createBlob(glyphCount, 1, GrAtlasTextBlob::kGrayTextVASiz
e); |
702 blob->fViewMatrix = viewMatrix; | 702 blob->fViewMatrix = viewMatrix; |
703 SkGlyphCache* cache = this->setupCache(&blob->fRuns[0], skPaint, &viewMa
trix, false); | 703 SkGlyphCache* cache = this->setupCache(&blob->fRuns[0], skPaint, &viewMa
trix, false); |
704 this->internalDrawBMPPosText(blob, 0, cache, skPaint, paint.getColor(),
viewMatrix, text, | 704 this->internalDrawBMPPosText(blob, 0, cache, skPaint, paint.getColor(),
viewMatrix, text, |
705 byteLength, pos, scalarsPerPosition, offset
); | 705 byteLength, pos, scalarsPerPosition, offset
); |
706 SkGlyphCache::AttachCache(cache); | 706 SkGlyphCache::AttachCache(cache); |
707 } | 707 } |
708 return blob; | 708 return blob; |
709 } | 709 } |
710 | 710 |
711 void GrAtlasTextContext::onDrawText(GrDrawContext* dc, | 711 void GrAtlasTextContext::onDrawText(GrDrawContext* dc, |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
960 pos += scalarsPerPosition; | 960 pos += scalarsPerPosition; |
961 } | 961 } |
962 } | 962 } |
963 | 963 |
964 SkGlyphCache::AttachCache(cache); | 964 SkGlyphCache::AttachCache(cache); |
965 } | 965 } |
966 | 966 |
967 void GrAtlasTextContext::bmpAppendGlyph(GrAtlasTextBlob* blob, int runIndex, | 967 void GrAtlasTextContext::bmpAppendGlyph(GrAtlasTextBlob* blob, int runIndex, |
968 const SkGlyph& skGlyph, | 968 const SkGlyph& skGlyph, |
969 int vx, int vy, GrColor color, GrFontSca
ler* scaler) { | 969 int vx, int vy, GrColor color, GrFontSca
ler* scaler) { |
970 Run& run = blob->fRuns[runIndex]; | |
971 if (!fCurrStrike) { | 970 if (!fCurrStrike) { |
972 fCurrStrike = fContext->getBatchFontCache()->getStrike(scaler); | 971 fCurrStrike = fContext->getBatchFontCache()->getStrike(scaler); |
973 } | 972 } |
974 | 973 |
975 GrGlyph::PackedID id = GrGlyph::Pack(skGlyph.getGlyphID(), | 974 GrGlyph::PackedID id = GrGlyph::Pack(skGlyph.getGlyphID(), |
976 skGlyph.getSubXFixed(), | 975 skGlyph.getSubXFixed(), |
977 skGlyph.getSubYFixed(), | 976 skGlyph.getSubYFixed(), |
978 GrGlyph::kCoverage_MaskStyle); | 977 GrGlyph::kCoverage_MaskStyle); |
979 GrGlyph* glyph = fCurrStrike->getGlyph(skGlyph, id, scaler); | 978 GrGlyph* glyph = fCurrStrike->getGlyph(skGlyph, id, scaler); |
980 if (!glyph) { | 979 if (!glyph) { |
981 return; | 980 return; |
982 } | 981 } |
983 | 982 |
984 int x = vx + glyph->fBounds.fLeft; | 983 int x = vx + glyph->fBounds.fLeft; |
985 int y = vy + glyph->fBounds.fTop; | 984 int y = vy + glyph->fBounds.fTop; |
986 | 985 |
987 // keep them as ints until we've done the clip-test | 986 // keep them as ints until we've done the clip-test |
988 int width = glyph->fBounds.width(); | 987 int width = glyph->fBounds.width(); |
989 int height = glyph->fBounds.height(); | 988 int height = glyph->fBounds.height(); |
990 | 989 |
991 // If the glyph is too large we fall back to paths | 990 // If the glyph is too large we fall back to paths |
992 if (glyph->fTooLargeForAtlas) { | 991 if (glyph->fTooLargeForAtlas) { |
993 this->appendGlyphPath(blob, glyph, scaler, skGlyph, SkIntToScalar(vx), S
kIntToScalar(vy)); | 992 this->appendGlyphPath(blob, glyph, scaler, skGlyph, SkIntToScalar(vx), S
kIntToScalar(vy)); |
994 return; | 993 return; |
995 } | 994 } |
996 | 995 |
997 GrMaskFormat format = glyph->fMaskFormat; | |
998 | |
999 PerSubRunInfo* subRun = &run.fSubRunInfo.back(); | |
1000 if (run.fInitialized && subRun->maskFormat() != format) { | |
1001 subRun = &run.push_back(); | |
1002 subRun->setStrike(fCurrStrike); | |
1003 } else if (!run.fInitialized) { | |
1004 subRun->setStrike(fCurrStrike); | |
1005 } | |
1006 | |
1007 run.fInitialized = true; | |
1008 | |
1009 size_t vertexStride = GrAtlasTextBatch::GetVertexStride(format); | |
1010 | |
1011 SkRect r; | 996 SkRect r; |
1012 r.fLeft = SkIntToScalar(x); | 997 r.fLeft = SkIntToScalar(x); |
1013 r.fTop = SkIntToScalar(y); | 998 r.fTop = SkIntToScalar(y); |
1014 r.fRight = r.fLeft + SkIntToScalar(width); | 999 r.fRight = r.fLeft + SkIntToScalar(width); |
1015 r.fBottom = r.fTop + SkIntToScalar(height); | 1000 r.fBottom = r.fTop + SkIntToScalar(height); |
1016 subRun->setMaskFormat(format); | 1001 |
1017 blob->appendGlyph(&run, subRun, r, color, vertexStride, | 1002 blob->appendGlyph(runIndex, r, color, fCurrStrike, glyph); |
1018 kARGB_GrMaskFormat != format, glyph); | |
1019 } | 1003 } |
1020 | 1004 |
1021 bool GrAtlasTextContext::dfAppendGlyph(GrAtlasTextBlob* blob, int runIndex, | 1005 bool GrAtlasTextContext::dfAppendGlyph(GrAtlasTextBlob* blob, int runIndex, |
1022 const SkGlyph& skGlyph, | 1006 const SkGlyph& skGlyph, |
1023 SkScalar sx, SkScalar sy, GrColor color, | 1007 SkScalar sx, SkScalar sy, GrColor color, |
1024 GrFontScaler* scaler, | 1008 GrFontScaler* scaler, |
1025 SkScalar textRatio, const SkMatrix& viewM
atrix) { | 1009 SkScalar textRatio, const SkMatrix& viewM
atrix) { |
1026 Run& run = blob->fRuns[runIndex]; | |
1027 if (!fCurrStrike) { | 1010 if (!fCurrStrike) { |
1028 fCurrStrike = fContext->getBatchFontCache()->getStrike(scaler); | 1011 fCurrStrike = fContext->getBatchFontCache()->getStrike(scaler); |
1029 } | 1012 } |
1030 | 1013 |
1031 GrGlyph::PackedID id = GrGlyph::Pack(skGlyph.getGlyphID(), | 1014 GrGlyph::PackedID id = GrGlyph::Pack(skGlyph.getGlyphID(), |
1032 skGlyph.getSubXFixed(), | 1015 skGlyph.getSubXFixed(), |
1033 skGlyph.getSubYFixed(), | 1016 skGlyph.getSubYFixed(), |
1034 GrGlyph::kDistance_MaskStyle); | 1017 GrGlyph::kDistance_MaskStyle); |
1035 GrGlyph* glyph = fCurrStrike->getGlyph(skGlyph, id, scaler); | 1018 GrGlyph* glyph = fCurrStrike->getGlyph(skGlyph, id, scaler); |
1036 if (!glyph) { | 1019 if (!glyph) { |
(...skipping 19 matching lines...) Expand all Loading... |
1056 sy += dy; | 1039 sy += dy; |
1057 SkRect glyphRect = SkRect::MakeXYWH(sx, sy, width, height); | 1040 SkRect glyphRect = SkRect::MakeXYWH(sx, sy, width, height); |
1058 | 1041 |
1059 // TODO combine with the above | 1042 // TODO combine with the above |
1060 // If the glyph is too large we fall back to paths | 1043 // If the glyph is too large we fall back to paths |
1061 if (glyph->fTooLargeForAtlas) { | 1044 if (glyph->fTooLargeForAtlas) { |
1062 this->appendGlyphPath(blob, glyph, scaler, skGlyph, sx - dx, sy - dy, sc
ale, true); | 1045 this->appendGlyphPath(blob, glyph, scaler, skGlyph, sx - dx, sy - dy, sc
ale, true); |
1063 return true; | 1046 return true; |
1064 } | 1047 } |
1065 | 1048 |
1066 PerSubRunInfo* subRun = &run.fSubRunInfo.back(); | 1049 blob->appendGlyph(runIndex, glyphRect, color, fCurrStrike, glyph); |
1067 if (!run.fInitialized) { | |
1068 subRun->setStrike(fCurrStrike); | |
1069 } | |
1070 run.fInitialized = true; | |
1071 SkASSERT(glyph->fMaskFormat == kA8_GrMaskFormat); | |
1072 subRun->setMaskFormat(kA8_GrMaskFormat); | |
1073 | |
1074 size_t vertexStride = GrAtlasTextBatch::GetVertexStride(kA8_GrMaskFormat); | |
1075 | |
1076 blob->appendGlyph(&run, subRun, glyphRect, color, vertexStride, true, glyph)
; | |
1077 return true; | 1050 return true; |
1078 } | 1051 } |
1079 | 1052 |
1080 inline void GrAtlasTextContext::appendGlyphPath(GrAtlasTextBlob* blob, GrGlyph*
glyph, | 1053 inline void GrAtlasTextContext::appendGlyphPath(GrAtlasTextBlob* blob, GrGlyph*
glyph, |
1081 GrFontScaler* scaler, const SkGl
yph& skGlyph, | 1054 GrFontScaler* scaler, const SkGl
yph& skGlyph, |
1082 SkScalar x, SkScalar y, SkScalar
scale, | 1055 SkScalar x, SkScalar y, SkScalar
scale, |
1083 bool applyVM) { | 1056 bool applyVM) { |
1084 if (nullptr == glyph->fPath) { | 1057 if (nullptr == glyph->fPath) { |
1085 const SkPath* glyphPath = scaler->getGlyphPath(skGlyph); | 1058 const SkPath* glyphPath = scaler->getGlyphPath(skGlyph); |
1086 if (!glyphPath) { | 1059 if (!glyphPath) { |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1311 gTextContext->createDrawTextBlob(clip, grPaint, skPaint, viewMatrix,
text, | 1284 gTextContext->createDrawTextBlob(clip, grPaint, skPaint, viewMatrix,
text, |
1312 static_cast<size_t>(textLen), 0, 0,
noClip)); | 1285 static_cast<size_t>(textLen), 0, 0,
noClip)); |
1313 | 1286 |
1314 SkScalar transX = static_cast<SkScalar>(random->nextU()); | 1287 SkScalar transX = static_cast<SkScalar>(random->nextU()); |
1315 SkScalar transY = static_cast<SkScalar>(random->nextU()); | 1288 SkScalar transY = static_cast<SkScalar>(random->nextU()); |
1316 const GrAtlasTextBlob::Run::SubRunInfo& info = blob->fRuns[0].fSubRunInfo[0]
; | 1289 const GrAtlasTextBlob::Run::SubRunInfo& info = blob->fRuns[0].fSubRunInfo[0]
; |
1317 return gTextContext->createBatch(blob, info, textLen, 0, 0, color, transX, t
ransY, skPaint); | 1290 return gTextContext->createBatch(blob, info, textLen, 0, 0, color, transX, t
ransY, skPaint); |
1318 } | 1291 } |
1319 | 1292 |
1320 #endif | 1293 #endif |
OLD | NEW |