| OLD | NEW |
| 1 /* | 1 /* |
| 2 * (C) 1999 Lars Knoll (knoll@kde.org) | 2 * (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 2000 Dirk Mueller (mueller@kde.org) | 3 * (C) 2000 Dirk Mueller (mueller@kde.org) |
| 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights 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 28 matching lines...) Expand all Loading... |
| 39 #include "core/rendering/RenderBR.h" | 39 #include "core/rendering/RenderBR.h" |
| 40 #include "core/rendering/RenderBlock.h" | 40 #include "core/rendering/RenderBlock.h" |
| 41 #include "core/rendering/RenderCombineText.h" | 41 #include "core/rendering/RenderCombineText.h" |
| 42 #include "core/rendering/RenderRubyRun.h" | 42 #include "core/rendering/RenderRubyRun.h" |
| 43 #include "core/rendering/RenderRubyText.h" | 43 #include "core/rendering/RenderRubyText.h" |
| 44 #include "core/rendering/RenderTheme.h" | 44 #include "core/rendering/RenderTheme.h" |
| 45 #include "core/rendering/style/ShadowList.h" | 45 #include "core/rendering/style/ShadowList.h" |
| 46 #include "core/rendering/svg/SVGTextRunRenderingContext.h" | 46 #include "core/rendering/svg/SVGTextRunRenderingContext.h" |
| 47 #include "platform/fonts/FontCache.h" | 47 #include "platform/fonts/FontCache.h" |
| 48 #include "platform/fonts/WidthIterator.h" | 48 #include "platform/fonts/WidthIterator.h" |
| 49 #include "platform/graphics/DrawLooper.h" | 49 #include "platform/graphics/DrawLooperBuilder.h" |
| 50 #include "platform/graphics/GraphicsContextStateSaver.h" | 50 #include "platform/graphics/GraphicsContextStateSaver.h" |
| 51 #include "wtf/Vector.h" | 51 #include "wtf/Vector.h" |
| 52 #include "wtf/text/CString.h" | 52 #include "wtf/text/CString.h" |
| 53 #include "wtf/text/StringBuilder.h" | 53 #include "wtf/text/StringBuilder.h" |
| 54 | 54 |
| 55 using namespace std; | 55 using namespace std; |
| 56 | 56 |
| 57 namespace WebCore { | 57 namespace WebCore { |
| 58 | 58 |
| 59 struct SameSizeAsInlineTextBox : public InlineBox { | 59 struct SameSizeAsInlineTextBox : public InlineBox { |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 const RenderObject& renderer, const Font& font, const TextRun& textRun, | 389 const RenderObject& renderer, const Font& font, const TextRun& textRun, |
| 390 const AtomicString& emphasisMark, int emphasisMarkOffset, | 390 const AtomicString& emphasisMark, int emphasisMarkOffset, |
| 391 int startOffset, int endOffset, int truncationPoint, | 391 int startOffset, int endOffset, int truncationPoint, |
| 392 const FloatPoint& textOrigin, const FloatRect& boxRect, | 392 const FloatPoint& textOrigin, const FloatRect& boxRect, |
| 393 const ShadowList* shadowList, bool stroked, bool horizontal) | 393 const ShadowList* shadowList, bool stroked, bool horizontal) |
| 394 { | 394 { |
| 395 // Text shadows are disabled when printing. http://crbug.com/258321 | 395 // Text shadows are disabled when printing. http://crbug.com/258321 |
| 396 bool hasShadow = shadowList && !context->printing(); | 396 bool hasShadow = shadowList && !context->printing(); |
| 397 | 397 |
| 398 if (hasShadow) { | 398 if (hasShadow) { |
| 399 DrawLooper drawLooper; | 399 OwnPtr<DrawLooperBuilder> drawLooperBuilder = DrawLooperBuilder::create(
); |
| 400 for (size_t i = shadowList->shadows().size(); i--; ) { | 400 for (size_t i = shadowList->shadows().size(); i--; ) { |
| 401 const ShadowData& shadow = shadowList->shadows()[i]; | 401 const ShadowData& shadow = shadowList->shadows()[i]; |
| 402 float shadowX = horizontal ? shadow.x() : shadow.y(); | 402 float shadowX = horizontal ? shadow.x() : shadow.y(); |
| 403 float shadowY = horizontal ? shadow.y() : -shadow.x(); | 403 float shadowY = horizontal ? shadow.y() : -shadow.x(); |
| 404 FloatSize offset(shadowX, shadowY); | 404 FloatSize offset(shadowX, shadowY); |
| 405 drawLooper.addShadow(offset, shadow.blur(), shadow.color(), | 405 drawLooperBuilder->addShadow(offset, shadow.blur(), shadow.color(), |
| 406 DrawLooper::ShadowRespectsTransforms, DrawLooper::ShadowIgnoresA
lpha); | 406 DrawLooperBuilder::ShadowRespectsTransforms, DrawLooperBuilder::
ShadowIgnoresAlpha); |
| 407 } | 407 } |
| 408 drawLooper.addUnmodifiedContent(); | 408 drawLooperBuilder->addUnmodifiedContent(); |
| 409 context->setDrawLooper(drawLooper); | 409 context->setDrawLooper(drawLooperBuilder.release()); |
| 410 } | 410 } |
| 411 | 411 |
| 412 TextRunPaintInfo textRunPaintInfo(textRun); | 412 TextRunPaintInfo textRunPaintInfo(textRun); |
| 413 textRunPaintInfo.bounds = boxRect; | 413 textRunPaintInfo.bounds = boxRect; |
| 414 if (startOffset <= endOffset) { | 414 if (startOffset <= endOffset) { |
| 415 textRunPaintInfo.from = startOffset; | 415 textRunPaintInfo.from = startOffset; |
| 416 textRunPaintInfo.to = endOffset; | 416 textRunPaintInfo.to = endOffset; |
| 417 if (emphasisMark.isEmpty()) | 417 if (emphasisMark.isEmpty()) |
| 418 context->drawText(font, textRunPaintInfo, textOrigin); | 418 context->drawText(font, textRunPaintInfo, textOrigin); |
| 419 else | 419 else |
| (...skipping 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1565 printedCharacters = fprintf(stderr, "\t%s %p", obj.renderName(), &obj); | 1565 printedCharacters = fprintf(stderr, "\t%s %p", obj.renderName(), &obj); |
| 1566 const int rendererCharacterOffset = 24; | 1566 const int rendererCharacterOffset = 24; |
| 1567 for (; printedCharacters < rendererCharacterOffset; printedCharacters++) | 1567 for (; printedCharacters < rendererCharacterOffset; printedCharacters++) |
| 1568 fputc(' ', stderr); | 1568 fputc(' ', stderr); |
| 1569 fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(), value.utf8().d
ata()); | 1569 fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(), value.utf8().d
ata()); |
| 1570 } | 1570 } |
| 1571 | 1571 |
| 1572 #endif | 1572 #endif |
| 1573 | 1573 |
| 1574 } // namespace WebCore | 1574 } // namespace WebCore |
| OLD | NEW |