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 uint32_t scalerContextFlags, |
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 skPaint.getScalerContextDescriptor(desc, props, scalerContextFlags, viewMatr
ix); |
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 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 | 554 |
555 void GrAtlasTextBlob::Run::SubRunInfo::computeTranslation(const SkMatrix& viewMa
trix, | 555 void GrAtlasTextBlob::Run::SubRunInfo::computeTranslation(const SkMatrix& viewMa
trix, |
556 SkScalar x, SkScalar y
, SkScalar* transX, | 556 SkScalar x, SkScalar y
, SkScalar* transX, |
557 SkScalar* transY) { | 557 SkScalar* transY) { |
558 calculate_translation(!this->drawAsDistanceFields(), viewMatrix, x, y, | 558 calculate_translation(!this->drawAsDistanceFields(), viewMatrix, x, y, |
559 fCurrentViewMatrix, fX, fY, transX, transY); | 559 fCurrentViewMatrix, fX, fY, transX, transY); |
560 fCurrentViewMatrix = viewMatrix; | 560 fCurrentViewMatrix = viewMatrix; |
561 fX = x; | 561 fX = x; |
562 fY = y; | 562 fY = y; |
563 } | 563 } |
OLD | NEW |