Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(911)

Side by Side Diff: src/core/SkTextBlob.cpp

Issue 1405463004: [SkTextBlob] Remove incorrect builder assert (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: win fix reloaded Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | tests/TextBlobTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | tests/TextBlobTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698