| 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 | 7 |
| 8 #include "GrAtlasTextBlob.h" | 8 #include "GrAtlasTextBlob.h" |
| 9 | 9 |
| 10 #include "GrBlurUtils.h" | 10 #include "GrBlurUtils.h" |
| 11 #include "GrContext.h" | 11 #include "GrContext.h" |
| 12 #include "GrDrawContext.h" | 12 #include "GrDrawContext.h" |
| 13 #include "GrTextUtils.h" | 13 #include "GrTextUtils.h" |
| 14 #include "SkColorFilter.h" | 14 #include "SkColorFilter.h" |
| 15 #include "SkDrawFilter.h" | 15 #include "SkDrawFilter.h" |
| 16 #include "SkGlyphCache.h" | |
| 17 #include "SkTextBlobRunIterator.h" | 16 #include "SkTextBlobRunIterator.h" |
| 18 #include "batches/GrAtlasTextBatch.h" | 17 #include "batches/GrAtlasTextBatch.h" |
| 19 | 18 |
| 20 SkGlyphCache* GrAtlasTextBlob::setupCache(int runIndex, | |
| 21 const SkSurfaceProps& props, | |
| 22 const SkPaint& skPaint, | |
| 23 const SkMatrix* viewMatrix, | |
| 24 bool noGamma) { | |
| 25 GrAtlasTextBlob::Run* run = &fRuns[runIndex]; | |
| 26 | |
| 27 // if we have an override descriptor for the run, then we should use that | |
| 28 SkAutoDescriptor* desc = run->fOverrideDescriptor.get() ? run->fOverrideDesc
riptor.get() : | |
| 29 &run->fDescriptor; | |
| 30 skPaint.getScalerContextDescriptor(desc, props, viewMatrix, noGamma); | |
| 31 run->fTypeface.reset(SkSafeRef(skPaint.getTypeface())); | |
| 32 return SkGlyphCache::DetachCache(run->fTypeface, desc->getDesc()); | |
| 33 } | |
| 34 | |
| 35 void GrAtlasTextBlob::appendGlyph(int runIndex, | 19 void GrAtlasTextBlob::appendGlyph(int runIndex, |
| 36 const SkRect& positions, | 20 const SkRect& positions, |
| 37 GrColor color, | 21 GrColor color, |
| 38 GrBatchTextStrike* strike, | 22 GrBatchTextStrike* strike, |
| 39 GrGlyph* glyph, | 23 GrGlyph* glyph, |
| 40 GrFontScaler* scaler, const SkGlyph& skGlyph, | 24 GrFontScaler* scaler, const SkGlyph& skGlyph, |
| 41 SkScalar x, SkScalar y, SkScalar scale, bool a
pplyVM) { | 25 SkScalar x, SkScalar y, SkScalar scale, bool a
pplyVM) { |
| 42 | 26 |
| 43 // If the glyph is too large we fall back to paths | 27 // If the glyph is too large we fall back to paths |
| 44 if (glyph->fTooLargeForAtlas) { | 28 if (glyph->fTooLargeForAtlas) { |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 rSubRun.fBulkUseToken.fPlotAlreadyUpdated); | 491 rSubRun.fBulkUseToken.fPlotAlreadyUpdated); |
| 508 for (int k = 0; k < lSubRun.fBulkUseToken.fPlotsToUpdate.count(); k+
+) { | 492 for (int k = 0; k < lSubRun.fBulkUseToken.fPlotsToUpdate.count(); k+
+) { |
| 509 SkASSERT(lSubRun.fBulkUseToken.fPlotsToUpdate[k] == | 493 SkASSERT(lSubRun.fBulkUseToken.fPlotsToUpdate[k] == |
| 510 rSubRun.fBulkUseToken.fPlotsToUpdate[k]); | 494 rSubRun.fBulkUseToken.fPlotsToUpdate[k]); |
| 511 }*/ | 495 }*/ |
| 512 } | 496 } |
| 513 } | 497 } |
| 514 } | 498 } |
| 515 | 499 |
| 516 #endif | 500 #endif |
| OLD | NEW |