OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "GrPathRendering.h" | 8 #include "GrPathRendering.h" |
9 #include "SkDescriptor.h" | 9 #include "SkDescriptor.h" |
10 #include "SkGlyph.h" | 10 #include "SkGlyph.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 } | 64 } |
65 | 65 |
66 void generatePath(int glyphID, SkPath* out) override { | 66 void generatePath(int glyphID, SkPath* out) override { |
67 SkGlyph skGlyph; | 67 SkGlyph skGlyph; |
68 skGlyph.initWithGlyphID(glyphID); | 68 skGlyph.initWithGlyphID(glyphID); |
69 fScalerContext->getMetrics(&skGlyph); | 69 fScalerContext->getMetrics(&skGlyph); |
70 | 70 |
71 fScalerContext->getPath(skGlyph, out); | 71 fScalerContext->getPath(skGlyph, out); |
72 } | 72 } |
73 #ifdef SK_DEBUG | 73 #ifdef SK_DEBUG |
74 bool isEqualTo(const SkDescriptor& desc) const override { | 74 bool isEqualTo(const SkDescriptor& desc) const override { return *fDesc == d
esc; } |
75 return fDesc->equals(desc); | |
76 } | |
77 #endif | 75 #endif |
78 private: | 76 private: |
79 const SkAutoTDelete<SkScalerContext> fScalerContext; | 77 const SkAutoTDelete<SkScalerContext> fScalerContext; |
80 #ifdef SK_DEBUG | 78 #ifdef SK_DEBUG |
81 SkDescriptor* const fDesc; | 79 SkDescriptor* const fDesc; |
82 #endif | 80 #endif |
83 }; | 81 }; |
84 | 82 |
85 GrPathRange* GrPathRendering::createGlyphs(const SkTypeface* typeface, | 83 GrPathRange* GrPathRendering::createGlyphs(const SkTypeface* typeface, |
86 const SkScalerContextEffects& effects
, | 84 const SkScalerContextEffects& effects
, |
(...skipping 22 matching lines...) Expand all Loading... |
109 genericDesc->init(); | 107 genericDesc->init(); |
110 genericDesc->addEntry(kRec_SkDescriptorTag, sizeof(rec), &rec); | 108 genericDesc->addEntry(kRec_SkDescriptorTag, sizeof(rec), &rec); |
111 genericDesc->computeChecksum(); | 109 genericDesc->computeChecksum(); |
112 | 110 |
113 // No effects, so we make a dummy struct | 111 // No effects, so we make a dummy struct |
114 SkScalerContextEffects noEffects; | 112 SkScalerContextEffects noEffects; |
115 | 113 |
116 SkAutoTUnref<GlyphGenerator> generator(new GlyphGenerator(*typeface, noEffec
ts, *genericDesc)); | 114 SkAutoTUnref<GlyphGenerator> generator(new GlyphGenerator(*typeface, noEffec
ts, *genericDesc)); |
117 return this->createPathRange(generator, style); | 115 return this->createPathRange(generator, style); |
118 } | 116 } |
OLD | NEW |