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

Side by Side Diff: Source/core/layout/svg/LayoutSVGResourceContainer.h

Issue 1162383003: C++11: Replace 0 with nullptr where applicable in layout code. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add one more file. Created 5 years, 6 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 2010. All rights reserved. 2 * Copyright (C) Research In Motion Limited 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 return resourceType == PatternResourceType 57 return resourceType == PatternResourceType
58 || resourceType == LinearGradientResourceType 58 || resourceType == LinearGradientResourceType
59 || resourceType == RadialGradientResourceType; 59 || resourceType == RadialGradientResourceType;
60 } 60 }
61 61
62 void idChanged(); 62 void idChanged();
63 void addClientLayer(Node*); 63 void addClientLayer(Node*);
64 void addClientLayer(DeprecatedPaintLayer*); 64 void addClientLayer(DeprecatedPaintLayer*);
65 void removeClientLayer(DeprecatedPaintLayer*); 65 void removeClientLayer(DeprecatedPaintLayer*);
66 66
67 void invalidateCacheAndMarkForLayout(SubtreeLayoutScope* = 0); 67 void invalidateCacheAndMarkForLayout(SubtreeLayoutScope* = nullptr);
68 68
69 static void markForLayoutAndParentResourceInvalidation(LayoutObject*, bool n eedsLayout = true); 69 static void markForLayoutAndParentResourceInvalidation(LayoutObject*, bool n eedsLayout = true);
70 70
71 void clearInvalidationMask() { m_invalidationMask = 0; } 71 void clearInvalidationMask() { m_invalidationMask = 0; }
72 72
73 protected: 73 protected:
74 // When adding modes, make sure we don't overflow m_invalidationMask below. 74 // When adding modes, make sure we don't overflow m_invalidationMask below.
75 enum InvalidationMode { 75 enum InvalidationMode {
76 LayoutAndBoundariesInvalidation = 1 << 0, 76 LayoutAndBoundariesInvalidation = 1 << 0,
77 BoundariesInvalidation = 1 << 1, 77 BoundariesInvalidation = 1 << 1,
(...skipping 25 matching lines...) Expand all
103 unsigned m_isInvalidating : 1; 103 unsigned m_isInvalidating : 1;
104 // 22 padding bits available 104 // 22 padding bits available
105 105
106 HashSet<LayoutObject*> m_clients; 106 HashSet<LayoutObject*> m_clients;
107 HashSet<DeprecatedPaintLayer*> m_clientLayers; 107 HashSet<DeprecatedPaintLayer*> m_clientLayers;
108 }; 108 };
109 109
110 inline LayoutSVGResourceContainer* getLayoutSVGResourceContainerById(TreeScope& treeScope, const AtomicString& id) 110 inline LayoutSVGResourceContainer* getLayoutSVGResourceContainerById(TreeScope& treeScope, const AtomicString& id)
111 { 111 {
112 if (id.isEmpty()) 112 if (id.isEmpty())
113 return 0; 113 return nullptr;
114 114
115 if (LayoutSVGResourceContainer* layoutResource = treeScope.document().access SVGExtensions().resourceById(id)) 115 if (LayoutSVGResourceContainer* layoutResource = treeScope.document().access SVGExtensions().resourceById(id))
116 return layoutResource; 116 return layoutResource;
117 117
118 return 0; 118 return nullptr;
119 } 119 }
120 120
121 template<typename Layout> 121 template<typename Layout>
122 Layout* getLayoutSVGResourceById(TreeScope& treeScope, const AtomicString& id) 122 Layout* getLayoutSVGResourceById(TreeScope& treeScope, const AtomicString& id)
123 { 123 {
124 if (LayoutSVGResourceContainer* container = getLayoutSVGResourceContainerByI d(treeScope, id)) { 124 if (LayoutSVGResourceContainer* container = getLayoutSVGResourceContainerByI d(treeScope, id)) {
125 if (container->resourceType() == Layout::s_resourceType) 125 if (container->resourceType() == Layout::s_resourceType)
126 return static_cast<Layout*>(container); 126 return static_cast<Layout*>(container);
127 } 127 }
128 return 0; 128 return nullptr;
129 } 129 }
130 130
131 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutSVGResourceContainer, isSVGResourceContain er()); 131 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutSVGResourceContainer, isSVGResourceContain er());
132 132
133 #define DEFINE_LAYOUT_SVG_RESOURCE_TYPE_CASTS(thisType, typeName) \ 133 #define DEFINE_LAYOUT_SVG_RESOURCE_TYPE_CASTS(thisType, typeName) \
134 DEFINE_TYPE_CASTS(thisType, LayoutSVGResourceContainer, resource, resource-> resourceType() == typeName, resource.resourceType() == typeName) 134 DEFINE_TYPE_CASTS(thisType, LayoutSVGResourceContainer, resource, resource-> resourceType() == typeName, resource.resourceType() == typeName)
135 135
136 } 136 }
137 137
138 #endif 138 #endif
OLDNEW
« no previous file with comments | « Source/core/layout/svg/LayoutSVGModelObject.h ('k') | Source/core/layout/svg/LayoutSVGResourcePaintServer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698