| 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 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 FloatSize textSize(fragment.width, fragment.height); | 618 FloatSize textSize(fragment.width, fragment.height); |
| 619 | 619 |
| 620 if (scalingFactor != 1) { | 620 if (scalingFactor != 1) { |
| 621 textOrigin.scale(scalingFactor, scalingFactor); | 621 textOrigin.scale(scalingFactor, scalingFactor); |
| 622 textSize.scale(scalingFactor); | 622 textSize.scale(scalingFactor); |
| 623 context->save(); | 623 context->save(); |
| 624 context->scale(FloatSize(1 / scalingFactor, 1 / scalingFactor)); | 624 context->scale(FloatSize(1 / scalingFactor, 1 / scalingFactor)); |
| 625 } | 625 } |
| 626 | 626 |
| 627 if (hasShadow) { | 627 if (hasShadow) { |
| 628 DrawLooper drawLooper; | 628 RefPtr<DrawLooper> drawLooper(new DrawLooper); |
| 629 do { | 629 do { |
| 630 FloatSize offset(shadow->x(), shadow->y()); | 630 FloatSize offset(shadow->x(), shadow->y()); |
| 631 drawLooper.addShadow(offset, shadow->blur(), textRenderer->resolveCo
lor(shadow->color(), Color::stdShadowColor), | 631 drawLooper->addShadow(offset, shadow->blur(), textRenderer->resolveC
olor(shadow->color(), Color::stdShadowColor), |
| 632 DrawLooper::ShadowRespectsTransforms, DrawLooper::ShadowRespects
Alpha); | 632 DrawLooper::ShadowRespectsTransforms, DrawLooper::ShadowRespects
Alpha); |
| 633 } while ((shadow = shadow->next())); | 633 } while ((shadow = shadow->next())); |
| 634 drawLooper.addUnmodifiedContent(); | 634 drawLooper->addUnmodifiedContent(); |
| 635 context->setDrawLooper(drawLooper); | 635 context->setDrawLooper(drawLooper.release()); |
| 636 } | 636 } |
| 637 | 637 |
| 638 if (prepareGraphicsContextForTextPainting(context, scalingFactor, textRun, s
tyle)) { | 638 if (prepareGraphicsContextForTextPainting(context, scalingFactor, textRun, s
tyle)) { |
| 639 TextRunPaintInfo textRunPaintInfo(textRun); | 639 TextRunPaintInfo textRunPaintInfo(textRun); |
| 640 textRunPaintInfo.from = startPosition; | 640 textRunPaintInfo.from = startPosition; |
| 641 textRunPaintInfo.to = endPosition; | 641 textRunPaintInfo.to = endPosition; |
| 642 textRunPaintInfo.bounds = FloatRect(textOrigin, textSize); | 642 textRunPaintInfo.bounds = FloatRect(textOrigin, textSize); |
| 643 scaledFont.drawText(context, textRunPaintInfo, textOrigin); | 643 scaledFont.drawText(context, textRunPaintInfo, textOrigin); |
| 644 restoreGraphicsContextAfterTextPainting(context, textRun); | 644 restoreGraphicsContextAfterTextPainting(context, textRun); |
| 645 } | 645 } |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 renderer()->updateHitTestResult(result, locationInContainer.poin
t() - toLayoutSize(accumulatedOffset)); | 732 renderer()->updateHitTestResult(result, locationInContainer.poin
t() - toLayoutSize(accumulatedOffset)); |
| 733 if (!result.addNodeToRectBasedTestResult(renderer()->node(), req
uest, locationInContainer, rect)) | 733 if (!result.addNodeToRectBasedTestResult(renderer()->node(), req
uest, locationInContainer, rect)) |
| 734 return true; | 734 return true; |
| 735 } | 735 } |
| 736 } | 736 } |
| 737 } | 737 } |
| 738 return false; | 738 return false; |
| 739 } | 739 } |
| 740 | 740 |
| 741 } // namespace WebCore | 741 } // namespace WebCore |
| OLD | NEW |