| OLD | NEW |
| 1 /** | 1 /** |
| 2 * Copyright (C) 2007 Rob Buis <buis@kde.org> | 2 * Copyright (C) 2007 Rob Buis <buis@kde.org> |
| 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> | 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> |
| 4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2010. All rights 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 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 | 599 |
| 600 FloatPoint textOrigin(fragment.x, fragment.y); | 600 FloatPoint textOrigin(fragment.x, fragment.y); |
| 601 FloatSize textSize(fragment.width, fragment.height); | 601 FloatSize textSize(fragment.width, fragment.height); |
| 602 | 602 |
| 603 if (scalingFactor != 1) { | 603 if (scalingFactor != 1) { |
| 604 textOrigin.scale(scalingFactor, scalingFactor); | 604 textOrigin.scale(scalingFactor, scalingFactor); |
| 605 textSize.scale(scalingFactor); | 605 textSize.scale(scalingFactor); |
| 606 } | 606 } |
| 607 | 607 |
| 608 FloatRect shadowRect(FloatPoint(textOrigin.x(), textOrigin.y() - scaledFont.
fontMetrics().floatAscent()), textSize); | 608 FloatRect shadowRect(FloatPoint(textOrigin.x(), textOrigin.y() - scaledFont.
fontMetrics().floatAscent()), textSize); |
| 609 TextRunPaintInfo textRunPaintInfo(textRun); |
| 610 textRunPaintInfo.from = startPosition; |
| 611 textRunPaintInfo.to = endPosition; |
| 612 textRunPaintInfo.bounds = FloatRect(textOrigin, textSize); |
| 609 | 613 |
| 610 do { | 614 do { |
| 611 if (!prepareGraphicsContextForTextPainting(context, scalingFactor, textR
un, style)) | 615 if (!prepareGraphicsContextForTextPainting(context, scalingFactor, textR
un, style)) |
| 612 break; | 616 break; |
| 613 | 617 |
| 614 FloatSize extraOffset; | 618 FloatSize extraOffset; |
| 615 if (shadow) | 619 if (shadow) |
| 616 extraOffset = applyShadowToGraphicsContext(context, shadow, shadowRe
ct, false /* stroked */, true /* opaque */, true /* horizontal */); | 620 extraOffset = applyShadowToGraphicsContext(context, shadow, shadowRe
ct, false /* stroked */, true /* opaque */, true /* horizontal */); |
| 617 | 621 |
| 618 context->save(); | 622 context->save(); |
| 619 context->scale(FloatSize(1 / scalingFactor, 1 / scalingFactor)); | 623 context->scale(FloatSize(1 / scalingFactor, 1 / scalingFactor)); |
| 620 | 624 |
| 621 scaledFont.drawText(context, textRun, textOrigin + extraOffset, startPos
ition, endPosition); | 625 scaledFont.drawText(context, textRunPaintInfo, textOrigin + extraOffset)
; |
| 622 | 626 |
| 623 context->restore(); | 627 context->restore(); |
| 624 | 628 |
| 625 restoreGraphicsContextAfterTextPainting(context, textRun); | 629 restoreGraphicsContextAfterTextPainting(context, textRun); |
| 626 | 630 |
| 627 if (!shadow) | 631 if (!shadow) |
| 628 break; | 632 break; |
| 629 | 633 |
| 630 if (shadow->next()) | 634 if (shadow->next()) |
| 631 context->restore(); | 635 context->restore(); |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 return true; | 724 return true; |
| 721 } | 725 } |
| 722 } | 726 } |
| 723 } | 727 } |
| 724 return false; | 728 return false; |
| 725 } | 729 } |
| 726 | 730 |
| 727 } // namespace WebCore | 731 } // namespace WebCore |
| 728 | 732 |
| 729 #endif | 733 #endif |
| OLD | NEW |