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

Side by Side Diff: sky/engine/core/rendering/RenderText.cpp

Issue 677843004: Remove text-combine. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * (C) 1999 Lars Knoll (knoll@kde.org) 2 * (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Dirk Mueller (mueller@kde.org) 3 * (C) 2000 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) 5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net)
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 17 matching lines...) Expand all
28 #include "core/dom/Text.h" 28 #include "core/dom/Text.h"
29 #include "core/editing/PositionWithAffinity.h" 29 #include "core/editing/PositionWithAffinity.h"
30 #include "core/editing/TextIterator.h" 30 #include "core/editing/TextIterator.h"
31 #include "core/editing/VisiblePosition.h" 31 #include "core/editing/VisiblePosition.h"
32 #include "core/frame/FrameView.h" 32 #include "core/frame/FrameView.h"
33 #include "core/frame/Settings.h" 33 #include "core/frame/Settings.h"
34 #include "core/html/parser/TextResourceDecoder.h" 34 #include "core/html/parser/TextResourceDecoder.h"
35 #include "core/rendering/EllipsisBox.h" 35 #include "core/rendering/EllipsisBox.h"
36 #include "core/rendering/InlineTextBox.h" 36 #include "core/rendering/InlineTextBox.h"
37 #include "core/rendering/RenderBlock.h" 37 #include "core/rendering/RenderBlock.h"
38 #include "core/rendering/RenderCombineText.h"
39 #include "core/rendering/RenderLayer.h" 38 #include "core/rendering/RenderLayer.h"
40 #include "core/rendering/RenderView.h" 39 #include "core/rendering/RenderView.h"
41 #include "core/rendering/TextRunConstructor.h" 40 #include "core/rendering/TextRunConstructor.h"
42 #include "core/rendering/break_lines.h" 41 #include "core/rendering/break_lines.h"
43 #include "platform/fonts/Character.h" 42 #include "platform/fonts/Character.h"
44 #include "platform/fonts/FontCache.h" 43 #include "platform/fonts/FontCache.h"
45 #include "platform/geometry/FloatQuad.h" 44 #include "platform/geometry/FloatQuad.h"
46 #include "platform/text/BidiResolver.h" 45 #include "platform/text/BidiResolver.h"
47 #include "platform/text/TextBreakIterator.h" 46 #include "platform/text/TextBreakIterator.h"
48 #include "platform/text/TextRunIterator.h" 47 #include "platform/text/TextRunIterator.h"
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 } else { 597 } else {
599 left = std::min(left, rightEdge - caretWidthRightOfOffset); 598 left = std::min(left, rightEdge - caretWidthRightOfOffset);
600 left = std::max(left, rootLeft); 599 left = std::max(left, rootLeft);
601 } 600 }
602 601
603 return IntRect(left, top, caretWidth, height); 602 return IntRect(left, top, caretWidth, height);
604 } 603 }
605 604
606 ALWAYS_INLINE float RenderText::widthFromCache(const Font& f, int start, int len , float xPos, TextDirection textDirection, HashSet<const SimpleFontData*>* fallb ackFonts, GlyphOverflow* glyphOverflow) const 605 ALWAYS_INLINE float RenderText::widthFromCache(const Font& f, int start, int len , float xPos, TextDirection textDirection, HashSet<const SimpleFontData*>* fallb ackFonts, GlyphOverflow* glyphOverflow) const
607 { 606 {
608 if (style()->hasTextCombine() && isCombineText()) {
609 const RenderCombineText* combineText = toRenderCombineText(this);
610 if (combineText->isCombined())
611 return combineText->combinedTextWidth(f);
612 }
613
614 if (f.isFixedPitch() && f.fontDescription().variant() == FontVariantNormal & & m_isAllASCII && (!glyphOverflow || !glyphOverflow->computeBounds)) { 607 if (f.isFixedPitch() && f.fontDescription().variant() == FontVariantNormal & & m_isAllASCII && (!glyphOverflow || !glyphOverflow->computeBounds)) {
615 float monospaceCharacterWidth = f.spaceWidth(); 608 float monospaceCharacterWidth = f.spaceWidth();
616 float w = 0; 609 float w = 0;
617 bool isSpace; 610 bool isSpace;
618 ASSERT(m_text); 611 ASSERT(m_text);
619 StringImpl& text = *m_text.impl(); 612 StringImpl& text = *m_text.impl();
620 for (int i = start; i < start + len; i++) { 613 for (int i = start; i < start + len; i++) {
621 char c = text[i]; 614 char c = text[i];
622 if (c <= space) { 615 if (c <= space) {
623 if (c == space || c == newlineCharacter) { 616 if (c == space || c == newlineCharacter) {
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after
1672 ASSERT(child->prevTextBox() == prev); 1665 ASSERT(child->prevTextBox() == prev);
1673 prev = child; 1666 prev = child;
1674 } 1667 }
1675 ASSERT(prev == m_lastTextBox); 1668 ASSERT(prev == m_lastTextBox);
1676 #endif 1669 #endif
1677 } 1670 }
1678 1671
1679 #endif 1672 #endif
1680 1673
1681 } // namespace blink 1674 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderCombineText.cpp ('k') | sky/engine/core/rendering/line/BreakingContextInlineHeaders.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698