| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 SkPaint::FakeGamma fakeGamma, |
| 55 const SkPaint& skPaint, | 55 const SkPaint& skPaint, |
| 56 const SkMatrix* viewMatrix) { | 56 const SkMatrix* viewMatrix) { |
| 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, fakeGamma, viewMatrix); | 62 SkScalerContextEffects effects; |
| 63 skPaint.getScalerContextDescriptor(desc, &run->fEffects, props, fakeGamma, v
iewMatrix); |
| 63 run->fTypeface.reset(SkSafeRef(skPaint.getTypeface())); | 64 run->fTypeface.reset(SkSafeRef(skPaint.getTypeface())); |
| 64 return SkGlyphCache::DetachCache(run->fTypeface, desc->getDesc()); | 65 return SkGlyphCache::DetachCache(run->fTypeface, run->fEffects, desc->getDes
c()); |
| 65 } | 66 } |
| 66 | 67 |
| 67 void GrAtlasTextBlob::appendGlyph(int runIndex, | 68 void GrAtlasTextBlob::appendGlyph(int runIndex, |
| 68 const SkRect& positions, | 69 const SkRect& positions, |
| 69 GrColor color, | 70 GrColor color, |
| 70 GrBatchTextStrike* strike, | 71 GrBatchTextStrike* strike, |
| 71 GrGlyph* glyph, | 72 GrGlyph* glyph, |
| 72 GrFontScaler* scaler, const SkGlyph& skGlyph, | 73 GrFontScaler* scaler, const SkGlyph& skGlyph, |
| 73 SkScalar x, SkScalar y, SkScalar scale, bool a
pplyVM) { | 74 SkScalar x, SkScalar y, SkScalar scale, bool a
pplyVM) { |
| 74 | 75 |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 | 555 |
| 555 void GrAtlasTextBlob::Run::SubRunInfo::computeTranslation(const SkMatrix& viewMa
trix, | 556 void GrAtlasTextBlob::Run::SubRunInfo::computeTranslation(const SkMatrix& viewMa
trix, |
| 556 SkScalar x, SkScalar y
, SkScalar* transX, | 557 SkScalar x, SkScalar y
, SkScalar* transX, |
| 557 SkScalar* transY) { | 558 SkScalar* transY) { |
| 558 calculate_translation(!this->drawAsDistanceFields(), viewMatrix, x, y, | 559 calculate_translation(!this->drawAsDistanceFields(), viewMatrix, x, y, |
| 559 fCurrentViewMatrix, fX, fY, transX, transY); | 560 fCurrentViewMatrix, fX, fY, transX, transY); |
| 560 fCurrentViewMatrix = viewMatrix; | 561 fCurrentViewMatrix = viewMatrix; |
| 561 fX = x; | 562 fX = x; |
| 562 fY = y; | 563 fY = y; |
| 563 } | 564 } |
| OLD | NEW |