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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutTextCombine.h

Issue 2766943002: Do-not-commit: Count layout tree memory usage
Patch Set: Rebase, add object paint property counter Created 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 30 matching lines...) Expand all
41 const Font& originalFont() const { return parent()->style()->font(); } 41 const Font& originalFont() const { return parent()->style()->font(); }
42 void transformToInlineCoordinates(GraphicsContext&, 42 void transformToInlineCoordinates(GraphicsContext&,
43 const LayoutRect& boxRect, 43 const LayoutRect& boxRect,
44 bool clip = false) const; 44 bool clip = false) const;
45 LayoutUnit inlineWidthForLayout() const; 45 LayoutUnit inlineWidthForLayout() const;
46 46
47 const char* name() const override { return "LayoutTextCombine"; } 47 const char* name() const override { return "LayoutTextCombine"; }
48 48
49 private: 49 private:
50 bool isCombineText() const override { return true; } 50 bool isCombineText() const override { return true; }
51 char objectSize() const override { return sizeof(this); }
51 float width(unsigned from, 52 float width(unsigned from,
52 unsigned length, 53 unsigned length,
53 const Font&, 54 const Font&,
54 LayoutUnit xPosition, 55 LayoutUnit xPosition,
55 TextDirection, 56 TextDirection,
56 HashSet<const SimpleFontData*>* fallbackFonts = nullptr, 57 HashSet<const SimpleFontData*>* fallbackFonts = nullptr,
57 FloatRect* glyphBounds = nullptr) const override; 58 FloatRect* glyphBounds = nullptr) const override;
58 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override; 59 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override;
59 void setTextInternal(PassRefPtr<StringImpl>) override; 60 void setTextInternal(PassRefPtr<StringImpl>) override;
60 void updateIsCombined(); 61 void updateIsCombined();
61 62
62 float m_combinedTextWidth; 63 float m_combinedTextWidth;
63 float m_scaleX; 64 float m_scaleX;
64 bool m_isCombined : 1; 65 bool m_isCombined : 1;
65 bool m_needsFontUpdate : 1; 66 bool m_needsFontUpdate : 1;
66 }; 67 };
67 68
68 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTextCombine, isCombineText()); 69 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTextCombine, isCombineText());
69 70
70 inline LayoutUnit LayoutTextCombine::inlineWidthForLayout() const { 71 inline LayoutUnit LayoutTextCombine::inlineWidthForLayout() const {
71 ASSERT(!m_needsFontUpdate); 72 ASSERT(!m_needsFontUpdate);
72 return LayoutUnit::fromFloatCeil(m_combinedTextWidth); 73 return LayoutUnit::fromFloatCeil(m_combinedTextWidth);
73 } 74 }
74 75
75 } // namespace blink 76 } // namespace blink
76 77
77 #endif // LayoutTextCombine_h 78 #endif // LayoutTextCombine_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutText.h ('k') | third_party/WebKit/Source/core/layout/LayoutTextControl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698