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 #ifndef GrAtlasTextBlob_DEFINED | 8 #ifndef GrAtlasTextBlob_DEFINED |
9 #define GrAtlasTextBlob_DEFINED | 9 #define GrAtlasTextBlob_DEFINED |
10 | 10 |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
273 | 273 |
274 void push_back_run(int currRun) { | 274 void push_back_run(int currRun) { |
275 SkASSERT(currRun < fRunCount); | 275 SkASSERT(currRun < fRunCount); |
276 if (currRun > 0) { | 276 if (currRun > 0) { |
277 Run::SubRunInfo& newRun = fRuns[currRun].fSubRunInfo.back(); | 277 Run::SubRunInfo& newRun = fRuns[currRun].fSubRunInfo.back(); |
278 Run::SubRunInfo& lastRun = fRuns[currRun - 1].fSubRunInfo.back(); | 278 Run::SubRunInfo& lastRun = fRuns[currRun - 1].fSubRunInfo.back(); |
279 newRun.setAsSuccessor(lastRun); | 279 newRun.setAsSuccessor(lastRun); |
280 } | 280 } |
281 } | 281 } |
282 | 282 |
283 // Appends a glyph to the blob. If the glyph is too large, the glyph will b e appended | |
284 // as a path. | |
283 void appendGlyph(int runIndex, | 285 void appendGlyph(int runIndex, |
284 const SkRect& positions, | 286 const SkRect& positions, |
285 GrColor color, | 287 GrColor color, |
286 GrBatchTextStrike* strike, | 288 GrBatchTextStrike* strike, |
287 GrGlyph* glyph); | 289 GrGlyph* glyph, |
290 GrFontScaler* scaler, const SkGlyph& skGlyph, | |
291 SkScalar x, SkScalar y, SkScalar scale, bool applyVM); | |
292 | |
293 void appendLargeGlyph(GrGlyph* glyph, GrFontScaler* scaler, const SkGlyph& s kGlyph, | |
bsalomon
2015/12/09 20:49:41
can this be private? otherwise lgtm
| |
294 SkScalar x, SkScalar y, SkScalar scale, bool applyVM); | |
288 | 295 |
289 static size_t GetVertexStride(GrMaskFormat maskFormat) { | 296 static size_t GetVertexStride(GrMaskFormat maskFormat) { |
290 switch (maskFormat) { | 297 switch (maskFormat) { |
291 case kA8_GrMaskFormat: | 298 case kA8_GrMaskFormat: |
292 return kGrayTextVASize; | 299 return kGrayTextVASize; |
293 case kARGB_GrMaskFormat: | 300 case kARGB_GrMaskFormat: |
294 return kColorTextVASize; | 301 return kColorTextVASize; |
295 default: | 302 default: |
296 return kLCDTextVASize; | 303 return kLCDTextVASize; |
297 } | 304 } |
298 } | 305 } |
299 | 306 |
300 bool mustRegenerate(SkScalar* outTransX, SkScalar* outTransY, const SkPaint& paint, | 307 bool mustRegenerate(SkScalar* outTransX, SkScalar* outTransY, const SkPaint& paint, |
301 GrColor color, const SkMaskFilter::BlurRec& blurRec, | 308 GrColor color, const SkMaskFilter::BlurRec& blurRec, |
302 const SkMatrix& viewMatrix, SkScalar x, SkScalar y); | 309 const SkMatrix& viewMatrix, SkScalar x, SkScalar y); |
303 | 310 |
304 // position + local coord | 311 // position + local coord |
305 static const size_t kColorTextVASize = sizeof(SkPoint) + sizeof(SkIPoint16); | 312 static const size_t kColorTextVASize = sizeof(SkPoint) + sizeof(SkIPoint16); |
306 static const size_t kGrayTextVASize = sizeof(SkPoint) + sizeof(GrColor) + si zeof(SkIPoint16); | 313 static const size_t kGrayTextVASize = sizeof(SkPoint) + sizeof(GrColor) + si zeof(SkIPoint16); |
307 static const size_t kLCDTextVASize = kGrayTextVASize; | 314 static const size_t kLCDTextVASize = kGrayTextVASize; |
308 static const int kVerticesPerGlyph = 4; | 315 static const int kVerticesPerGlyph = 4; |
309 | 316 |
310 #ifdef CACHE_SANITY_CHECK | 317 #ifdef CACHE_SANITY_CHECK |
311 static void AssertEqual(const GrAtlasTextBlob&, const GrAtlasTextBlob&); | 318 static void AssertEqual(const GrAtlasTextBlob&, const GrAtlasTextBlob&); |
312 size_t fSize; | 319 size_t fSize; |
313 #endif | 320 #endif |
314 }; | 321 }; |
315 | 322 |
316 #endif | 323 #endif |
OLD | NEW |