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

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

Issue 1858753003: Remove RawPtr from core/css (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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) 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 } 95 }
96 96
97 static KURL urlForCSSValue(const CSSValue* value) 97 static KURL urlForCSSValue(const CSSValue* value)
98 { 98 {
99 if (!value->isImageValue()) 99 if (!value->isImageValue())
100 return KURL(); 100 return KURL();
101 101
102 return KURL(ParsedURLString, toCSSImageValue(*value).url()); 102 return KURL(ParsedURLString, toCSSImageValue(*value).url());
103 } 103 }
104 104
105 CSSCrossfadeValue::CSSCrossfadeValue(RawPtr<CSSValue> fromValue, RawPtr<CSSValue > toValue, RawPtr<CSSPrimitiveValue> percentageValue) 105 CSSCrossfadeValue::CSSCrossfadeValue(CSSValue* fromValue, CSSValue* toValue, CSS PrimitiveValue* percentageValue)
106 : CSSImageGeneratorValue(CrossfadeClass) 106 : CSSImageGeneratorValue(CrossfadeClass)
107 , m_fromValue(fromValue) 107 , m_fromValue(fromValue)
108 , m_toValue(toValue) 108 , m_toValue(toValue)
109 , m_percentageValue(percentageValue) 109 , m_percentageValue(percentageValue)
110 , m_cachedFromImage(nullptr) 110 , m_cachedFromImage(nullptr)
111 , m_cachedToImage(nullptr) 111 , m_cachedToImage(nullptr)
112 , m_crossfadeSubimageObserver(this) 112 , m_crossfadeSubimageObserver(this)
113 { 113 {
114 #if ENABLE(OILPAN) 114 #if ENABLE(OILPAN)
115 ThreadState::current()->registerPreFinalizer(this); 115 ThreadState::current()->registerPreFinalizer(this);
(...skipping 25 matching lines...) Expand all
141 result.appendLiteral("-webkit-cross-fade("); 141 result.appendLiteral("-webkit-cross-fade(");
142 result.append(m_fromValue->cssText()); 142 result.append(m_fromValue->cssText());
143 result.appendLiteral(", "); 143 result.appendLiteral(", ");
144 result.append(m_toValue->cssText()); 144 result.append(m_toValue->cssText());
145 result.appendLiteral(", "); 145 result.appendLiteral(", ");
146 result.append(m_percentageValue->cssText()); 146 result.append(m_percentageValue->cssText());
147 result.append(')'); 147 result.append(')');
148 return result.toString(); 148 return result.toString();
149 } 149 }
150 150
151 RawPtr<CSSCrossfadeValue> CSSCrossfadeValue::valueWithURLsMadeAbsolute() 151 CSSCrossfadeValue* CSSCrossfadeValue::valueWithURLsMadeAbsolute()
152 { 152 {
153 RawPtr<CSSValue> fromValue = m_fromValue; 153 CSSValue* fromValue = m_fromValue;
154 if (m_fromValue->isImageValue()) 154 if (m_fromValue->isImageValue())
155 fromValue = toCSSImageValue(*m_fromValue).valueWithURLMadeAbsolute(); 155 fromValue = toCSSImageValue(*m_fromValue).valueWithURLMadeAbsolute();
156 RawPtr<CSSValue> toValue = m_toValue; 156 CSSValue* toValue = m_toValue;
157 if (m_toValue->isImageValue()) 157 if (m_toValue->isImageValue())
158 toValue = toCSSImageValue(*m_toValue).valueWithURLMadeAbsolute(); 158 toValue = toCSSImageValue(*m_toValue).valueWithURLMadeAbsolute();
159 return CSSCrossfadeValue::create(fromValue.release(), toValue.release(), m_p ercentageValue); 159 return CSSCrossfadeValue::create(fromValue, toValue, m_percentageValue);
160 } 160 }
161 161
162 IntSize CSSCrossfadeValue::fixedSize(const LayoutObject& layoutObject, const Flo atSize& defaultObjectSize) 162 IntSize CSSCrossfadeValue::fixedSize(const LayoutObject& layoutObject, const Flo atSize& defaultObjectSize)
163 { 163 {
164 Image* fromImage = renderableImageForCSSValue(m_fromValue.get(), layoutObjec t); 164 Image* fromImage = renderableImageForCSSValue(m_fromValue.get(), layoutObjec t);
165 Image* toImage = renderableImageForCSSValue(m_toValue.get(), layoutObject); 165 Image* toImage = renderableImageForCSSValue(m_toValue.get(), layoutObject);
166 166
167 if (!fromImage || !toImage) 167 if (!fromImage || !toImage)
168 return IntSize(); 168 return IntSize();
169 169
(...skipping 23 matching lines...) Expand all
193 return subimageIsPending(m_fromValue.get()) || subimageIsPending(m_toValue.g et()); 193 return subimageIsPending(m_fromValue.get()) || subimageIsPending(m_toValue.g et());
194 } 194 }
195 195
196 bool CSSCrossfadeValue::knownToBeOpaque(const LayoutObject& layoutObject) const 196 bool CSSCrossfadeValue::knownToBeOpaque(const LayoutObject& layoutObject) const
197 { 197 {
198 return subimageKnownToBeOpaque(m_fromValue.get(), layoutObject) && subimageK nownToBeOpaque(m_toValue.get(), layoutObject); 198 return subimageKnownToBeOpaque(m_fromValue.get(), layoutObject) && subimageK nownToBeOpaque(m_toValue.get(), layoutObject);
199 } 199 }
200 200
201 void CSSCrossfadeValue::loadSubimages(Document* document) 201 void CSSCrossfadeValue::loadSubimages(Document* document)
202 { 202 {
203 RawPtr<ImageResource> oldCachedFromImage = m_cachedFromImage; 203 ImageResource* oldCachedFromImage = m_cachedFromImage;
204 RawPtr<ImageResource> oldCachedToImage = m_cachedToImage; 204 ImageResource* oldCachedToImage = m_cachedToImage;
205 205
206 m_cachedFromImage = cachedImageForCSSValue(m_fromValue.get(), document); 206 m_cachedFromImage = cachedImageForCSSValue(m_fromValue.get(), document);
207 m_cachedToImage = cachedImageForCSSValue(m_toValue.get(), document); 207 m_cachedToImage = cachedImageForCSSValue(m_toValue.get(), document);
208 208
209 if (m_cachedFromImage != oldCachedFromImage) { 209 if (m_cachedFromImage != oldCachedFromImage) {
210 if (oldCachedFromImage) 210 if (oldCachedFromImage)
211 oldCachedFromImage->removeObserver(&m_crossfadeSubimageObserver); 211 oldCachedFromImage->removeObserver(&m_crossfadeSubimageObserver);
212 if (m_cachedFromImage) 212 if (m_cachedFromImage)
213 m_cachedFromImage->addObserver(&m_crossfadeSubimageObserver); 213 m_cachedFromImage->addObserver(&m_crossfadeSubimageObserver);
214 } 214 }
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 visitor->trace(m_fromValue); 281 visitor->trace(m_fromValue);
282 visitor->trace(m_toValue); 282 visitor->trace(m_toValue);
283 visitor->trace(m_percentageValue); 283 visitor->trace(m_percentageValue);
284 visitor->trace(m_cachedFromImage); 284 visitor->trace(m_cachedFromImage);
285 visitor->trace(m_cachedToImage); 285 visitor->trace(m_cachedToImage);
286 visitor->trace(m_crossfadeSubimageObserver); 286 visitor->trace(m_crossfadeSubimageObserver);
287 CSSImageGeneratorValue::traceAfterDispatch(visitor); 287 CSSImageGeneratorValue::traceAfterDispatch(visitor);
288 } 288 }
289 289
290 } // namespace blink 290 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSCrossfadeValue.h ('k') | third_party/WebKit/Source/core/css/CSSCursorImageValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698