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 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 FloatSize textSize(fragment.width, fragment.height); | 631 FloatSize textSize(fragment.width, fragment.height); |
632 | 632 |
633 if (scalingFactor != 1) { | 633 if (scalingFactor != 1) { |
634 textOrigin.scale(scalingFactor, scalingFactor); | 634 textOrigin.scale(scalingFactor, scalingFactor); |
635 textSize.scale(scalingFactor); | 635 textSize.scale(scalingFactor); |
636 context->save(); | 636 context->save(); |
637 context->scale(FloatSize(1 / scalingFactor, 1 / scalingFactor)); | 637 context->scale(FloatSize(1 / scalingFactor, 1 / scalingFactor)); |
638 } | 638 } |
639 | 639 |
640 if (hasShadow) { | 640 if (hasShadow) { |
641 DrawLooper drawLooper; | 641 RefPtr<DrawLooper> drawLooper = adoptRef(new DrawLooper); |
642 do { | 642 do { |
643 FloatSize offset(shadow->x(), shadow->y()); | 643 FloatSize offset(shadow->x(), shadow->y()); |
644 drawLooper.addShadow(offset, shadow->blur(), textRenderer->resolveCo
lor(shadow->color(), Color::stdShadowColor), | 644 drawLooper->addShadow(offset, shadow->blur(), textRenderer->resolveC
olor(shadow->color(), Color::stdShadowColor), |
645 DrawLooper::ShadowRespectsTransforms, DrawLooper::ShadowRespects
Alpha); | 645 DrawLooper::ShadowRespectsTransforms, DrawLooper::ShadowRespects
Alpha); |
646 } while ((shadow = shadow->next())); | 646 } while ((shadow = shadow->next())); |
647 drawLooper.addUnmodifiedContent(); | 647 drawLooper->addUnmodifiedContent(); |
648 context->setDrawLooper(drawLooper); | 648 context->setDrawLooper(drawLooper.release()); |
649 } | 649 } |
650 | 650 |
651 if (prepareGraphicsContextForTextPainting(context, scalingFactor, textRun, s
tyle)) { | 651 if (prepareGraphicsContextForTextPainting(context, scalingFactor, textRun, s
tyle)) { |
652 TextRunPaintInfo textRunPaintInfo(textRun); | 652 TextRunPaintInfo textRunPaintInfo(textRun); |
653 textRunPaintInfo.from = startPosition; | 653 textRunPaintInfo.from = startPosition; |
654 textRunPaintInfo.to = endPosition; | 654 textRunPaintInfo.to = endPosition; |
655 textRunPaintInfo.bounds = FloatRect(textOrigin, textSize); | 655 textRunPaintInfo.bounds = FloatRect(textOrigin, textSize); |
656 scaledFont.drawText(context, textRunPaintInfo, textOrigin); | 656 scaledFont.drawText(context, textRunPaintInfo, textOrigin); |
657 restoreGraphicsContextAfterTextPainting(context, textRun); | 657 restoreGraphicsContextAfterTextPainting(context, textRun); |
658 } | 658 } |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 renderer()->updateHitTestResult(result, locationInContainer.poin
t() - toLayoutSize(accumulatedOffset)); | 745 renderer()->updateHitTestResult(result, locationInContainer.poin
t() - toLayoutSize(accumulatedOffset)); |
746 if (!result.addNodeToRectBasedTestResult(renderer()->node(), req
uest, locationInContainer, rect)) | 746 if (!result.addNodeToRectBasedTestResult(renderer()->node(), req
uest, locationInContainer, rect)) |
747 return true; | 747 return true; |
748 } | 748 } |
749 } | 749 } |
750 } | 750 } |
751 return false; | 751 return false; |
752 } | 752 } |
753 | 753 |
754 } // namespace WebCore | 754 } // namespace WebCore |
OLD | NEW |