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" |
(...skipping 1655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1666 for (int glyphIdx = 0; glyphIdx < glyphCount; glyphIdx++) { | 1666 for (int glyphIdx = 0; glyphIdx < glyphCount; glyphIdx++) { |
1667 if (regenerateTextureCoords) { | 1667 if (regenerateTextureCoords) { |
1668 size_t glyphOffset = glyphIdx + info.fGlyphStartIndex; | 1668 size_t glyphOffset = glyphIdx + info.fGlyphStartIndex; |
1669 | 1669 |
1670 GrGlyph* glyph = blob->fGlyphs[glyphOffset]; | 1670 GrGlyph* glyph = blob->fGlyphs[glyphOffset]; |
1671 GrGlyph::PackedID id = glyph->fPackedID; | 1671 GrGlyph::PackedID id = glyph->fPackedID; |
1672 const SkGlyph& skGlyph = scaler->grToSkGlyph(id); | 1672 const SkGlyph& skGlyph = scaler->grToSkGlyph(id); |
1673 if (regenerateGlyphs) { | 1673 if (regenerateGlyphs) { |
1674 // Get the id from the old glyph, and use the new st
rike to lookup | 1674 // Get the id from the old glyph, and use the new st
rike to lookup |
1675 // the glyph. | 1675 // the glyph. |
1676 blob->fGlyphs[glyphOffset] = strike->getGlyph(skGlyp
h, id, scaler); | 1676 blob->fGlyphs[glyphOffset] = strike->getGlyph(skGlyp
h, id, maskFormat, |
| 1677 scaler
); |
1677 } | 1678 } |
1678 glyph = blob->fGlyphs[glyphOffset]; | 1679 glyph = blob->fGlyphs[glyphOffset]; |
1679 SkASSERT(glyph); | 1680 SkASSERT(glyph); |
1680 SkASSERT(id == glyph->fPackedID && | 1681 SkASSERT(id == glyph->fPackedID && |
1681 glyph->fMaskFormat == this->maskFormat()); | 1682 glyph->fMaskFormat == this->maskFormat()); |
1682 | 1683 |
1683 if (!fFontCache->hasGlyph(glyph) && | 1684 if (!fFontCache->hasGlyph(glyph) && |
1684 !strike->addGlyphToAtlas(batchTarget, glyph, scaler,
skGlyph, | 1685 !strike->addGlyphToAtlas(batchTarget, glyph, scaler,
skGlyph, |
1685 maskFormat)) { | 1686 maskFormat)) { |
1686 this->flush(batchTarget, &flushInfo); | 1687 this->flush(batchTarget, &flushInfo); |
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2274 gTextContext->createDrawTextBlob(rt, clip, grPaint, skPaint, viewMat
rix, text, | 2275 gTextContext->createDrawTextBlob(rt, clip, grPaint, skPaint, viewMat
rix, text, |
2275 static_cast<size_t>(textLen), 0, 0,
noClip)); | 2276 static_cast<size_t>(textLen), 0, 0,
noClip)); |
2276 | 2277 |
2277 SkScalar transX = static_cast<SkScalar>(random->nextU()); | 2278 SkScalar transX = static_cast<SkScalar>(random->nextU()); |
2278 SkScalar transY = static_cast<SkScalar>(random->nextU()); | 2279 SkScalar transY = static_cast<SkScalar>(random->nextU()); |
2279 const GrAtlasTextBlob::Run::SubRunInfo& info = blob->fRuns[0].fSubRunInfo[0]
; | 2280 const GrAtlasTextBlob::Run::SubRunInfo& info = blob->fRuns[0].fSubRunInfo[0]
; |
2280 return gTextContext->createBatch(blob, info, textLen, 0, 0, color, transX, t
ransY, skPaint); | 2281 return gTextContext->createBatch(blob, info, textLen, 0, 0, color, transX, t
ransY, skPaint); |
2281 } | 2282 } |
2282 | 2283 |
2283 #endif | 2284 #endif |
OLD | NEW |