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

Unified Diff: Source/core/rendering/style/FillLayer.h

Issue 405093002: Slightly simplify building FillLayer objects (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/resolver/AnimatedStyleBuilder.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/style/FillLayer.h
diff --git a/Source/core/rendering/style/FillLayer.h b/Source/core/rendering/style/FillLayer.h
index 3362f5afaf8fc88e013fe29df9e2c810bb232a27..461fd6f4ec95ddfb38e7b1d19b206462553da659 100644
--- a/Source/core/rendering/style/FillLayer.h
+++ b/Source/core/rendering/style/FillLayer.h
@@ -84,6 +84,12 @@ public:
const FillLayer* next() const { return m_next; }
FillLayer* next() { return m_next; }
+ FillLayer* ensureNext()
+ {
+ if (!m_next)
+ m_next = new FillLayer(type());
+ return m_next;
+ }
bool isImageSet() const { return m_imageSet; }
bool isXPositionSet() const { return m_xPosSet; }
@@ -139,8 +145,6 @@ public:
void clearSize() { m_sizeType = SizeNone; }
void clearMaskSourceType() { m_maskSourceTypeSet = false; }
- void setNext(FillLayer* n) { if (m_next != n) { delete m_next; m_next = n; } }
-
FillLayer& operator=(const FillLayer& o);
FillLayer(const FillLayer& o);
« no previous file with comments | « Source/core/css/resolver/AnimatedStyleBuilder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698