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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSImageGeneratorValue.cpp

Issue 2775103002: Conic gradient parsing support (Closed)
Patch Set: review 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) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 float zoom) { 118 float zoom) {
119 switch (getClassType()) { 119 switch (getClassType()) {
120 case CrossfadeClass: 120 case CrossfadeClass:
121 return toCSSCrossfadeValue(this)->image(layoutObject, size); 121 return toCSSCrossfadeValue(this)->image(layoutObject, size);
122 case LinearGradientClass: 122 case LinearGradientClass:
123 return toCSSLinearGradientValue(this)->image(layoutObject, size); 123 return toCSSLinearGradientValue(this)->image(layoutObject, size);
124 case PaintClass: 124 case PaintClass:
125 return toCSSPaintValue(this)->image(layoutObject, size, zoom); 125 return toCSSPaintValue(this)->image(layoutObject, size, zoom);
126 case RadialGradientClass: 126 case RadialGradientClass:
127 return toCSSRadialGradientValue(this)->image(layoutObject, size); 127 return toCSSRadialGradientValue(this)->image(layoutObject, size);
128 case ConicGradientClass:
129 return toCSSConicGradientValue(this)->image(layoutObject, size);
128 default: 130 default:
129 ASSERT_NOT_REACHED(); 131 ASSERT_NOT_REACHED();
130 } 132 }
131 return nullptr; 133 return nullptr;
132 } 134 }
133 135
134 bool CSSImageGeneratorValue::isFixedSize() const { 136 bool CSSImageGeneratorValue::isFixedSize() const {
135 switch (getClassType()) { 137 switch (getClassType()) {
136 case CrossfadeClass: 138 case CrossfadeClass:
137 return toCSSCrossfadeValue(this)->isFixedSize(); 139 return toCSSCrossfadeValue(this)->isFixedSize();
138 case LinearGradientClass: 140 case LinearGradientClass:
139 return toCSSLinearGradientValue(this)->isFixedSize(); 141 return toCSSLinearGradientValue(this)->isFixedSize();
140 case PaintClass: 142 case PaintClass:
141 return toCSSPaintValue(this)->isFixedSize(); 143 return toCSSPaintValue(this)->isFixedSize();
142 case RadialGradientClass: 144 case RadialGradientClass:
143 return toCSSRadialGradientValue(this)->isFixedSize(); 145 return toCSSRadialGradientValue(this)->isFixedSize();
146 case ConicGradientClass:
147 return toCSSConicGradientValue(this)->isFixedSize();
144 default: 148 default:
145 ASSERT_NOT_REACHED(); 149 ASSERT_NOT_REACHED();
146 } 150 }
147 return false; 151 return false;
148 } 152 }
149 153
150 IntSize CSSImageGeneratorValue::fixedSize(const LayoutObject& layoutObject, 154 IntSize CSSImageGeneratorValue::fixedSize(const LayoutObject& layoutObject,
151 const FloatSize& defaultObjectSize) { 155 const FloatSize& defaultObjectSize) {
152 switch (getClassType()) { 156 switch (getClassType()) {
153 case CrossfadeClass: 157 case CrossfadeClass:
154 return toCSSCrossfadeValue(this)->fixedSize(layoutObject, 158 return toCSSCrossfadeValue(this)->fixedSize(layoutObject,
155 defaultObjectSize); 159 defaultObjectSize);
156 case LinearGradientClass: 160 case LinearGradientClass:
157 return toCSSLinearGradientValue(this)->fixedSize(layoutObject); 161 return toCSSLinearGradientValue(this)->fixedSize(layoutObject);
158 case PaintClass: 162 case PaintClass:
159 return toCSSPaintValue(this)->fixedSize(layoutObject); 163 return toCSSPaintValue(this)->fixedSize(layoutObject);
160 case RadialGradientClass: 164 case RadialGradientClass:
161 return toCSSRadialGradientValue(this)->fixedSize(layoutObject); 165 return toCSSRadialGradientValue(this)->fixedSize(layoutObject);
166 case ConicGradientClass:
167 return toCSSConicGradientValue(this)->fixedSize(layoutObject);
162 default: 168 default:
163 ASSERT_NOT_REACHED(); 169 ASSERT_NOT_REACHED();
164 } 170 }
165 return IntSize(); 171 return IntSize();
166 } 172 }
167 173
168 bool CSSImageGeneratorValue::isPending() const { 174 bool CSSImageGeneratorValue::isPending() const {
169 switch (getClassType()) { 175 switch (getClassType()) {
170 case CrossfadeClass: 176 case CrossfadeClass:
171 return toCSSCrossfadeValue(this)->isPending(); 177 return toCSSCrossfadeValue(this)->isPending();
172 case LinearGradientClass: 178 case LinearGradientClass:
173 return toCSSLinearGradientValue(this)->isPending(); 179 return toCSSLinearGradientValue(this)->isPending();
174 case PaintClass: 180 case PaintClass:
175 return toCSSPaintValue(this)->isPending(); 181 return toCSSPaintValue(this)->isPending();
176 case RadialGradientClass: 182 case RadialGradientClass:
177 return toCSSRadialGradientValue(this)->isPending(); 183 return toCSSRadialGradientValue(this)->isPending();
184 case ConicGradientClass:
185 return toCSSConicGradientValue(this)->isPending();
178 default: 186 default:
179 ASSERT_NOT_REACHED(); 187 ASSERT_NOT_REACHED();
180 } 188 }
181 return false; 189 return false;
182 } 190 }
183 191
184 bool CSSImageGeneratorValue::knownToBeOpaque( 192 bool CSSImageGeneratorValue::knownToBeOpaque(
185 const LayoutObject& layoutObject) const { 193 const LayoutObject& layoutObject) const {
186 switch (getClassType()) { 194 switch (getClassType()) {
187 case CrossfadeClass: 195 case CrossfadeClass:
188 return toCSSCrossfadeValue(this)->knownToBeOpaque(layoutObject); 196 return toCSSCrossfadeValue(this)->knownToBeOpaque(layoutObject);
189 case LinearGradientClass: 197 case LinearGradientClass:
190 return toCSSLinearGradientValue(this)->knownToBeOpaque(layoutObject); 198 return toCSSLinearGradientValue(this)->knownToBeOpaque(layoutObject);
191 case PaintClass: 199 case PaintClass:
192 return toCSSPaintValue(this)->knownToBeOpaque(layoutObject); 200 return toCSSPaintValue(this)->knownToBeOpaque(layoutObject);
193 case RadialGradientClass: 201 case RadialGradientClass:
194 return toCSSRadialGradientValue(this)->knownToBeOpaque(layoutObject); 202 return toCSSRadialGradientValue(this)->knownToBeOpaque(layoutObject);
203 case ConicGradientClass:
204 return toCSSConicGradientValue(this)->knownToBeOpaque(layoutObject);
195 default: 205 default:
196 ASSERT_NOT_REACHED(); 206 ASSERT_NOT_REACHED();
197 } 207 }
198 return false; 208 return false;
199 } 209 }
200 210
201 void CSSImageGeneratorValue::loadSubimages(const Document& document) { 211 void CSSImageGeneratorValue::loadSubimages(const Document& document) {
202 switch (getClassType()) { 212 switch (getClassType()) {
203 case CrossfadeClass: 213 case CrossfadeClass:
204 toCSSCrossfadeValue(this)->loadSubimages(document); 214 toCSSCrossfadeValue(this)->loadSubimages(document);
205 break; 215 break;
206 case LinearGradientClass: 216 case LinearGradientClass:
207 toCSSLinearGradientValue(this)->loadSubimages(document); 217 toCSSLinearGradientValue(this)->loadSubimages(document);
208 break; 218 break;
209 case PaintClass: 219 case PaintClass:
210 toCSSPaintValue(this)->loadSubimages(document); 220 toCSSPaintValue(this)->loadSubimages(document);
211 break; 221 break;
212 case RadialGradientClass: 222 case RadialGradientClass:
213 toCSSRadialGradientValue(this)->loadSubimages(document); 223 toCSSRadialGradientValue(this)->loadSubimages(document);
214 break; 224 break;
225 case ConicGradientClass:
226 toCSSConicGradientValue(this)->loadSubimages(document);
227 break;
215 default: 228 default:
216 ASSERT_NOT_REACHED(); 229 ASSERT_NOT_REACHED();
217 } 230 }
218 } 231 }
219 232
220 } // namespace blink 233 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSGradientValue.cpp ('k') | third_party/WebKit/Source/core/css/CSSValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698