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 21 matching lines...) Expand all Loading... |
32 #include "core/rendering/PointerEventsHitRules.h" | 32 #include "core/rendering/PointerEventsHitRules.h" |
33 #include "core/rendering/RenderTheme.h" | 33 #include "core/rendering/RenderTheme.h" |
34 #include "core/rendering/style/ShadowList.h" | 34 #include "core/rendering/style/ShadowList.h" |
35 #include "core/rendering/svg/RenderSVGInlineText.h" | 35 #include "core/rendering/svg/RenderSVGInlineText.h" |
36 #include "core/rendering/svg/RenderSVGResource.h" | 36 #include "core/rendering/svg/RenderSVGResource.h" |
37 #include "core/rendering/svg/RenderSVGResourceSolidColor.h" | 37 #include "core/rendering/svg/RenderSVGResourceSolidColor.h" |
38 #include "core/rendering/svg/SVGResourcesCache.h" | 38 #include "core/rendering/svg/SVGResourcesCache.h" |
39 #include "core/rendering/svg/SVGTextRunRenderingContext.h" | 39 #include "core/rendering/svg/SVGTextRunRenderingContext.h" |
40 #include "platform/FloatConversion.h" | 40 #include "platform/FloatConversion.h" |
41 #include "platform/fonts/FontCache.h" | 41 #include "platform/fonts/FontCache.h" |
42 #include "platform/graphics/DrawLooperBuilder.h" | 42 #include "platform/graphics/DrawLooper.h" |
43 #include "platform/graphics/GraphicsContextStateSaver.h" | 43 #include "platform/graphics/GraphicsContextStateSaver.h" |
44 | 44 |
45 using namespace std; | 45 using namespace std; |
46 | 46 |
47 namespace WebCore { | 47 namespace WebCore { |
48 | 48 |
49 struct ExpectedSVGInlineTextBoxSize : public InlineTextBox { | 49 struct ExpectedSVGInlineTextBoxSize : public InlineTextBox { |
50 float float1; | 50 float float1; |
51 uint32_t bitfields : 5; | 51 uint32_t bitfields : 5; |
52 void* pointer; | 52 void* pointer; |
(...skipping 579 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 OwnPtr<DrawLooperBuilder> drawLooperBuilder = DrawLooperBuilder::create(
); | 642 DrawLooper drawLooper; |
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 drawLooperBuilder->addShadow(offset, shadow.blur(), shadow.color(), | 646 drawLooper.addShadow(offset, shadow.blur(), shadow.color(), |
647 DrawLooperBuilder::ShadowRespectsTransforms, DrawLooperBuilder::
ShadowRespectsAlpha); | 647 DrawLooper::ShadowRespectsTransforms, DrawLooper::ShadowRespects
Alpha); |
648 } | 648 } |
649 drawLooperBuilder->addUnmodifiedContent(); | 649 drawLooper.addUnmodifiedContent(); |
650 context->setDrawLooper(drawLooperBuilder.release()); | 650 context->setDrawLooper(drawLooper); |
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 |