Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Side by Side Diff: Source/core/rendering/InlineTextBox.cpp

Issue 14160005: Track the region where text is painted. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase with TOT Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 422
423 do { 423 do {
424 IntSize extraOffset; 424 IntSize extraOffset;
425 if (shadow) 425 if (shadow)
426 extraOffset = roundedIntSize(InlineTextBox::applyShadowToGraphicsCon text(context, shadow, boxRect, stroked, opaque, horizontal)); 426 extraOffset = roundedIntSize(InlineTextBox::applyShadowToGraphicsCon text(context, shadow, boxRect, stroked, opaque, horizontal));
427 else if (!opaque) 427 else if (!opaque)
428 context->setFillColor(fillColor, fillColorSpace); 428 context->setFillColor(fillColor, fillColorSpace);
429 429
430 if (startOffset <= endOffset) { 430 if (startOffset <= endOffset) {
431 if (emphasisMark.isEmpty()) 431 if (emphasisMark.isEmpty())
432 context->drawText(font, textRun, textOrigin + extraOffset, start Offset, endOffset); 432 context->drawText(font, textRun, textOrigin + extraOffset, boxRe ct, startOffset, endOffset);
433 else 433 else
434 context->drawEmphasisMarks(font, textRun, emphasisMark, textOrig in + extraOffset + IntSize(0, emphasisMarkOffset), startOffset, endOffset); 434 context->drawEmphasisMarks(font, textRun, emphasisMark, textOrig in + extraOffset + IntSize(0, emphasisMarkOffset), boxRect, startOffset, endOffs et);
435 } else { 435 } else {
436 if (endOffset > 0) { 436 if (endOffset > 0) {
437 if (emphasisMark.isEmpty()) 437 if (emphasisMark.isEmpty())
438 context->drawText(font, textRun, textOrigin + extraOffset, 0, endOffset); 438 context->drawText(font, textRun, textOrigin + extraOffset, b oxRect, 0, endOffset);
439 else 439 else
440 context->drawEmphasisMarks(font, textRun, emphasisMark, text Origin + extraOffset + IntSize(0, emphasisMarkOffset), 0, endOffset); 440 context->drawEmphasisMarks(font, textRun, emphasisMark, text Origin + extraOffset + IntSize(0, emphasisMarkOffset), boxRect, 0, endOffset);
441 } 441 }
442 if (startOffset < truncationPoint) { 442 if (startOffset < truncationPoint) {
443 if (emphasisMark.isEmpty()) 443 if (emphasisMark.isEmpty())
444 context->drawText(font, textRun, textOrigin + extraOffset, s tartOffset, truncationPoint); 444 context->drawText(font, textRun, textOrigin + extraOffset, b oxRect, startOffset, truncationPoint);
445 else 445 else
446 context->drawEmphasisMarks(font, textRun, emphasisMark, text Origin + extraOffset + IntSize(0, emphasisMarkOffset), startOffset, truncationP oint); 446 context->drawEmphasisMarks(font, textRun, emphasisMark, text Origin + extraOffset + IntSize(0, emphasisMarkOffset), boxRect, startOffset, tru ncationPoint);
447 } 447 }
448 } 448 }
449 449
450 if (!shadow) 450 if (!shadow)
451 break; 451 break;
452 452
453 if (shadow->next() || stroked || !opaque) 453 if (shadow->next() || stroked || !opaque)
454 context->restore(); 454 context->restore();
455 else 455 else
456 context->clearShadow(); 456 context->clearShadow();
(...skipping 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after
1629 1629
1630 void InlineTextBox::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 1630 void InlineTextBox::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
1631 { 1631 {
1632 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Rendering); 1632 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Rendering);
1633 InlineBox::reportMemoryUsage(memoryObjectInfo); 1633 InlineBox::reportMemoryUsage(memoryObjectInfo);
1634 info.addMember(m_prevTextBox, "prevTextBox"); 1634 info.addMember(m_prevTextBox, "prevTextBox");
1635 info.addMember(m_nextTextBox, "nextTextBox"); 1635 info.addMember(m_nextTextBox, "nextTextBox");
1636 } 1636 }
1637 1637
1638 } // namespace WebCore 1638 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698