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

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

Issue 1308953009: Move Image ownership out of CSSValue (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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
« no previous file with comments | « Source/core/css/CSSImageGeneratorValue.h ('k') | Source/core/css/CSSImageValue.h » ('j') | 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) 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 case LinearGradientClass: 164 case LinearGradientClass:
165 return toCSSLinearGradientValue(this)->fixedSize(layoutObject); 165 return toCSSLinearGradientValue(this)->fixedSize(layoutObject);
166 case RadialGradientClass: 166 case RadialGradientClass:
167 return toCSSRadialGradientValue(this)->fixedSize(layoutObject); 167 return toCSSRadialGradientValue(this)->fixedSize(layoutObject);
168 default: 168 default:
169 ASSERT_NOT_REACHED(); 169 ASSERT_NOT_REACHED();
170 } 170 }
171 return IntSize(); 171 return IntSize();
172 } 172 }
173 173
174 bool CSSImageGeneratorValue::isPending() const 174 bool CSSImageGeneratorValue::isPending(CSSStyleImageMap& imageMap) const
175 { 175 {
176 switch (classType()) { 176 switch (classType()) {
177 case CrossfadeClass: 177 case CrossfadeClass:
178 return toCSSCrossfadeValue(this)->isPending(); 178 return toCSSCrossfadeValue(this)->isPending(imageMap);
179 case CanvasClass: 179 case CanvasClass:
180 return toCSSCanvasValue(this)->isPending(); 180 return toCSSCanvasValue(this)->isPending(imageMap);
181 case LinearGradientClass: 181 case LinearGradientClass:
182 return toCSSLinearGradientValue(this)->isPending(); 182 return toCSSLinearGradientValue(this)->isPending(imageMap);
183 case RadialGradientClass: 183 case RadialGradientClass:
184 return toCSSRadialGradientValue(this)->isPending(); 184 return toCSSRadialGradientValue(this)->isPending(imageMap);
185 default: 185 default:
186 ASSERT_NOT_REACHED(); 186 ASSERT_NOT_REACHED();
187 } 187 }
188 return false; 188 return false;
189 } 189 }
190 190
191 bool CSSImageGeneratorValue::knownToBeOpaque(const LayoutObject* layoutObject) c onst 191 bool CSSImageGeneratorValue::knownToBeOpaque(const LayoutObject* layoutObject) c onst
192 { 192 {
193 switch (classType()) { 193 switch (classType()) {
194 case CrossfadeClass: 194 case CrossfadeClass:
195 return toCSSCrossfadeValue(this)->knownToBeOpaque(layoutObject); 195 return toCSSCrossfadeValue(this)->knownToBeOpaque(layoutObject);
196 case CanvasClass: 196 case CanvasClass:
197 return false; 197 return false;
198 case LinearGradientClass: 198 case LinearGradientClass:
199 return toCSSLinearGradientValue(this)->knownToBeOpaque(layoutObject); 199 return toCSSLinearGradientValue(this)->knownToBeOpaque(layoutObject);
200 case RadialGradientClass: 200 case RadialGradientClass:
201 return toCSSRadialGradientValue(this)->knownToBeOpaque(layoutObject); 201 return toCSSRadialGradientValue(this)->knownToBeOpaque(layoutObject);
202 default: 202 default:
203 ASSERT_NOT_REACHED(); 203 ASSERT_NOT_REACHED();
204 } 204 }
205 return false; 205 return false;
206 } 206 }
207 207
208 void CSSImageGeneratorValue::loadSubimages(Document* document) 208 void CSSImageGeneratorValue::loadSubimages(Document* document, CSSStyleImageMap& images)
209 { 209 {
210 switch (classType()) { 210 switch (classType()) {
211 case CrossfadeClass: 211 case CrossfadeClass:
212 toCSSCrossfadeValue(this)->loadSubimages(document); 212 toCSSCrossfadeValue(this)->loadSubimages(document, images);
213 break; 213 break;
214 case CanvasClass: 214 case CanvasClass:
215 toCSSCanvasValue(this)->loadSubimages(document); 215 toCSSCanvasValue(this)->loadSubimages(document, images);
216 break; 216 break;
217 case LinearGradientClass: 217 case LinearGradientClass:
218 toCSSLinearGradientValue(this)->loadSubimages(document); 218 toCSSLinearGradientValue(this)->loadSubimages(document, images);
219 break; 219 break;
220 case RadialGradientClass: 220 case RadialGradientClass:
221 toCSSRadialGradientValue(this)->loadSubimages(document); 221 toCSSRadialGradientValue(this)->loadSubimages(document, images);
222 break; 222 break;
223 default: 223 default:
224 ASSERT_NOT_REACHED(); 224 ASSERT_NOT_REACHED();
225 } 225 }
226 } 226 }
227 227
228 } // namespace blink 228 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/CSSImageGeneratorValue.h ('k') | Source/core/css/CSSImageValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698