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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 uint32_t fCount; | 103 uint32_t fCount; |
104 SkPoint fOffset; | 104 SkPoint fOffset; |
105 SkPaint fFont; | 105 SkPaint fFont; |
106 GlyphPositioning fPositioning; | 106 GlyphPositioning fPositioning; |
107 | 107 |
108 SkDEBUGCODE(unsigned fMagic;) | 108 SkDEBUGCODE(unsigned fMagic;) |
109 }; | 109 }; |
110 | 110 |
111 SkTextBlob::SkTextBlob(int runCount, const SkRect& bounds) | 111 SkTextBlob::SkTextBlob(int runCount, const SkRect& bounds) |
112 : fRunCount(runCount) | 112 : fRunCount(runCount) |
113 , fBounds(bounds) { | 113 , fBounds(bounds) |
| 114 , fUniqueID(SK_InvalidGenID) { |
114 } | 115 } |
115 | 116 |
116 SkTextBlob::~SkTextBlob() { | 117 SkTextBlob::~SkTextBlob() { |
117 const RunRecord* run = RunRecord::First(this); | 118 const RunRecord* run = RunRecord::First(this); |
118 for (int i = 0; i < fRunCount; ++i) { | 119 for (int i = 0; i < fRunCount; ++i) { |
119 const RunRecord* nextRun = RunRecord::Next(run); | 120 const RunRecord* nextRun = RunRecord::Next(run); |
120 SkDEBUGCODE(run->validate((uint8_t*)this + fStorageSize);) | 121 SkDEBUGCODE(run->validate((uint8_t*)this + fStorageSize);) |
121 run->~RunRecord(); | 122 run->~RunRecord(); |
122 run = nextRun; | 123 run = nextRun; |
123 } | 124 } |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 | 537 |
537 fStorageUsed = 0; | 538 fStorageUsed = 0; |
538 fStorageSize = 0; | 539 fStorageSize = 0; |
539 fRunCount = 0; | 540 fRunCount = 0; |
540 fLastRun = 0; | 541 fLastRun = 0; |
541 fBounds.setEmpty(); | 542 fBounds.setEmpty(); |
542 | 543 |
543 return blob; | 544 return blob; |
544 } | 545 } |
545 | 546 |
OLD | NEW |