| 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" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 new (&cacheBlob->fRuns[i]) GrAtlasTextBlob::Run; | 44 new (&cacheBlob->fRuns[i]) GrAtlasTextBlob::Run; |
| 45 } | 45 } |
| 46 cacheBlob->fRunCount = runCount; | 46 cacheBlob->fRunCount = runCount; |
| 47 cacheBlob->fPool = pool; | 47 cacheBlob->fPool = pool; |
| 48 return cacheBlob; | 48 return cacheBlob; |
| 49 } | 49 } |
| 50 | 50 |
| 51 | 51 |
| 52 SkGlyphCache* GrAtlasTextBlob::setupCache(int runIndex, | 52 SkGlyphCache* GrAtlasTextBlob::setupCache(int runIndex, |
| 53 const SkSurfaceProps& props, | 53 const SkSurfaceProps& props, |
| 54 SkPaint::FakeGamma fakeGamma, |
| 54 const SkPaint& skPaint, | 55 const SkPaint& skPaint, |
| 55 const SkMatrix* viewMatrix, | 56 const SkMatrix* viewMatrix) { |
| 56 bool noGamma) { | |
| 57 GrAtlasTextBlob::Run* run = &fRuns[runIndex]; | 57 GrAtlasTextBlob::Run* run = &fRuns[runIndex]; |
| 58 | 58 |
| 59 // if we have an override descriptor for the run, then we should use that | 59 // if we have an override descriptor for the run, then we should use that |
| 60 SkAutoDescriptor* desc = run->fOverrideDescriptor.get() ? run->fOverrideDesc
riptor.get() : | 60 SkAutoDescriptor* desc = run->fOverrideDescriptor.get() ? run->fOverrideDesc
riptor.get() : |
| 61 &run->fDescriptor; | 61 &run->fDescriptor; |
| 62 skPaint.getScalerContextDescriptor(desc, props, viewMatrix, noGamma); | 62 skPaint.getScalerContextDescriptor(desc, props, fakeGamma, viewMatrix); |
| 63 run->fTypeface.reset(SkSafeRef(skPaint.getTypeface())); | 63 run->fTypeface.reset(SkSafeRef(skPaint.getTypeface())); |
| 64 return SkGlyphCache::DetachCache(run->fTypeface, desc->getDesc()); | 64 return SkGlyphCache::DetachCache(run->fTypeface, desc->getDesc()); |
| 65 } | 65 } |
| 66 | 66 |
| 67 void GrAtlasTextBlob::appendGlyph(int runIndex, | 67 void GrAtlasTextBlob::appendGlyph(int runIndex, |
| 68 const SkRect& positions, | 68 const SkRect& positions, |
| 69 GrColor color, | 69 GrColor color, |
| 70 GrBatchTextStrike* strike, | 70 GrBatchTextStrike* strike, |
| 71 GrGlyph* glyph, | 71 GrGlyph* glyph, |
| 72 GrFontScaler* scaler, const SkGlyph& skGlyph, | 72 GrFontScaler* scaler, const SkGlyph& skGlyph, |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 533 SkASSERT_RELEASE(lSubRun.vertexStartIndex() == rSubRun.vertexStartIn
dex()); | 533 SkASSERT_RELEASE(lSubRun.vertexStartIndex() == rSubRun.vertexStartIn
dex()); |
| 534 SkASSERT_RELEASE(lSubRun.vertexEndIndex() == rSubRun.vertexEndIndex(
)); | 534 SkASSERT_RELEASE(lSubRun.vertexEndIndex() == rSubRun.vertexEndIndex(
)); |
| 535 SkASSERT_RELEASE(lSubRun.glyphStartIndex() == rSubRun.glyphStartInde
x()); | 535 SkASSERT_RELEASE(lSubRun.glyphStartIndex() == rSubRun.glyphStartInde
x()); |
| 536 SkASSERT_RELEASE(lSubRun.glyphEndIndex() == rSubRun.glyphEndIndex())
; | 536 SkASSERT_RELEASE(lSubRun.glyphEndIndex() == rSubRun.glyphEndIndex())
; |
| 537 SkASSERT_RELEASE(lSubRun.maskFormat() == rSubRun.maskFormat()); | 537 SkASSERT_RELEASE(lSubRun.maskFormat() == rSubRun.maskFormat()); |
| 538 SkASSERT_RELEASE(lSubRun.drawAsDistanceFields() == rSubRun.drawAsDis
tanceFields()); | 538 SkASSERT_RELEASE(lSubRun.drawAsDistanceFields() == rSubRun.drawAsDis
tanceFields()); |
| 539 SkASSERT_RELEASE(lSubRun.hasUseLCDText() == rSubRun.hasUseLCDText())
; | 539 SkASSERT_RELEASE(lSubRun.hasUseLCDText() == rSubRun.hasUseLCDText())
; |
| 540 } | 540 } |
| 541 } | 541 } |
| 542 } | 542 } |
| OLD | NEW |