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 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 FloatSize textSize(fragment.width, fragment.height); | 632 FloatSize textSize(fragment.width, fragment.height); |
633 | 633 |
634 if (scalingFactor != 1) { | 634 if (scalingFactor != 1) { |
635 textOrigin.scale(scalingFactor, scalingFactor); | 635 textOrigin.scale(scalingFactor, scalingFactor); |
636 textSize.scale(scalingFactor); | 636 textSize.scale(scalingFactor); |
637 context->save(); | 637 context->save(); |
638 context->scale(FloatSize(1 / scalingFactor, 1 / scalingFactor)); | 638 context->scale(FloatSize(1 / scalingFactor, 1 / scalingFactor)); |
639 } | 639 } |
640 | 640 |
641 if (hasShadow) { | 641 if (hasShadow) { |
642 DrawLooper drawLooper; | 642 DrawLooper::Builder drawLooperBuilder; |
643 for (size_t i = shadowList->shadows().size(); i--; ) { | 643 for (size_t i = shadowList->shadows().size(); i--; ) { |
644 const ShadowData& shadow = shadowList->shadows()[i]; | 644 const ShadowData& shadow = shadowList->shadows()[i]; |
645 FloatSize offset(shadow.x(), shadow.y()); | 645 FloatSize offset(shadow.x(), shadow.y()); |
646 drawLooper.addShadow(offset, shadow.blur(), shadow.color(), | 646 drawLooperBuilder.addShadow(offset, shadow.blur(), shadow.color(), |
647 DrawLooper::ShadowRespectsTransforms, DrawLooper::ShadowRespects
Alpha); | 647 DrawLooper::ShadowRespectsTransforms, DrawLooper::ShadowRespects
Alpha); |
648 } | 648 } |
649 drawLooper.addUnmodifiedContent(); | 649 drawLooperBuilder.addUnmodifiedContent(); |
650 context->setDrawLooper(drawLooper); | 650 context->setDrawLooper(*drawLooperBuilder.detachDrawLooper()); |
651 } | 651 } |
652 | 652 |
653 if (prepareGraphicsContextForTextPainting(context, scalingFactor, textRun, s
tyle)) { | 653 if (prepareGraphicsContextForTextPainting(context, scalingFactor, textRun, s
tyle)) { |
654 TextRunPaintInfo textRunPaintInfo(textRun); | 654 TextRunPaintInfo textRunPaintInfo(textRun); |
655 textRunPaintInfo.from = startPosition; | 655 textRunPaintInfo.from = startPosition; |
656 textRunPaintInfo.to = endPosition; | 656 textRunPaintInfo.to = endPosition; |
657 textRunPaintInfo.bounds = FloatRect(textOrigin, textSize); | 657 textRunPaintInfo.bounds = FloatRect(textOrigin, textSize); |
658 scaledFont.drawText(context, textRunPaintInfo, textOrigin); | 658 scaledFont.drawText(context, textRunPaintInfo, textOrigin); |
659 restoreGraphicsContextAfterTextPainting(context, textRun); | 659 restoreGraphicsContextAfterTextPainting(context, textRun); |
660 } | 660 } |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 renderer()->updateHitTestResult(result, locationInContainer.poin
t() - toLayoutSize(accumulatedOffset)); | 811 renderer()->updateHitTestResult(result, locationInContainer.poin
t() - toLayoutSize(accumulatedOffset)); |
812 if (!result.addNodeToRectBasedTestResult(renderer()->node(), req
uest, locationInContainer, rect)) | 812 if (!result.addNodeToRectBasedTestResult(renderer()->node(), req
uest, locationInContainer, rect)) |
813 return true; | 813 return true; |
814 } | 814 } |
815 } | 815 } |
816 } | 816 } |
817 return false; | 817 return false; |
818 } | 818 } |
819 | 819 |
820 } // namespace WebCore | 820 } // namespace WebCore |
OLD | NEW |