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 "GrAtlasTextBatch.h" | 8 #include "GrAtlasTextBatch.h" |
9 | 9 |
10 #include "GrBatchFlushState.h" | 10 #include "GrBatchFlushState.h" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 SkColor* vcolor = reinterpret_cast<SkColor*>(vertex + colorOffset); | 114 SkColor* vcolor = reinterpret_cast<SkColor*>(vertex + colorOffset); |
115 *vcolor = color; | 115 *vcolor = color; |
116 } | 116 } |
117 | 117 |
118 if (regenTexCoords) { | 118 if (regenTexCoords) { |
119 SkIPoint16* textureCoords = reinterpret_cast<SkIPoint16*>(vertex + texCo
ordOffset); | 119 SkIPoint16* textureCoords = reinterpret_cast<SkIPoint16*>(vertex + texCo
ordOffset); |
120 textureCoords->set(u1, v0); | 120 textureCoords->set(u1, v0); |
121 } | 121 } |
122 } | 122 } |
123 | 123 |
124 typedef GrAtlasTextBlob Blob; | |
125 typedef Blob::Run Run; | |
126 typedef Run::SubRunInfo TextInfo; | |
127 | |
128 template <bool regenPos, bool regenCol, bool regenTexCoords, bool regenGlyphs> | 124 template <bool regenPos, bool regenCol, bool regenTexCoords, bool regenGlyphs> |
129 inline void GrAtlasTextBatch::regenBlob(Target* target, FlushInfo* flushInfo, Bl
ob* blob, Run* run, | 125 inline void GrAtlasTextBatch::regenBlob(Target* target, FlushInfo* flushInfo, Bl
ob* blob, Run* run, |
130 TextInfo* info, SkGlyphCache** cache, | 126 TextInfo* info, SkGlyphCache** cache, |
131 SkTypeface** typeface, GrFontScaler** sc
aler, | 127 SkTypeface** typeface, GrFontScaler** sc
aler, |
132 const SkDescriptor** desc, const GrGeome
tryProcessor* gp, | 128 const SkDescriptor** desc, const GrGeome
tryProcessor* gp, |
133 int glyphCount, size_t vertexStride, | 129 int glyphCount, size_t vertexStride, |
134 GrColor color, SkScalar transX, SkScalar
transY) const { | 130 GrColor color, SkScalar transX, SkScalar
transY) const { |
135 static_assert(!regenGlyphs || regenTexCoords, "must regenTexCoords along reg
enGlyphs"); | 131 static_assert(!regenGlyphs || regenTexCoords, "must regenTexCoords along reg
enGlyphs"); |
136 GrBatchTextStrike* strike = nullptr; | 132 GrBatchTextStrike* strike = nullptr; |
137 if (regenTexCoords) { | 133 if (regenTexCoords) { |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 return GrDistanceFieldA8TextGeoProc::Create(color, | 547 return GrDistanceFieldA8TextGeoProc::Create(color, |
552 viewMatrix, | 548 viewMatrix, |
553 texture, | 549 texture, |
554 params, | 550 params, |
555 flags, | 551 flags, |
556 this->usesLocalCoords()); | 552 this->usesLocalCoords()); |
557 #endif | 553 #endif |
558 } | 554 } |
559 | 555 |
560 } | 556 } |
OLD | NEW |