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 "SkTextBlob.h" | 8 #include "SkTextBlob.h" |
9 | 9 |
10 #include "SkReadBuffer.h" | 10 #include "SkReadBuffer.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 && fSize == other.fSize | 40 && fSize == other.fSize |
41 && fScaleX == other.fScaleX | 41 && fScaleX == other.fScaleX |
42 && fSkewX == other.fSkewX | 42 && fSkewX == other.fSkewX |
43 && fHinting == other.fHinting | 43 && fHinting == other.fHinting |
44 && fFlags == other.fFlags; | 44 && fFlags == other.fFlags; |
45 } | 45 } |
46 | 46 |
47 bool operator!=(const RunFont& other) const { | 47 bool operator!=(const RunFont& other) const { |
48 return !(*this == other); | 48 return !(*this == other); |
49 } | 49 } |
| 50 |
| 51 uint32_t flags() const { return fFlags; } |
| 52 |
50 private: | 53 private: |
51 const static uint32_t kFlagsMask = | 54 const static uint32_t kFlagsMask = |
52 SkPaint::kAntiAlias_Flag | | 55 SkPaint::kAntiAlias_Flag | |
53 SkPaint::kUnderlineText_Flag | | 56 SkPaint::kUnderlineText_Flag | |
54 SkPaint::kStrikeThruText_Flag | | 57 SkPaint::kStrikeThruText_Flag | |
55 SkPaint::kFakeBoldText_Flag | | 58 SkPaint::kFakeBoldText_Flag | |
56 SkPaint::kLinearText_Flag | | 59 SkPaint::kLinearText_Flag | |
57 SkPaint::kSubpixelText_Flag | | 60 SkPaint::kSubpixelText_Flag | |
58 SkPaint::kDevKernText_Flag | | 61 SkPaint::kDevKernText_Flag | |
59 SkPaint::kLCDRenderText_Flag | | 62 SkPaint::kLCDRenderText_Flag | |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 SkASSERT(!this->done()); | 339 SkASSERT(!this->done()); |
337 return fCurrentRun->positioning(); | 340 return fCurrentRun->positioning(); |
338 } | 341 } |
339 | 342 |
340 void SkTextBlob::RunIterator::applyFontToPaint(SkPaint* paint) const { | 343 void SkTextBlob::RunIterator::applyFontToPaint(SkPaint* paint) const { |
341 SkASSERT(!this->done()); | 344 SkASSERT(!this->done()); |
342 | 345 |
343 fCurrentRun->font().applyToPaint(paint); | 346 fCurrentRun->font().applyToPaint(paint); |
344 } | 347 } |
345 | 348 |
| 349 bool SkTextBlob::RunIterator::isLCD() const { |
| 350 return SkToBool(fCurrentRun->font().flags() & SkPaint::kLCDRenderText_Flag); |
| 351 } |
| 352 |
346 SkTextBlobBuilder::SkTextBlobBuilder() | 353 SkTextBlobBuilder::SkTextBlobBuilder() |
347 : fStorageSize(0) | 354 : fStorageSize(0) |
348 , fStorageUsed(0) | 355 , fStorageUsed(0) |
349 , fRunCount(0) | 356 , fRunCount(0) |
350 , fDeferredBounds(false) | 357 , fDeferredBounds(false) |
351 , fLastRun(0) { | 358 , fLastRun(0) { |
352 fBounds.setEmpty(); | 359 fBounds.setEmpty(); |
353 } | 360 } |
354 | 361 |
355 SkTextBlobBuilder::~SkTextBlobBuilder() { | 362 SkTextBlobBuilder::~SkTextBlobBuilder() { |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 | 601 |
595 fStorageUsed = 0; | 602 fStorageUsed = 0; |
596 fStorageSize = 0; | 603 fStorageSize = 0; |
597 fRunCount = 0; | 604 fRunCount = 0; |
598 fLastRun = 0; | 605 fLastRun = 0; |
599 fBounds.setEmpty(); | 606 fBounds.setEmpty(); |
600 | 607 |
601 return blob; | 608 return blob; |
602 } | 609 } |
603 | 610 |
OLD | NEW |