| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 SkGlyphCache* GrAtlasTextBlob::setupCache(int runIndex, | 51 SkGlyphCache* GrAtlasTextBlob::setupCache(int runIndex, |
| 52 const SkSurfaceProps& props, | 52 const SkSurfaceProps& props, |
| 53 uint32_t scalerContextFlags, | 53 uint32_t scalerContextFlags, |
| 54 const SkPaint& skPaint, | 54 const SkPaint& skPaint, |
| 55 const SkMatrix* viewMatrix) { | 55 const SkMatrix* viewMatrix) { |
| 56 GrAtlasTextBlob::Run* run = &fRuns[runIndex]; | 56 GrAtlasTextBlob::Run* run = &fRuns[runIndex]; |
| 57 | 57 |
| 58 // if we have an override descriptor for the run, then we should use that | 58 // if we have an override descriptor for the run, then we should use that |
| 59 SkAutoDescriptor* desc = run->fOverrideDescriptor.get() ? run->fOverrideDesc
riptor.get() : | 59 SkAutoDescriptor* desc = run->fOverrideDescriptor.get() ? run->fOverrideDesc
riptor.get() : |
| 60 &run->fDescriptor; | 60 &run->fDescriptor; |
| 61 skPaint.getScalerContextDescriptor(&run->fEffects, desc, props, scalerContex
tFlags, viewMatrix); | 61 SkScalerContextEffects effects; |
| 62 skPaint.getScalerContextDescriptor(&effects, desc, props, scalerContextFlags
, viewMatrix); |
| 62 run->fTypeface.reset(SkSafeRef(skPaint.getTypeface())); | 63 run->fTypeface.reset(SkSafeRef(skPaint.getTypeface())); |
| 63 return SkGlyphCache::DetachCache(run->fTypeface, run->fEffects, desc->getDes
c()); | 64 run->fPathEffect = sk_ref_sp(effects.fPathEffect); |
| 65 run->fRasterizer = sk_ref_sp(effects.fRasterizer); |
| 66 run->fMaskFilter = sk_ref_sp(effects.fMaskFilter); |
| 67 return SkGlyphCache::DetachCache(run->fTypeface, effects, desc->getDesc()); |
| 64 } | 68 } |
| 65 | 69 |
| 66 void GrAtlasTextBlob::appendGlyph(int runIndex, | 70 void GrAtlasTextBlob::appendGlyph(int runIndex, |
| 67 const SkRect& positions, | 71 const SkRect& positions, |
| 68 GrColor color, | 72 GrColor color, |
| 69 GrBatchTextStrike* strike, | 73 GrBatchTextStrike* strike, |
| 70 GrGlyph* glyph, | 74 GrGlyph* glyph, |
| 71 SkGlyphCache* cache, const SkGlyph& skGlyph, | 75 SkGlyphCache* cache, const SkGlyph& skGlyph, |
| 72 SkScalar x, SkScalar y, SkScalar scale, bool a
pplyVM) { | 76 SkScalar x, SkScalar y, SkScalar scale, bool a
pplyVM) { |
| 73 | 77 |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 | 560 |
| 557 void GrAtlasTextBlob::Run::SubRunInfo::computeTranslation(const SkMatrix& viewMa
trix, | 561 void GrAtlasTextBlob::Run::SubRunInfo::computeTranslation(const SkMatrix& viewMa
trix, |
| 558 SkScalar x, SkScalar y
, SkScalar* transX, | 562 SkScalar x, SkScalar y
, SkScalar* transX, |
| 559 SkScalar* transY) { | 563 SkScalar* transY) { |
| 560 calculate_translation(!this->drawAsDistanceFields(), viewMatrix, x, y, | 564 calculate_translation(!this->drawAsDistanceFields(), viewMatrix, x, y, |
| 561 fCurrentViewMatrix, fX, fY, transX, transY); | 565 fCurrentViewMatrix, fX, fY, transX, transY); |
| 562 fCurrentViewMatrix = viewMatrix; | 566 fCurrentViewMatrix = viewMatrix; |
| 563 fX = x; | 567 fX = x; |
| 564 fY = y; | 568 fY = y; |
| 565 } | 569 } |
| OLD | NEW |