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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 posXInc : 0; | 396 posXInc : 0; |
397 | 397 |
398 bounds.setEmpty(); | 398 bounds.setEmpty(); |
399 for (unsigned i = 0; i < run.glyphCount(); ++i) { | 399 for (unsigned i = 0; i < run.glyphCount(); ++i) { |
400 bounds.join(glyphBounds[i].makeOffset(*glyphPosX, *glyphPosY)); | 400 bounds.join(glyphBounds[i].makeOffset(*glyphPosX, *glyphPosY)); |
401 glyphPosX += posXInc; | 401 glyphPosX += posXInc; |
402 glyphPosY += posYInc; | 402 glyphPosY += posYInc; |
403 } | 403 } |
404 | 404 |
405 SkASSERT((void*)glyphPosX <= SkTextBlob::RunRecord::Next(&run)); | 405 SkASSERT((void*)glyphPosX <= SkTextBlob::RunRecord::Next(&run)); |
406 SkASSERT(run.positioning() == SkTextBlob::kHorizontal_Positioning || | |
407 (void*)glyphPosY <= SkTextBlob::RunRecord::Next(&run)); | |
408 | 406 |
409 return bounds.makeOffset(run.offset().x(), run.offset().y()); | 407 return bounds.makeOffset(run.offset().x(), run.offset().y()); |
410 } | 408 } |
411 | 409 |
412 SkRect SkTextBlobBuilder::ConservativeRunBounds(const SkTextBlob::RunRecord& run
) { | 410 SkRect SkTextBlobBuilder::ConservativeRunBounds(const SkTextBlob::RunRecord& run
) { |
413 SkASSERT(run.glyphCount() > 0); | 411 SkASSERT(run.glyphCount() > 0); |
414 SkASSERT(SkTextBlob::kFull_Positioning == run.positioning() || | 412 SkASSERT(SkTextBlob::kFull_Positioning == run.positioning() || |
415 SkTextBlob::kHorizontal_Positioning == run.positioning()); | 413 SkTextBlob::kHorizontal_Positioning == run.positioning()); |
416 | 414 |
417 SkPaint paint; | 415 SkPaint paint; |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 | 635 |
638 fStorageUsed = 0; | 636 fStorageUsed = 0; |
639 fStorageSize = 0; | 637 fStorageSize = 0; |
640 fRunCount = 0; | 638 fRunCount = 0; |
641 fLastRun = 0; | 639 fLastRun = 0; |
642 fBounds.setEmpty(); | 640 fBounds.setEmpty(); |
643 | 641 |
644 return blob; | 642 return blob; |
645 } | 643 } |
646 | 644 |
OLD | NEW |