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/DrawLooperBuilder.h" | 49 #include "platform/graphics/DrawLooper.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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 const RenderObject* renderer, const Font& font, const TextRun& textRun, | 390 const RenderObject* renderer, const Font& font, const TextRun& textRun, |
391 const AtomicString& emphasisMark, int emphasisMarkOffset, | 391 const AtomicString& emphasisMark, int emphasisMarkOffset, |
392 int startOffset, int endOffset, int truncationPoint, | 392 int startOffset, int endOffset, int truncationPoint, |
393 const FloatPoint& textOrigin, const FloatRect& boxRect, | 393 const FloatPoint& textOrigin, const FloatRect& boxRect, |
394 const ShadowList* shadowList, bool stroked, bool horizontal) | 394 const ShadowList* shadowList, bool stroked, bool horizontal) |
395 { | 395 { |
396 // Text shadows are disabled when printing. http://crbug.com/258321 | 396 // Text shadows are disabled when printing. http://crbug.com/258321 |
397 bool hasShadow = shadowList && !context->printing(); | 397 bool hasShadow = shadowList && !context->printing(); |
398 | 398 |
399 if (hasShadow) { | 399 if (hasShadow) { |
400 OwnPtr<DrawLooperBuilder> drawLooperBuilder = DrawLooperBuilder::create(
); | 400 DrawLooper drawLooper; |
401 for (size_t i = shadowList->shadows().size(); i--; ) { | 401 for (size_t i = shadowList->shadows().size(); i--; ) { |
402 const ShadowData& shadow = shadowList->shadows()[i]; | 402 const ShadowData& shadow = shadowList->shadows()[i]; |
403 float shadowX = horizontal ? shadow.x() : shadow.y(); | 403 float shadowX = horizontal ? shadow.x() : shadow.y(); |
404 float shadowY = horizontal ? shadow.y() : -shadow.x(); | 404 float shadowY = horizontal ? shadow.y() : -shadow.x(); |
405 FloatSize offset(shadowX, shadowY); | 405 FloatSize offset(shadowX, shadowY); |
406 drawLooperBuilder->addShadow(offset, shadow.blur(), shadow.color(), | 406 drawLooper.addShadow(offset, shadow.blur(), shadow.color(), |
407 DrawLooperBuilder::ShadowRespectsTransforms, DrawLooperBuilder::
ShadowIgnoresAlpha); | 407 DrawLooper::ShadowRespectsTransforms, DrawLooper::ShadowIgnoresA
lpha); |
408 } | 408 } |
409 drawLooperBuilder->addUnmodifiedContent(); | 409 drawLooper.addUnmodifiedContent(); |
410 context->setDrawLooper(drawLooperBuilder.release()); | 410 context->setDrawLooper(drawLooper); |
411 } | 411 } |
412 | 412 |
413 TextRunPaintInfo textRunPaintInfo(textRun); | 413 TextRunPaintInfo textRunPaintInfo(textRun); |
414 textRunPaintInfo.bounds = boxRect; | 414 textRunPaintInfo.bounds = boxRect; |
415 if (startOffset <= endOffset) { | 415 if (startOffset <= endOffset) { |
416 textRunPaintInfo.from = startOffset; | 416 textRunPaintInfo.from = startOffset; |
417 textRunPaintInfo.to = endOffset; | 417 textRunPaintInfo.to = endOffset; |
418 if (emphasisMark.isEmpty()) | 418 if (emphasisMark.isEmpty()) |
419 context->drawText(font, textRunPaintInfo, textOrigin); | 419 context->drawText(font, textRunPaintInfo, textOrigin); |
420 else | 420 else |
(...skipping 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1562 printedCharacters = fprintf(stderr, "\t%s %p", obj->renderName(), obj); | 1562 printedCharacters = fprintf(stderr, "\t%s %p", obj->renderName(), obj); |
1563 const int rendererCharacterOffset = 24; | 1563 const int rendererCharacterOffset = 24; |
1564 for (; printedCharacters < rendererCharacterOffset; printedCharacters++) | 1564 for (; printedCharacters < rendererCharacterOffset; printedCharacters++) |
1565 fputc(' ', stderr); | 1565 fputc(' ', stderr); |
1566 fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(), value.utf8().d
ata()); | 1566 fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(), value.utf8().d
ata()); |
1567 } | 1567 } |
1568 | 1568 |
1569 #endif | 1569 #endif |
1570 | 1570 |
1571 } // namespace WebCore | 1571 } // namespace WebCore |
OLD | NEW |