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

Side by Side Diff: Source/core/layout/line/BreakingContextInlineHeaders.h

Issue 1153173011: Force glyph overflow calculation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: More rebaselines Created 5 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/layout/LayoutBlockFlowLine.cpp ('k') | Source/platform/fonts/Character.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 (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ight reserved. 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ight reserved.
4 * Copyright (C) 2010 Google Inc. All rights reserved. 4 * Copyright (C) 2010 Google Inc. All rights reserved.
5 * Copyright (C) 2013 Adobe Systems Incorporated. 5 * Copyright (C) 2013 Adobe Systems Incorporated.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 } 504 }
505 505
506 ALWAYS_INLINE TextDirection textDirectionFromUnicode(WTF::Unicode::Direction dir ection) 506 ALWAYS_INLINE TextDirection textDirectionFromUnicode(WTF::Unicode::Direction dir ection)
507 { 507 {
508 return direction == WTF::Unicode::RightToLeft 508 return direction == WTF::Unicode::RightToLeft
509 || direction == WTF::Unicode::RightToLeftArabic ? RTL : LTR; 509 || direction == WTF::Unicode::RightToLeftArabic ? RTL : LTR;
510 } 510 }
511 511
512 ALWAYS_INLINE float textWidth(LayoutText* text, unsigned from, unsigned len, con st Font& font, float xPos, bool collapseWhiteSpace, HashSet<const SimpleFontData *>* fallbackFonts = nullptr) 512 ALWAYS_INLINE float textWidth(LayoutText* text, unsigned from, unsigned len, con st Font& font, float xPos, bool collapseWhiteSpace, HashSet<const SimpleFontData *>* fallbackFonts = nullptr)
513 { 513 {
514 GlyphOverflow glyphOverflow; 514 if ((!from && len == text->textLength()) || text->style()->hasTextCombine()) {
515 if ((!from && len == text->textLength()) || text->style()->hasTextCombine()) 515 GlyphOverflow glyphOverflow;
516 return text->width(from, len, font, xPos, text->style()->direction(), fa llbackFonts, &glyphOverflow); 516 return text->width(from, len, font, xPos, text->style()->direction(), fa llbackFonts,
517 // LayoutText caches fallbackFonts and glyphOverflow together, and r equires them to be both null or both non-null.
518 fallbackFonts ? &glyphOverflow : nullptr);
519 }
517 520
518 TextRun run = constructTextRun(text, font, text, from, len, text->styleRef() ); 521 TextRun run = constructTextRun(text, font, text, from, len, text->styleRef() );
519 run.setCodePath(text->canUseSimpleFontCodePath() ? TextRun::ForceSimple : Te xtRun::ForceComplex); 522 run.setCodePath(text->canUseSimpleFontCodePath() ? TextRun::ForceSimple : Te xtRun::ForceComplex);
520 run.setTabSize(!collapseWhiteSpace, text->style()->tabSize()); 523 run.setTabSize(!collapseWhiteSpace, text->style()->tabSize());
521 run.setXPos(xPos); 524 run.setXPos(xPos);
522 return font.width(run, fallbackFonts, &glyphOverflow); 525 return font.width(run, fallbackFonts, nullptr);
523 } 526 }
524 527
525 inline bool BreakingContext::handleText(WordMeasurements& wordMeasurements, bool & hyphenated) 528 inline bool BreakingContext::handleText(WordMeasurements& wordMeasurements, bool & hyphenated)
526 { 529 {
527 if (!m_current.offset()) 530 if (!m_current.offset())
528 m_appliedStartWidth = false; 531 m_appliedStartWidth = false;
529 532
530 LayoutText* layoutText = toLayoutText(m_current.object()); 533 LayoutText* layoutText = toLayoutText(m_current.object());
531 534
532 bool isSVGText = layoutText->isSVGInlineText(); 535 bool isSVGText = layoutText->isSVGInlineText();
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
899 902
900 if (style.textIndentType() == TextIndentHanging) 903 if (style.textIndentType() == TextIndentHanging)
901 shouldIndentText = shouldIndentText == IndentText ? DoNotIndentText : In dentText; 904 shouldIndentText = shouldIndentText == IndentText ? DoNotIndentText : In dentText;
902 905
903 return shouldIndentText; 906 return shouldIndentText;
904 } 907 }
905 908
906 } 909 }
907 910
908 #endif // BreakingContextInlineHeaders_h 911 #endif // BreakingContextInlineHeaders_h
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutBlockFlowLine.cpp ('k') | Source/platform/fonts/Character.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698