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

Side by Side Diff: Source/platform/graphics/paint/DisplayItem.h

Issue 900653003: Avoid empty display item pairs (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix try bot breakage Created 5 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef DisplayItem_h 5 #ifndef DisplayItem_h
6 #define DisplayItem_h 6 #define DisplayItem_h
7 7
8 #include "platform/PlatformExport.h" 8 #include "platform/PlatformExport.h"
9 #include "platform/graphics/paint/DisplayItemClient.h" 9 #include "platform/graphics/paint/DisplayItemClient.h"
10 #include "wtf/Assertions.h" 10 #include "wtf/Assertions.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 DEFINE_PAINT_PHASE_CONVERSION_METHOD(ClipLayerFragment) 178 DEFINE_PAINT_PHASE_CONVERSION_METHOD(ClipLayerFragment)
179 DEFINE_PAINT_PHASE_CONVERSION_METHOD(ClipBox) 179 DEFINE_PAINT_PHASE_CONVERSION_METHOD(ClipBox)
180 DEFINE_PAINT_PHASE_CONVERSION_METHOD(ClipColumnBounds) 180 DEFINE_PAINT_PHASE_CONVERSION_METHOD(ClipColumnBounds)
181 181
182 DEFINE_PAIRED_CATEGORY_METHODS(FloatClip, floatClip) 182 DEFINE_PAIRED_CATEGORY_METHODS(FloatClip, floatClip)
183 DEFINE_PAINT_PHASE_CONVERSION_METHOD(FloatClip) 183 DEFINE_PAINT_PHASE_CONVERSION_METHOD(FloatClip)
184 184
185 DEFINE_PAIRED_CATEGORY_METHODS(Scroll, scroll) 185 DEFINE_PAIRED_CATEGORY_METHODS(Scroll, scroll)
186 DEFINE_PAINT_PHASE_CONVERSION_METHOD(Scroll) 186 DEFINE_PAINT_PHASE_CONVERSION_METHOD(Scroll)
187 187
188 virtual bool isBegin() const { return false; }
189 virtual bool isEnd() const { return false; }
190
191 #if ENABLE(ASSERT)
192 virtual bool isEndAndPairedWith(const DisplayItem& other) const { return fal se; }
193 #endif
194
188 #ifndef NDEBUG 195 #ifndef NDEBUG
189 static WTF::String typeAsDebugString(DisplayItem::Type); 196 static WTF::String typeAsDebugString(DisplayItem::Type);
190 197
191 void setClientDebugString(const WTF::String& clientDebugString) { m_clientDe bugString = clientDebugString; } 198 void setClientDebugString(const WTF::String& clientDebugString) { m_clientDe bugString = clientDebugString; }
192 const WTF::String& clientDebugString() const { return m_clientDebugString; } 199 const WTF::String& clientDebugString() const { return m_clientDebugString; }
193 200
194 WTF::String asDebugString() const; 201 WTF::String asDebugString() const;
195 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const; 202 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const;
196 #endif 203 #endif
197 204
(...skipping 14 matching lines...) Expand all
212 } 219 }
213 220
214 const DisplayItemClient client; 221 const DisplayItemClient client;
215 const Type type; 222 const Type type;
216 } m_id; 223 } m_id;
217 #ifndef NDEBUG 224 #ifndef NDEBUG
218 WTF::String m_clientDebugString; 225 WTF::String m_clientDebugString;
219 #endif 226 #endif
220 }; 227 };
221 228
222 } 229 class PLATFORM_EXPORT PairedBeginDisplayItem : public DisplayItem {
230 protected:
231 PairedBeginDisplayItem(DisplayItemClient client, Type type) : DisplayItem(cl ient, type) { }
232
233 private:
234 virtual bool isBegin() const override final { return true; }
235 };
236
237 class PLATFORM_EXPORT PairedEndDisplayItem : public DisplayItem {
238 protected:
239 PairedEndDisplayItem(DisplayItemClient client, Type type) : DisplayItem(clie nt, type) { }
240
241 #if ENABLE(ASSERT)
242 virtual bool isEndAndPairedWith(const DisplayItem& other) const override = 0 ;
243 #endif
244
245 private:
246 virtual bool isEnd() const override final { return true; }
247 };
248
249 } // namespace blink
223 250
224 #endif // DisplayItem_h 251 #endif // DisplayItem_h
OLDNEW
« no previous file with comments | « Source/platform/graphics/paint/CompositingDisplayItem.h ('k') | Source/platform/graphics/paint/DisplayItemList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698