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

Side by Side Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGInlineText.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) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> 2 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>
3 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
4 * Copyright (C) 2008 Rob Buis <buis@kde.org> 4 * Copyright (C) 2008 Rob Buis <buis@kde.org>
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 FloatRect objectBoundingBox() const override { 66 FloatRect objectBoundingBox() const override {
67 return floatLinesBoundingBox(); 67 return floatLinesBoundingBox();
68 } 68 }
69 69
70 bool isOfType(LayoutObjectType type) const override { 70 bool isOfType(LayoutObjectType type) const override {
71 return type == LayoutObjectSVG || type == LayoutObjectSVGInlineText || 71 return type == LayoutObjectSVG || type == LayoutObjectSVGInlineText ||
72 LayoutText::isOfType(type); 72 LayoutText::isOfType(type);
73 } 73 }
74 74
75 char objectSize() const override { return sizeof(this); }
76 char approximateHeapMemoryUsage() const override {
77 int memory = LayoutText::approximateHeapMemoryUsage();
78 // TODO(pdr): Also add memory from m_characterDataMap.
79 // TODO(pdr): Also add memory from m_metrics.
80 return memory;
81 }
82
75 PositionWithAffinity positionForPoint(const LayoutPoint&) override; 83 PositionWithAffinity positionForPoint(const LayoutPoint&) override;
76 LayoutRect localCaretRect( 84 LayoutRect localCaretRect(
77 InlineBox*, 85 InlineBox*,
78 int caretOffset, 86 int caretOffset,
79 LayoutUnit* extraWidthToEndOfLine = nullptr) override; 87 LayoutUnit* extraWidthToEndOfLine = nullptr) override;
80 LayoutRect linesBoundingBox() const override; 88 LayoutRect linesBoundingBox() const override;
81 InlineTextBox* createTextBox(int start, unsigned short length) override; 89 InlineTextBox* createTextBox(int start, unsigned short length) override;
82 90
83 LayoutRect absoluteVisualRect() const final; 91 LayoutRect absoluteVisualRect() const final;
84 FloatRect visualRectInLocalSVGCoordinates() const final; 92 FloatRect visualRectInLocalSVGCoordinates() const final;
85 93
86 float m_scalingFactor; 94 float m_scalingFactor;
87 Font m_scaledFont; 95 Font m_scaledFont;
88 SVGCharacterDataMap m_characterDataMap; 96 SVGCharacterDataMap m_characterDataMap;
89 Vector<SVGTextMetrics> m_metrics; 97 Vector<SVGTextMetrics> m_metrics;
90 }; 98 };
91 99
92 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutSVGInlineText, isSVGInlineText()); 100 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutSVGInlineText, isSVGInlineText());
93 101
94 } // namespace blink 102 } // namespace blink
95 103
96 #endif // LayoutSVGInlineText_h 104 #endif // LayoutSVGInlineText_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698