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/LayoutSVGResourceClipper.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) Research In Motion Limited 2009-2010. All rights reserved. 2 * Copyright (C) Research In Motion Limited 2009-2010. 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 void beginClipExpansion() { 58 void beginClipExpansion() {
59 DCHECK(!m_inClipExpansion); 59 DCHECK(!m_inClipExpansion);
60 m_inClipExpansion = true; 60 m_inClipExpansion = true;
61 } 61 }
62 void endClipExpansion() { 62 void endClipExpansion() {
63 DCHECK(m_inClipExpansion); 63 DCHECK(m_inClipExpansion);
64 m_inClipExpansion = false; 64 m_inClipExpansion = false;
65 } 65 }
66 66
67 private: 67 private:
68 char objectSize() const override { return sizeof(this); }
69 char approximateHeapMemoryUsage() const override {
70 int memory = LayoutSVGResourceContainer::approximateHeapMemoryUsage();
71 // TODO(pdr): Include memory from m_clipContentPath.
72 // TODO(pdr): Include memory from m_cachedPaintRecord.
73 return memory;
74 }
75
68 void calculateLocalClipBounds(); 76 void calculateLocalClipBounds();
69 77
70 // Return true if the clip path was calculated or a cached value is available. 78 // Return true if the clip path was calculated or a cached value is available.
71 bool calculateClipContentPathIfNeeded(); 79 bool calculateClipContentPathIfNeeded();
72 80
73 // Cache of the clip path when using path clipping. 81 // Cache of the clip path when using path clipping.
74 Path m_clipContentPath; 82 Path m_clipContentPath;
75 83
76 // Cache of the clip path paint record when falling back to masking for 84 // Cache of the clip path paint record when falling back to masking for
77 // clipping. 85 // clipping.
78 sk_sp<const PaintRecord> m_cachedPaintRecord; 86 sk_sp<const PaintRecord> m_cachedPaintRecord;
79 87
80 FloatRect m_localClipBounds; 88 FloatRect m_localClipBounds;
81 89
82 // Reference cycle detection. 90 // Reference cycle detection.
83 bool m_inClipExpansion; 91 bool m_inClipExpansion;
84 }; 92 };
85 93
86 DEFINE_LAYOUT_SVG_RESOURCE_TYPE_CASTS(LayoutSVGResourceClipper, 94 DEFINE_LAYOUT_SVG_RESOURCE_TYPE_CASTS(LayoutSVGResourceClipper,
87 ClipperResourceType); 95 ClipperResourceType);
88 96
89 } // namespace blink 97 } // namespace blink
90 98
91 #endif 99 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698