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

Side by Side Diff: third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp

Issue 2707083002: Remove the text blob cache (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/InlineTextBoxPainter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 "InlineTextBox should stay small"); 50 "InlineTextBox should stay small");
51 51
52 typedef WTF::HashMap<const InlineTextBox*, LayoutRect> InlineTextBoxOverflowMap; 52 typedef WTF::HashMap<const InlineTextBox*, LayoutRect> InlineTextBoxOverflowMap;
53 static InlineTextBoxOverflowMap* gTextBoxesWithOverflow; 53 static InlineTextBoxOverflowMap* gTextBoxesWithOverflow;
54 54
55 void InlineTextBox::destroy() { 55 void InlineTextBox::destroy() {
56 AbstractInlineTextBox::willDestroy(this); 56 AbstractInlineTextBox::willDestroy(this);
57 57
58 if (!knownToHaveNoOverflow() && gTextBoxesWithOverflow) 58 if (!knownToHaveNoOverflow() && gTextBoxesWithOverflow)
59 gTextBoxesWithOverflow->erase(this); 59 gTextBoxesWithOverflow->erase(this);
60 InlineTextBoxPainter::removeFromTextBlobCache(*this);
61 InlineBox::destroy(); 60 InlineBox::destroy();
62 } 61 }
63 62
64 void InlineTextBox::offsetRun(int delta) { 63 void InlineTextBox::offsetRun(int delta) {
65 ASSERT(!isDirty()); 64 ASSERT(!isDirty());
66 InlineTextBoxPainter::removeFromTextBlobCache(*this);
67 m_start += delta; 65 m_start += delta;
68 } 66 }
69 67
70 void InlineTextBox::markDirty() { 68 void InlineTextBox::markDirty() {
71 // FIXME: Is it actually possible to try and paint a dirty InlineTextBox?
72 InlineTextBoxPainter::removeFromTextBlobCache(*this);
73
74 m_len = 0; 69 m_len = 0;
75 m_start = 0; 70 m_start = 0;
76 InlineBox::markDirty(); 71 InlineBox::markDirty();
77 } 72 }
78 73
79 LayoutRect InlineTextBox::logicalOverflowRect() const { 74 LayoutRect InlineTextBox::logicalOverflowRect() const {
80 if (knownToHaveNoOverflow() || !gTextBoxesWithOverflow) 75 if (knownToHaveNoOverflow() || !gTextBoxesWithOverflow)
81 return logicalFrameRect(); 76 return logicalFrameRect();
82 77
83 const auto& it = gTextBoxesWithOverflow->find(this); 78 const auto& it = gTextBoxesWithOverflow->find(this);
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 return; 293 return;
299 294
300 getLineLayoutItem().attachTextBox(this); 295 getLineLayoutItem().attachTextBox(this);
301 } 296 }
302 297
303 void InlineTextBox::setTruncation(unsigned truncation) { 298 void InlineTextBox::setTruncation(unsigned truncation) {
304 if (truncation == m_truncation) 299 if (truncation == m_truncation)
305 return; 300 return;
306 301
307 m_truncation = truncation; 302 m_truncation = truncation;
308 InlineTextBoxPainter::removeFromTextBlobCache(*this);
309 } 303 }
310 304
311 void InlineTextBox::clearTruncation() { 305 void InlineTextBox::clearTruncation() {
312 setTruncation(cNoTruncation); 306 setTruncation(cNoTruncation);
313 } 307 }
314 308
315 LayoutUnit InlineTextBox::placeEllipsisBox(bool flowIsLTR, 309 LayoutUnit InlineTextBox::placeEllipsisBox(bool flowIsLTR,
316 LayoutUnit visibleLeftEdge, 310 LayoutUnit visibleLeftEdge,
317 LayoutUnit visibleRightEdge, 311 LayoutUnit visibleRightEdge,
318 LayoutUnit ellipsisWidth, 312 LayoutUnit ellipsisWidth,
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 const int layoutObjectCharacterOffset = 75; 682 const int layoutObjectCharacterOffset = 75;
689 for (; printedCharacters < layoutObjectCharacterOffset; printedCharacters++) 683 for (; printedCharacters < layoutObjectCharacterOffset; printedCharacters++)
690 fputc(' ', stderr); 684 fputc(' ', stderr);
691 fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(), 685 fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(),
692 value.utf8().data()); 686 value.utf8().data());
693 } 687 }
694 688
695 #endif 689 #endif
696 690
697 } // namespace blink 691 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/InlineTextBoxPainter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698