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 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 ASSERT(paintInfo.phase != PaintPhaseSelfOutline && paintInfo.phase != PaintP
haseChildOutlines); | 471 ASSERT(paintInfo.phase != PaintPhaseSelfOutline && paintInfo.phase != PaintP
haseChildOutlines); |
472 | 472 |
473 LayoutUnit logicalLeftSide = logicalLeftVisualOverflow(); | 473 LayoutUnit logicalLeftSide = logicalLeftVisualOverflow(); |
474 LayoutUnit logicalRightSide = logicalRightVisualOverflow(); | 474 LayoutUnit logicalRightSide = logicalRightVisualOverflow(); |
475 LayoutUnit logicalStart = logicalLeftSide + (isHorizontal() ? paintOffset.x(
) : paintOffset.y()); | 475 LayoutUnit logicalStart = logicalLeftSide + (isHorizontal() ? paintOffset.x(
) : paintOffset.y()); |
476 LayoutUnit logicalExtent = logicalRightSide - logicalLeftSide; | 476 LayoutUnit logicalExtent = logicalRightSide - logicalLeftSide; |
477 | 477 |
478 LayoutUnit paintEnd = isHorizontal() ? paintInfo.rect.maxX() : paintInfo.rec
t.maxY(); | 478 LayoutUnit paintEnd = isHorizontal() ? paintInfo.rect.maxX() : paintInfo.rec
t.maxY(); |
479 LayoutUnit paintStart = isHorizontal() ? paintInfo.rect.x() : paintInfo.rect
.y(); | 479 LayoutUnit paintStart = isHorizontal() ? paintInfo.rect.x() : paintInfo.rect
.y(); |
480 | 480 |
481 LayoutPoint adjustedPaintOffset = roundedIntPoint(paintOffset); | 481 // When subpixel font scaling is enabled text runs are positioned at |
| 482 // subpixel boundaries on the x-axis and thus there is no reason to |
| 483 // snap the x value. We still round the y-axis to ensure consistent |
| 484 // line heights. |
| 485 LayoutPoint adjustedPaintOffset = RuntimeEnabledFeatures::subpixelFontScalin
gEnabled() |
| 486 ? LayoutPoint(paintOffset.x(), paintOffset.y().round()) |
| 487 : roundedIntPoint(paintOffset); |
482 | 488 |
483 if (logicalStart >= paintEnd || logicalStart + logicalExtent <= paintStart) | 489 if (logicalStart >= paintEnd || logicalStart + logicalExtent <= paintStart) |
484 return; | 490 return; |
485 | 491 |
486 bool isPrinting = textRenderer().document().printing(); | 492 bool isPrinting = textRenderer().document().printing(); |
487 | 493 |
488 // Determine whether or not we're selected. | 494 // Determine whether or not we're selected. |
489 bool haveSelection = !isPrinting && paintInfo.phase != PaintPhaseTextClip &&
selectionState() != RenderObject::SelectionNone; | 495 bool haveSelection = !isPrinting && paintInfo.phase != PaintPhaseTextClip &&
selectionState() != RenderObject::SelectionNone; |
490 if (!haveSelection && paintInfo.phase == PaintPhaseSelection) | 496 if (!haveSelection && paintInfo.phase == PaintPhaseSelection) |
491 // When only painting the selection, don't bother to paint if there is n
one. | 497 // When only painting the selection, don't bother to paint if there is n
one. |
(...skipping 18 matching lines...) Expand all Loading... |
510 } | 516 } |
511 | 517 |
512 GraphicsContext* context = paintInfo.context; | 518 GraphicsContext* context = paintInfo.context; |
513 | 519 |
514 RenderObject& rendererToUse = renderer(); | 520 RenderObject& rendererToUse = renderer(); |
515 RenderStyle* styleToUse = rendererToUse.style(isFirstLineStyle()); | 521 RenderStyle* styleToUse = rendererToUse.style(isFirstLineStyle()); |
516 | 522 |
517 adjustedPaintOffset.move(0, styleToUse->isHorizontalWritingMode() ? 0 : -log
icalHeight()); | 523 adjustedPaintOffset.move(0, styleToUse->isHorizontalWritingMode() ? 0 : -log
icalHeight()); |
518 | 524 |
519 FloatPoint boxOrigin = locationIncludingFlipping(); | 525 FloatPoint boxOrigin = locationIncludingFlipping(); |
520 // FIXME: Shouldn't these offsets be rounded? | |
521 boxOrigin.move(adjustedPaintOffset.x().toFloat(), adjustedPaintOffset.y().to
Float()); | 526 boxOrigin.move(adjustedPaintOffset.x().toFloat(), adjustedPaintOffset.y().to
Float()); |
522 FloatRect boxRect(boxOrigin, LayoutSize(logicalWidth(), logicalHeight())); | 527 FloatRect boxRect(boxOrigin, LayoutSize(logicalWidth(), logicalHeight())); |
523 | 528 |
524 RenderCombineText* combinedText = styleToUse->hasTextCombine() && textRender
er().isCombineText() && toRenderCombineText(textRenderer()).isCombined() ? &toRe
nderCombineText(textRenderer()) : 0; | 529 RenderCombineText* combinedText = styleToUse->hasTextCombine() && textRender
er().isCombineText() && toRenderCombineText(textRenderer()).isCombined() ? &toRe
nderCombineText(textRenderer()) : 0; |
525 | 530 |
526 bool shouldRotate = !isHorizontal() && !combinedText; | 531 bool shouldRotate = !isHorizontal() && !combinedText; |
527 if (shouldRotate) | 532 if (shouldRotate) |
528 context->concatCTM(rotation(boxRect, Clockwise)); | 533 context->concatCTM(rotation(boxRect, Clockwise)); |
529 | 534 |
530 // Determine whether or not we have composition underlines to draw. | 535 // Determine whether or not we have composition underlines to draw. |
(...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1574 printedCharacters = fprintf(stderr, "\t%s %p", obj.renderName(), &obj); | 1579 printedCharacters = fprintf(stderr, "\t%s %p", obj.renderName(), &obj); |
1575 const int rendererCharacterOffset = 24; | 1580 const int rendererCharacterOffset = 24; |
1576 for (; printedCharacters < rendererCharacterOffset; printedCharacters++) | 1581 for (; printedCharacters < rendererCharacterOffset; printedCharacters++) |
1577 fputc(' ', stderr); | 1582 fputc(' ', stderr); |
1578 fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(), value.utf8().d
ata()); | 1583 fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(), value.utf8().d
ata()); |
1579 } | 1584 } |
1580 | 1585 |
1581 #endif | 1586 #endif |
1582 | 1587 |
1583 } // namespace WebCore | 1588 } // namespace WebCore |
OLD | NEW |