| 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 379 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 DrawLooper drawLooper; | 400 DrawLooper::Builder drawLooperBuilder; |
| 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 drawLooper.addShadow(offset, shadow.blur(), shadow.color(), | 406 drawLooperBuilder.addShadow(offset, shadow.blur(), shadow.color(), |
| 407 DrawLooper::ShadowRespectsTransforms, DrawLooper::ShadowIgnoresA
lpha); | 407 DrawLooper::ShadowRespectsTransforms, DrawLooper::ShadowIgnoresA
lpha); |
| 408 } | 408 } |
| 409 drawLooper.addUnmodifiedContent(); | 409 drawLooperBuilder.addUnmodifiedContent(); |
| 410 context->setDrawLooper(drawLooper); | 410 context->setDrawLooper(*drawLooperBuilder.detachDrawLooper().get()); |
| 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 |