| OLD | NEW |
| 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, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 // snap the x value. We still round the y-axis to ensure consistent | 495 // snap the x value. We still round the y-axis to ensure consistent |
| 496 // line heights. | 496 // line heights. |
| 497 LayoutPoint adjustedPaintOffset = RuntimeEnabledFeatures::subpixelFontScalin
gEnabled() | 497 LayoutPoint adjustedPaintOffset = RuntimeEnabledFeatures::subpixelFontScalin
gEnabled() |
| 498 ? LayoutPoint(paintOffset.x(), paintOffset.y().round()) | 498 ? LayoutPoint(paintOffset.x(), paintOffset.y().round()) |
| 499 : roundedIntPoint(paintOffset); | 499 : roundedIntPoint(paintOffset); |
| 500 | 500 |
| 501 if (logicalStart >= paintEnd || logicalStart + logicalExtent <= paintStart) | 501 if (logicalStart >= paintEnd || logicalStart + logicalExtent <= paintStart) |
| 502 return; | 502 return; |
| 503 | 503 |
| 504 // Determine whether or not we're selected. | 504 // Determine whether or not we're selected. |
| 505 bool haveSelection = paintInfo.phase != PaintPhaseTextClip && selectionState
() != RenderObject::SelectionNone; | 505 bool haveSelection = selectionState() != RenderObject::SelectionNone; |
| 506 if (!haveSelection && paintInfo.phase == PaintPhaseSelection) | 506 if (!haveSelection && paintInfo.phase == PaintPhaseSelection) |
| 507 // When only painting the selection, don't bother to paint if there is n
one. | 507 // When only painting the selection, don't bother to paint if there is n
one. |
| 508 return; | 508 return; |
| 509 | 509 |
| 510 if (m_truncation != cNoTruncation) { | 510 if (m_truncation != cNoTruncation) { |
| 511 if (renderer().containingBlock()->style()->isLeftToRightDirection() != i
sLeftToRightDirection()) { | 511 if (renderer().containingBlock()->style()->isLeftToRightDirection() != i
sLeftToRightDirection()) { |
| 512 // Make the visible fragment of text hug the edge closest to the res
t of the run by moving the origin | 512 // Make the visible fragment of text hug the edge closest to the res
t of the run by moving the origin |
| 513 // at which we start drawing text. | 513 // at which we start drawing text. |
| 514 // e.g. In the case of LTR text truncated in an RTL Context, the cor
rect behavior is: | 514 // e.g. In the case of LTR text truncated in an RTL Context, the cor
rect behavior is: |
| 515 // |Hello|CBA| -> |...He|CBA| | 515 // |Hello|CBA| -> |...He|CBA| |
| (...skipping 26 matching lines...) Expand all Loading... |
| 542 bool paintSelectedTextOnly = (paintInfo.phase == PaintPhaseSelection); | 542 bool paintSelectedTextOnly = (paintInfo.phase == PaintPhaseSelection); |
| 543 bool paintSelectedTextSeparately = !paintSelectedTextOnly && textStyle != se
lectionStyle; | 543 bool paintSelectedTextSeparately = !paintSelectedTextOnly && textStyle != se
lectionStyle; |
| 544 | 544 |
| 545 // Set our font. | 545 // Set our font. |
| 546 const Font& font = styleToUse->font(); | 546 const Font& font = styleToUse->font(); |
| 547 | 547 |
| 548 FloatPoint textOrigin = FloatPoint(boxOrigin.x(), boxOrigin.y() + font.fontM
etrics().ascent()); | 548 FloatPoint textOrigin = FloatPoint(boxOrigin.x(), boxOrigin.y() + font.fontM
etrics().ascent()); |
| 549 | 549 |
| 550 // 1. Paint backgrounds behind text if needed. Examples of such backgrounds
include selection | 550 // 1. Paint backgrounds behind text if needed. Examples of such backgrounds
include selection |
| 551 // and composition highlights. | 551 // and composition highlights. |
| 552 if (paintInfo.phase != PaintPhaseSelection && paintInfo.phase != PaintPhaseT
extClip) { | 552 if (paintInfo.phase != PaintPhaseSelection) { |
| 553 if (containsComposition) { | 553 if (containsComposition) { |
| 554 paintCompositionBackgrounds(context, boxOrigin, styleToUse, font, us
eCustomUnderlines); | 554 paintCompositionBackgrounds(context, boxOrigin, styleToUse, font, us
eCustomUnderlines); |
| 555 } | 555 } |
| 556 | 556 |
| 557 paintDocumentMarkers(context, boxOrigin, styleToUse, font, true); | 557 paintDocumentMarkers(context, boxOrigin, styleToUse, font, true); |
| 558 | 558 |
| 559 if (haveSelection && !useCustomUnderlines) | 559 if (haveSelection && !useCustomUnderlines) |
| 560 paintSelection(context, boxOrigin, styleToUse, font, selectionStyle.
fillColor); | 560 paintSelection(context, boxOrigin, styleToUse, font, selectionStyle.
fillColor); |
| 561 } | 561 } |
| 562 | 562 |
| (...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1357 printedCharacters = fprintf(stderr, "\t%s %p", obj.renderName(), &obj); | 1357 printedCharacters = fprintf(stderr, "\t%s %p", obj.renderName(), &obj); |
| 1358 const int rendererCharacterOffset = 24; | 1358 const int rendererCharacterOffset = 24; |
| 1359 for (; printedCharacters < rendererCharacterOffset; printedCharacters++) | 1359 for (; printedCharacters < rendererCharacterOffset; printedCharacters++) |
| 1360 fputc(' ', stderr); | 1360 fputc(' ', stderr); |
| 1361 fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(), value.utf8().d
ata()); | 1361 fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(), value.utf8().d
ata()); |
| 1362 } | 1362 } |
| 1363 | 1363 |
| 1364 #endif | 1364 #endif |
| 1365 | 1365 |
| 1366 } // namespace blink | 1366 } // namespace blink |
| OLD | NEW |