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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « Source/core/css/resolver/AnimatedStyleBuilder.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 EFillRepeat repeatY() const { return static_cast<EFillRepeat>(m_repeatY); } 77 EFillRepeat repeatY() const { return static_cast<EFillRepeat>(m_repeatY); }
78 CompositeOperator composite() const { return static_cast<CompositeOperator>( m_composite); } 78 CompositeOperator composite() const { return static_cast<CompositeOperator>( m_composite); }
79 blink::WebBlendMode blendMode() const { return static_cast<blink::WebBlendMo de>(m_blendMode); } 79 blink::WebBlendMode blendMode() const { return static_cast<blink::WebBlendMo de>(m_blendMode); }
80 const LengthSize& sizeLength() const { return m_sizeLength; } 80 const LengthSize& sizeLength() const { return m_sizeLength; }
81 EFillSizeType sizeType() const { return static_cast<EFillSizeType>(m_sizeTyp e); } 81 EFillSizeType sizeType() const { return static_cast<EFillSizeType>(m_sizeTyp e); }
82 FillSize size() const { return FillSize(static_cast<EFillSizeType>(m_sizeTyp e), m_sizeLength); } 82 FillSize size() const { return FillSize(static_cast<EFillSizeType>(m_sizeTyp e), m_sizeLength); }
83 EMaskSourceType maskSourceType() const { return static_cast<EMaskSourceType> (m_maskSourceType); } 83 EMaskSourceType maskSourceType() const { return static_cast<EMaskSourceType> (m_maskSourceType); }
84 84
85 const FillLayer* next() const { return m_next; } 85 const FillLayer* next() const { return m_next; }
86 FillLayer* next() { return m_next; } 86 FillLayer* next() { return m_next; }
87 FillLayer* ensureNext()
88 {
89 if (!m_next)
90 m_next = new FillLayer(type());
91 return m_next;
92 }
87 93
88 bool isImageSet() const { return m_imageSet; } 94 bool isImageSet() const { return m_imageSet; }
89 bool isXPositionSet() const { return m_xPosSet; } 95 bool isXPositionSet() const { return m_xPosSet; }
90 bool isYPositionSet() const { return m_yPosSet; } 96 bool isYPositionSet() const { return m_yPosSet; }
91 bool isBackgroundXOriginSet() const { return m_backgroundXOriginSet; } 97 bool isBackgroundXOriginSet() const { return m_backgroundXOriginSet; }
92 bool isBackgroundYOriginSet() const { return m_backgroundYOriginSet; } 98 bool isBackgroundYOriginSet() const { return m_backgroundYOriginSet; }
93 bool isAttachmentSet() const { return m_attachmentSet; } 99 bool isAttachmentSet() const { return m_attachmentSet; }
94 bool isClipSet() const { return m_clipSet; } 100 bool isClipSet() const { return m_clipSet; }
95 bool isOriginSet() const { return m_originSet; } 101 bool isOriginSet() const { return m_originSet; }
96 bool isRepeatXSet() const { return m_repeatXSet; } 102 bool isRepeatXSet() const { return m_repeatXSet; }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 void clearAttachment() { m_attachmentSet = false; } 138 void clearAttachment() { m_attachmentSet = false; }
133 void clearClip() { m_clipSet = false; } 139 void clearClip() { m_clipSet = false; }
134 void clearOrigin() { m_originSet = false; } 140 void clearOrigin() { m_originSet = false; }
135 void clearRepeatX() { m_repeatXSet = false; } 141 void clearRepeatX() { m_repeatXSet = false; }
136 void clearRepeatY() { m_repeatYSet = false; } 142 void clearRepeatY() { m_repeatYSet = false; }
137 void clearComposite() { m_compositeSet = false; } 143 void clearComposite() { m_compositeSet = false; }
138 void clearBlendMode() { m_blendModeSet = false; } 144 void clearBlendMode() { m_blendModeSet = false; }
139 void clearSize() { m_sizeType = SizeNone; } 145 void clearSize() { m_sizeType = SizeNone; }
140 void clearMaskSourceType() { m_maskSourceTypeSet = false; } 146 void clearMaskSourceType() { m_maskSourceTypeSet = false; }
141 147
142 void setNext(FillLayer* n) { if (m_next != n) { delete m_next; m_next = n; } }
143
144 FillLayer& operator=(const FillLayer& o); 148 FillLayer& operator=(const FillLayer& o);
145 FillLayer(const FillLayer& o); 149 FillLayer(const FillLayer& o);
146 150
147 bool operator==(const FillLayer& o) const; 151 bool operator==(const FillLayer& o) const;
148 bool operator!=(const FillLayer& o) const 152 bool operator!=(const FillLayer& o) const
149 { 153 {
150 return !(*this == o); 154 return !(*this == o);
151 } 155 }
152 156
153 bool containsImage(StyleImage*) const; 157 bool containsImage(StyleImage*) const;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 unsigned m_maskSourceTypeSet : 1; 238 unsigned m_maskSourceTypeSet : 1;
235 239
236 unsigned m_type : 1; // EFillLayerType 240 unsigned m_type : 1; // EFillLayerType
237 241
238 mutable unsigned m_clipMax : 2; // EFillBox, maximum m_clip value from this to bottom layer 242 mutable unsigned m_clipMax : 2; // EFillBox, maximum m_clip value from this to bottom layer
239 }; 243 };
240 244
241 } // namespace blink 245 } // namespace blink
242 246
243 #endif // FillLayer_h 247 #endif // FillLayer_h
OLDNEW
« 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