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

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

Issue 2795173002: Do not show image placeholders for CSS sprites (Closed)
Patch Set: Addressed comments Created 3 years, 7 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) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 return false; 59 return false;
60 } 60 }
61 61
62 static ImageResourceContent* CachedImageForCSSValue(CSSValue* value, 62 static ImageResourceContent* CachedImageForCSSValue(CSSValue* value,
63 const Document& document) { 63 const Document& document) {
64 if (!value) 64 if (!value)
65 return nullptr; 65 return nullptr;
66 66
67 if (value->IsImageValue()) { 67 if (value->IsImageValue()) {
68 StyleImage* style_image_resource = 68 StyleImage* style_image_resource = ToCSSImageValue(value)->CacheImage(
69 ToCSSImageValue(value)->CacheImage(document); 69 document, FetchParameters::kAllowPlaceholder);
70 if (!style_image_resource) 70 if (!style_image_resource)
71 return nullptr; 71 return nullptr;
72 72
73 return style_image_resource->CachedImage(); 73 return style_image_resource->CachedImage();
74 } 74 }
75 75
76 if (value->IsImageGeneratorValue()) { 76 if (value->IsImageGeneratorValue()) {
77 ToCSSImageGeneratorValue(value)->LoadSubimages(document); 77 ToCSSImageGeneratorValue(value)->LoadSubimages(document);
78 // FIXME: Handle CSSImageGeneratorValue (and thus cross-fades with gradients 78 // FIXME: Handle CSSImageGeneratorValue (and thus cross-fades with gradients
79 // and canvas). 79 // and canvas).
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 visitor->Trace(from_value_); 294 visitor->Trace(from_value_);
295 visitor->Trace(to_value_); 295 visitor->Trace(to_value_);
296 visitor->Trace(percentage_value_); 296 visitor->Trace(percentage_value_);
297 visitor->Trace(cached_from_image_); 297 visitor->Trace(cached_from_image_);
298 visitor->Trace(cached_to_image_); 298 visitor->Trace(cached_to_image_);
299 visitor->Trace(crossfade_subimage_observer_); 299 visitor->Trace(crossfade_subimage_observer_);
300 CSSImageGeneratorValue::TraceAfterDispatch(visitor); 300 CSSImageGeneratorValue::TraceAfterDispatch(visitor);
301 } 301 }
302 302
303 } // namespace blink 303 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698