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

Side by Side Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGShape.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) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
4 * Copyright (C) 2005 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2006 Apple Computer, Inc 5 * Copyright (C) 2006 Apple Computer, Inc
6 * Copyright (C) 2009 Google, Inc. 6 * Copyright (C) 2009 Google, Inc.
7 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org> 7 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org>
8 * Copyright (C) 2011 University of Szeged 8 * Copyright (C) 2011 University of Szeged
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 // include this shape's stroke bounding box if it had a stroke. 118 // include this shape's stroke bounding box if it had a stroke.
119 virtual FloatRect hitTestStrokeBoundingBox() const; 119 virtual FloatRect hitTestStrokeBoundingBox() const;
120 virtual bool shapeDependentStrokeContains(const FloatPoint&); 120 virtual bool shapeDependentStrokeContains(const FloatPoint&);
121 virtual bool shapeDependentFillContains(const FloatPoint&, 121 virtual bool shapeDependentFillContains(const FloatPoint&,
122 const WindRule) const; 122 const WindRule) const;
123 123
124 FloatRect m_fillBoundingBox; 124 FloatRect m_fillBoundingBox;
125 FloatRect m_strokeBoundingBox; 125 FloatRect m_strokeBoundingBox;
126 LayoutSVGShapeRareData& ensureRareData() const; 126 LayoutSVGShapeRareData& ensureRareData() const;
127 127
128 char objectSize() const override { return sizeof(this); }
129 char approximateHeapMemoryUsage() const override {
130 int memory = LayoutSVGModelObject::approximateHeapMemoryUsage();
131 // TODO(pdr): Include memory from m_path.
132 if (m_rareData)
133 memory += sizeof(LayoutSVGShapeRareData);
134 return memory;
135 }
136
128 private: 137 private:
129 // Hit-detection separated for the fill and the stroke 138 // Hit-detection separated for the fill and the stroke
130 bool fillContains(const FloatPoint&, 139 bool fillContains(const FloatPoint&,
131 bool requiresFill = true, 140 bool requiresFill = true,
132 const WindRule fillRule = RULE_NONZERO); 141 const WindRule fillRule = RULE_NONZERO);
133 bool strokeContains(const FloatPoint&, bool requiresStroke = true); 142 bool strokeContains(const FloatPoint&, bool requiresStroke = true);
134 143
135 bool isOfType(LayoutObjectType type) const override { 144 bool isOfType(LayoutObjectType type) const override {
136 return type == LayoutObjectSVGShape || LayoutSVGModelObject::isOfType(type); 145 return type == LayoutObjectSVGShape || LayoutSVGModelObject::isOfType(type);
137 } 146 }
(...skipping 24 matching lines...) Expand all
162 bool m_needsBoundariesUpdate : 1; 171 bool m_needsBoundariesUpdate : 1;
163 bool m_needsShapeUpdate : 1; 172 bool m_needsShapeUpdate : 1;
164 bool m_needsTransformUpdate : 1; 173 bool m_needsTransformUpdate : 1;
165 }; 174 };
166 175
167 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutSVGShape, isSVGShape()); 176 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutSVGShape, isSVGShape());
168 177
169 } // namespace blink 178 } // namespace blink
170 179
171 #endif 180 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.h ('k') | third_party/WebKit/Source/core/layout/svg/LayoutSVGTSpan.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698