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

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

Issue 23819007: Have Node::document() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 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
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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 result.append(m_percentageValue->cssText()); 104 result.append(m_percentageValue->cssText());
105 result.append(')'); 105 result.append(')');
106 return result.toString(); 106 return result.toString();
107 } 107 }
108 108
109 IntSize CSSCrossfadeValue::fixedSize(const RenderObject* renderer) 109 IntSize CSSCrossfadeValue::fixedSize(const RenderObject* renderer)
110 { 110 {
111 float percentage = m_percentageValue->getFloatValue(); 111 float percentage = m_percentageValue->getFloatValue();
112 float inversePercentage = 1 - percentage; 112 float inversePercentage = 1 - percentage;
113 113
114 ResourceFetcher* fetcher = renderer->document()->fetcher(); 114 ResourceFetcher* fetcher = renderer->document().fetcher();
115 ImageResource* cachedFromImage = cachedImageForCSSValue(m_fromValue.get(), f etcher); 115 ImageResource* cachedFromImage = cachedImageForCSSValue(m_fromValue.get(), f etcher);
116 ImageResource* cachedToImage = cachedImageForCSSValue(m_toValue.get(), fetch er); 116 ImageResource* cachedToImage = cachedImageForCSSValue(m_toValue.get(), fetch er);
117 117
118 if (!cachedFromImage || !cachedToImage) 118 if (!cachedFromImage || !cachedToImage)
119 return IntSize(); 119 return IntSize();
120 120
121 IntSize fromImageSize = cachedFromImage->imageForRenderer(renderer)->size(); 121 IntSize fromImageSize = cachedFromImage->imageForRenderer(renderer)->size();
122 IntSize toImageSize = cachedToImage->imageForRenderer(renderer)->size(); 122 IntSize toImageSize = cachedToImage->imageForRenderer(renderer)->size();
123 123
124 // Rounding issues can cause transitions between images of equal size to ret urn 124 // Rounding issues can cause transitions between images of equal size to ret urn
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 } 163 }
164 164
165 m_crossfadeSubimageObserver.setReady(true); 165 m_crossfadeSubimageObserver.setReady(true);
166 } 166 }
167 167
168 PassRefPtr<Image> CSSCrossfadeValue::image(RenderObject* renderer, const IntSize & size) 168 PassRefPtr<Image> CSSCrossfadeValue::image(RenderObject* renderer, const IntSize & size)
169 { 169 {
170 if (size.isEmpty()) 170 if (size.isEmpty())
171 return 0; 171 return 0;
172 172
173 ResourceFetcher* fetcher = renderer->document()->fetcher(); 173 ResourceFetcher* fetcher = renderer->document().fetcher();
174 ImageResource* cachedFromImage = cachedImageForCSSValue(m_fromValue.get(), f etcher); 174 ImageResource* cachedFromImage = cachedImageForCSSValue(m_fromValue.get(), f etcher);
175 ImageResource* cachedToImage = cachedImageForCSSValue(m_toValue.get(), fetch er); 175 ImageResource* cachedToImage = cachedImageForCSSValue(m_toValue.get(), fetch er);
176 176
177 if (!cachedFromImage || !cachedToImage) 177 if (!cachedFromImage || !cachedToImage)
178 return Image::nullImage(); 178 return Image::nullImage();
179 179
180 Image* fromImage = cachedFromImage->imageForRenderer(renderer); 180 Image* fromImage = cachedFromImage->imageForRenderer(renderer);
181 Image* toImage = cachedToImage->imageForRenderer(renderer); 181 Image* toImage = cachedToImage->imageForRenderer(renderer);
182 182
183 if (!fromImage || !toImage) 183 if (!fromImage || !toImage)
(...skipping 29 matching lines...) Expand all
213 } 213 }
214 214
215 bool CSSCrossfadeValue::equals(const CSSCrossfadeValue& other) const 215 bool CSSCrossfadeValue::equals(const CSSCrossfadeValue& other) const
216 { 216 {
217 return compareCSSValuePtr(m_fromValue, other.m_fromValue) 217 return compareCSSValuePtr(m_fromValue, other.m_fromValue)
218 && compareCSSValuePtr(m_toValue, other.m_toValue) 218 && compareCSSValuePtr(m_toValue, other.m_toValue)
219 && compareCSSValuePtr(m_percentageValue, other.m_percentageValue); 219 && compareCSSValuePtr(m_percentageValue, other.m_percentageValue);
220 } 220 }
221 221
222 } // namespace WebCore 222 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/CSSComputedStyleDeclaration.cpp ('k') | Source/core/css/CSSCursorImageValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698