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

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

Issue 16896019: Replace RenderArena with PartitionAlloc. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) 5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net)
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 box->nextTextBox()->setPreviousTextBox(box->prevTextBox()); 291 box->nextTextBox()->setPreviousTextBox(box->prevTextBox());
292 if (box->prevTextBox()) 292 if (box->prevTextBox())
293 box->prevTextBox()->setNextTextBox(box->nextTextBox()); 293 box->prevTextBox()->setNextTextBox(box->nextTextBox());
294 294
295 checkConsistency(); 295 checkConsistency();
296 } 296 }
297 297
298 void RenderText::deleteTextBoxes() 298 void RenderText::deleteTextBoxes()
299 { 299 {
300 if (firstTextBox()) { 300 if (firstTextBox()) {
301 RenderArena* arena = renderArena();
302 InlineTextBox* next; 301 InlineTextBox* next;
303 for (InlineTextBox* curr = firstTextBox(); curr; curr = next) { 302 for (InlineTextBox* curr = firstTextBox(); curr; curr = next) {
304 next = curr->nextTextBox(); 303 next = curr->nextTextBox();
305 curr->destroy(arena); 304 curr->destroy();
306 } 305 }
307 m_firstTextBox = m_lastTextBox = 0; 306 m_firstTextBox = m_lastTextBox = 0;
308 } 307 }
309 } 308 }
310 309
311 PassRefPtr<StringImpl> RenderText::originalText() const 310 PassRefPtr<StringImpl> RenderText::originalText() const
312 { 311 {
313 Node* e = node(); 312 Node* e = node();
314 return (e && e->isTextNode()) ? toText(e)->dataImpl() : 0; 313 return (e && e->isTextNode()) ? toText(e)->dataImpl() : 0;
315 } 314 }
(...skipping 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after
1479 deleteTextBoxes(); 1478 deleteTextBoxes();
1480 else if (!m_linesDirty) { 1479 else if (!m_linesDirty) {
1481 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) 1480 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox())
1482 box->dirtyLineBoxes(); 1481 box->dirtyLineBoxes();
1483 } 1482 }
1484 m_linesDirty = false; 1483 m_linesDirty = false;
1485 } 1484 }
1486 1485
1487 InlineTextBox* RenderText::createTextBox() 1486 InlineTextBox* RenderText::createTextBox()
1488 { 1487 {
1489 return new (renderArena()) InlineTextBox(this); 1488 return new InlineTextBox(this);
1490 } 1489 }
1491 1490
1492 InlineTextBox* RenderText::createInlineTextBox() 1491 InlineTextBox* RenderText::createInlineTextBox()
1493 { 1492 {
1494 InlineTextBox* textBox = createTextBox(); 1493 InlineTextBox* textBox = createTextBox();
1495 if (!m_firstTextBox) 1494 if (!m_firstTextBox)
1496 m_firstTextBox = m_lastTextBox = textBox; 1495 m_firstTextBox = m_lastTextBox = textBox;
1497 else { 1496 else {
1498 m_lastTextBox->setNextTextBox(textBox); 1497 m_lastTextBox->setNextTextBox(textBox);
1499 textBox->setPreviousTextBox(m_lastTextBox); 1498 textBox->setPreviousTextBox(m_lastTextBox);
(...skipping 12 matching lines...) Expand all
1512 // We want the box to be destroyed. 1511 // We want the box to be destroyed.
1513 s->remove(); 1512 s->remove();
1514 if (m_firstTextBox == s) 1513 if (m_firstTextBox == s)
1515 m_firstTextBox = s->nextTextBox(); 1514 m_firstTextBox = s->nextTextBox();
1516 else 1515 else
1517 s->prevTextBox()->setNextTextBox(s->nextTextBox()); 1516 s->prevTextBox()->setNextTextBox(s->nextTextBox());
1518 if (m_lastTextBox == s) 1517 if (m_lastTextBox == s)
1519 m_lastTextBox = s->prevTextBox(); 1518 m_lastTextBox = s->prevTextBox();
1520 else 1519 else
1521 s->nextTextBox()->setPreviousTextBox(s->prevTextBox()); 1520 s->nextTextBox()->setPreviousTextBox(s->prevTextBox());
1522 s->destroy(renderArena()); 1521 s->destroy();
1523 return; 1522 return;
1524 } 1523 }
1525 1524
1526 m_containsReversedText |= !s->isLeftToRightDirection(); 1525 m_containsReversedText |= !s->isLeftToRightDirection();
1527 } 1526 }
1528 1527
1529 float RenderText::width(unsigned from, unsigned len, float xPos, bool firstLine, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) co nst 1528 float RenderText::width(unsigned from, unsigned len, float xPos, bool firstLine, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) co nst
1530 { 1529 {
1531 if (from >= textLength()) 1530 if (from >= textLength())
1532 return 0; 1531 return 0;
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
1929 void RenderText::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 1928 void RenderText::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
1930 { 1929 {
1931 MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Rendering) ; 1930 MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Rendering) ;
1932 RenderObject::reportMemoryUsage(memoryObjectInfo); 1931 RenderObject::reportMemoryUsage(memoryObjectInfo);
1933 info.addMember(m_text, "text"); 1932 info.addMember(m_text, "text");
1934 info.addMember(m_firstTextBox, "firstTextBox"); 1933 info.addMember(m_firstTextBox, "firstTextBox");
1935 info.addMember(m_lastTextBox, "lastTextBox"); 1934 info.addMember(m_lastTextBox, "lastTextBox");
1936 } 1935 }
1937 1936
1938 } // namespace WebCore 1937 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698