Skip to content

Commit b2728b4

Browse files
committed
Make some improvements in CSSImageGeneratorValue code
https://bugs.webkit.org/show_bug.cgi?id=125676 Reviewed by Simon Fraser. * css/CSSCrossfadeValue.cpp: (WebCore::subimageKnownToBeOpaque): Take a reference to the CSSValue, since it's known not to be null. Used checked cast. (WebCore::CSSCrossfadeValue::knownToBeOpaque): Updated to pass a reference. * css/CSSImageGeneratorValue.cpp: (WebCore::CSSImageGeneratorValue::saveCachedImageForSize): Use make_unique instead of adoptPtr. (WebCore::CSSImageGeneratorValue::subimageIsPending): Use checked cast. (WebCore::CSSImageGeneratorValue::cachedImageForCSSValue): Ditto, also use nullptr. * css/CSSImageGeneratorValue.h: Removed unneeded includes, added some forward declarations, used unique_ptr instead of OwnPtr, and used CSS_VALUE_TYPE_CASTS macro to create cast functions. * css/CSSValue.cpp: Removed unneeded include of CSSImageGeneratorValue.h. * css/StyleResolver.cpp: (WebCore::StyleResolver::State::clear): Use nullptr instead of 0. (WebCore::StyleResolver::applyProperty): Use checked cast and pass references instead of pointers to StyleGeneratedImage::create. (WebCore::StyleResolver::styleImage): Use checked cast and pass references instead of pointers to generatedOrPendingFromValue. (WebCore::StyleResolver::generatedOrPendingFromValue): Take the value as a reference instead of a pointer. (WebCore::StyleResolver::loadPendingImage): Pass a refernece instead of a pointer to StyleGeneratedImage::create. (WebCore::StyleResolver::loadPendingImages): Use auto for iteration instead of a lot type name. * css/StyleResolver.h: Changed generatedOrPendingFromValue to take the value as a reference instead of a pointer. * page/animation/CSSPropertyAnimation.cpp: (WebCore::blendFilter): Pass a reference insted of a pointer to StyleGeneratedImage::create. (WebCore::crossfadeBlend): Ditto. (WebCore::blendFunc): Ditto. Also use references for local variables. * rendering/style/StyleGeneratedImage.cpp: (WebCore::StyleGeneratedImage::StyleGeneratedImage): Use PassRef instead of PassRefPtr for the argument type. (WebCore::StyleGeneratedImage::cssValue): Updated since m_imageGeneratorValue is now a Ref instead of a RefPtr. Sadly this requires a const_cast that we can come back and get rid of later. (WebCore::StyleGeneratedImage::imageSize): Ditto. (WebCore::StyleGeneratedImage::image): Ditto. * rendering/style/StyleGeneratedImage.h: Changed create function and constructor to take a PassRef. Made imageValue non-const since it returns a non-const value, to be consistent with "conceptual const". Changed m_imageGeneratorValue to be a Ref instead of a RefPtr. * rendering/style/StyleImage.h: Made WrappedImagePtr be const void*, since it's a pointer used only for equality checks. Not a great idiom, but fine to use a const pointer instead of non-const, and avoids the const_cast we'd otherwise need in StyleGeneratedImage::data. Canonical link: https://commits.webkit.org/143698@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160528 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 207062b commit b2728b4

11 files changed

Lines changed: 134 additions & 67 deletions

Source/WebCore/ChangeLog

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,69 @@
1+
2013-12-12 Darin Adler <darin@apple.com>
2+
3+
Make some improvements in CSSImageGeneratorValue code
4+
https://bugs.webkit.org/show_bug.cgi?id=125676
5+
6+
Reviewed by Simon Fraser.
7+
8+
* css/CSSCrossfadeValue.cpp:
9+
(WebCore::subimageKnownToBeOpaque): Take a reference to the CSSValue, since
10+
it's known not to be null. Used checked cast.
11+
(WebCore::CSSCrossfadeValue::knownToBeOpaque): Updated to pass a reference.
12+
13+
* css/CSSImageGeneratorValue.cpp:
14+
(WebCore::CSSImageGeneratorValue::saveCachedImageForSize): Use
15+
make_unique instead of adoptPtr.
16+
(WebCore::CSSImageGeneratorValue::subimageIsPending): Use checked cast.
17+
(WebCore::CSSImageGeneratorValue::cachedImageForCSSValue): Ditto, also
18+
use nullptr.
19+
20+
* css/CSSImageGeneratorValue.h: Removed unneeded includes, added some forward
21+
declarations, used unique_ptr instead of OwnPtr, and used CSS_VALUE_TYPE_CASTS
22+
macro to create cast functions.
23+
24+
* css/CSSValue.cpp: Removed unneeded include of CSSImageGeneratorValue.h.
25+
26+
* css/StyleResolver.cpp:
27+
(WebCore::StyleResolver::State::clear): Use nullptr instead of 0.
28+
(WebCore::StyleResolver::applyProperty): Use checked cast and pass references
29+
instead of pointers to StyleGeneratedImage::create.
30+
(WebCore::StyleResolver::styleImage): Use checked cast and pass references
31+
instead of pointers to generatedOrPendingFromValue.
32+
(WebCore::StyleResolver::generatedOrPendingFromValue): Take the value as a
33+
reference instead of a pointer.
34+
(WebCore::StyleResolver::loadPendingImage): Pass a refernece instead of a
35+
pointer to StyleGeneratedImage::create.
36+
(WebCore::StyleResolver::loadPendingImages): Use auto for iteration instead of
37+
a lot type name.
38+
39+
* css/StyleResolver.h: Changed generatedOrPendingFromValue to take the value
40+
as a reference instead of a pointer.
41+
42+
* page/animation/CSSPropertyAnimation.cpp:
43+
(WebCore::blendFilter): Pass a reference insted of a pointer to
44+
StyleGeneratedImage::create.
45+
(WebCore::crossfadeBlend): Ditto.
46+
(WebCore::blendFunc): Ditto. Also use references for local variables.
47+
48+
* rendering/style/StyleGeneratedImage.cpp:
49+
(WebCore::StyleGeneratedImage::StyleGeneratedImage): Use PassRef instead of
50+
PassRefPtr for the argument type.
51+
(WebCore::StyleGeneratedImage::cssValue): Updated since m_imageGeneratorValue
52+
is now a Ref instead of a RefPtr. Sadly this requires a const_cast that we can
53+
come back and get rid of later.
54+
(WebCore::StyleGeneratedImage::imageSize): Ditto.
55+
(WebCore::StyleGeneratedImage::image): Ditto.
56+
57+
* rendering/style/StyleGeneratedImage.h: Changed create function and constructor
58+
to take a PassRef. Made imageValue non-const since it returns a non-const value,
59+
to be consistent with "conceptual const". Changed m_imageGeneratorValue to be a
60+
Ref instead of a RefPtr.
61+
62+
* rendering/style/StyleImage.h: Made WrappedImagePtr be const void*, since it's
63+
a pointer used only for equality checks. Not a great idiom, but fine to use a
64+
const pointer instead of non-const, and avoids the const_cast we'd otherwise
65+
need in StyleGeneratedImage::data.
66+
167
2013-12-12 KyungTae Kim <ktf.kim@samsung.com>
268

369
Improve the find word boundary performance

Source/WebCore/css/CSSCrossfadeValue.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ static inline double blendFunc(double from, double to, double progress)
4444
return blend(from, to, progress);
4545
}
4646

47-
static bool subimageKnownToBeOpaque(CSSValue* value, const RenderElement* renderer)
47+
static bool subimageKnownToBeOpaque(CSSValue& value, const RenderElement* renderer)
4848
{
49-
if (value->isImageValue())
50-
return toCSSImageValue(value)->knownToBeOpaque(renderer);
49+
if (value.isImageValue())
50+
return toCSSImageValue(value).knownToBeOpaque(renderer);
5151

52-
if (value->isImageGeneratorValue())
53-
return static_cast<CSSImageGeneratorValue*>(value)->knownToBeOpaque(renderer);
52+
if (value.isImageGeneratorValue())
53+
return toCSSImageGeneratorValue(value).knownToBeOpaque(renderer);
5454

5555
ASSERT_NOT_REACHED();
5656

@@ -110,7 +110,7 @@ bool CSSCrossfadeValue::isPending() const
110110

111111
bool CSSCrossfadeValue::knownToBeOpaque(const RenderElement* renderer) const
112112
{
113-
return subimageKnownToBeOpaque(m_fromValue.get(), renderer) && subimageKnownToBeOpaque(m_toValue.get(), renderer);
113+
return subimageKnownToBeOpaque(*m_fromValue, renderer) && subimageKnownToBeOpaque(*m_toValue, renderer);
114114
}
115115

116116
void CSSCrossfadeValue::loadSubimages(CachedResourceLoader* cachedResourceLoader)

Source/WebCore/css/CSSImageGeneratorValue.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include "CSSFilterImageValue.h"
3333
#include "CSSGradientValue.h"
3434
#include "CSSImageValue.h"
35+
#include "GeneratedImage.h"
3536
#include "Image.h"
3637
#include "RenderElement.h"
3738
#include "StyleCachedImage.h"
@@ -80,7 +81,7 @@ GeneratedImage* CSSImageGeneratorValue::cachedImageForSize(IntSize size)
8081
void CSSImageGeneratorValue::saveCachedImageForSize(IntSize size, PassRefPtr<GeneratedImage> image)
8182
{
8283
ASSERT(!m_images.contains(size));
83-
m_images.add(size, adoptPtr(new CachedGeneratedImage(*this, size, image)));
84+
m_images.add(size, std::make_unique<CachedGeneratedImage>(*this, size, image));
8485
}
8586

8687
void CSSImageGeneratorValue::evictCachedGeneratedImage(IntSize size)
@@ -240,7 +241,7 @@ bool CSSImageGeneratorValue::subimageIsPending(CSSValue* value)
240241
return toCSSImageValue(value)->cachedOrPendingImage()->isPendingImage();
241242

242243
if (value->isImageGeneratorValue())
243-
return static_cast<CSSImageGeneratorValue*>(value)->isPending();
244+
return toCSSImageGeneratorValue(value)->isPending();
244245

245246
if (value->isPrimitiveValue() && toCSSPrimitiveValue(value)->getValueID() == CSSValueNone)
246247
return false;
@@ -253,27 +254,27 @@ bool CSSImageGeneratorValue::subimageIsPending(CSSValue* value)
253254
CachedImage* CSSImageGeneratorValue::cachedImageForCSSValue(CSSValue* value, CachedResourceLoader* cachedResourceLoader)
254255
{
255256
if (!value)
256-
return 0;
257+
return nullptr;
257258

258259
if (value->isImageValue()) {
259260
StyleCachedImage* styleCachedImage = toCSSImageValue(value)->cachedImage(cachedResourceLoader);
260261
if (!styleCachedImage)
261-
return 0;
262+
return nullptr;
262263

263264
return styleCachedImage->cachedImage();
264265
}
265266

266267
if (value->isImageGeneratorValue()) {
267-
static_cast<CSSImageGeneratorValue*>(value)->loadSubimages(cachedResourceLoader);
268+
toCSSImageGeneratorValue(value)->loadSubimages(cachedResourceLoader);
268269
// FIXME: Handle CSSImageGeneratorValue (and thus cross-fades with gradients and canvas).
269-
return 0;
270+
return nullptr;
270271
}
271272

272273
if (value->isPrimitiveValue() && toCSSPrimitiveValue(value)->getValueID() == CSSValueNone)
273-
return 0;
274+
return nullptr;
274275

275276
ASSERT_NOT_REACHED();
276277

277-
return 0;
278+
return nullptr;
278279
}
279280
} // namespace WebCore

Source/WebCore/css/CSSImageGeneratorValue.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,16 @@
2727
#define CSSImageGeneratorValue_h
2828

2929
#include "CSSValue.h"
30-
#include "CachedImage.h"
31-
#include "GeneratedImage.h"
3230
#include "IntSizeHash.h"
3331
#include "Timer.h"
3432
#include <wtf/HashCountedSet.h>
35-
#include <wtf/RefPtr.h>
3633

3734
namespace WebCore {
3835

36+
class CachedImage;
3937
class CachedResourceLoader;
4038
class GeneratedImage;
39+
class Image;
4140
class RenderElement;
4241
class StyleResolver;
4342

@@ -89,9 +88,11 @@ class CSSImageGeneratorValue : public CSSValue {
8988
void evictCachedGeneratedImage(IntSize);
9089

9190
HashCountedSet<RenderElement*> m_clients;
92-
HashMap<IntSize, OwnPtr<CachedGeneratedImage>> m_images;
91+
HashMap<IntSize, std::unique_ptr<CachedGeneratedImage>> m_images;
9392
};
9493

94+
CSS_VALUE_TYPE_CASTS(CSSImageGeneratorValue, isImageGeneratorValue())
95+
9596
} // namespace WebCore
9697

9798
#endif // CSSImageGeneratorValue_h

Source/WebCore/css/CSSValue.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
#include "CSSFunctionValue.h"
4242
#include "CSSGradientValue.h"
4343
#include "CSSGridTemplateValue.h"
44-
#include "CSSImageGeneratorValue.h"
4544
#include "CSSImageSetValue.h"
4645
#include "CSSImageValue.h"
4746
#include "CSSInheritedValue.h"

Source/WebCore/css/StyleResolver.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,11 @@ inline void StyleResolver::State::cacheBorderAndBackground()
218218

219219
inline void StyleResolver::State::clear()
220220
{
221-
m_element = 0;
222-
m_styledElement = 0;
223-
m_parentStyle = 0;
224-
m_parentNode = 0;
225-
m_regionForStyling = 0;
221+
m_element = nullptr;
222+
m_styledElement = nullptr;
223+
m_parentStyle = nullptr;
224+
m_parentNode = nullptr;
225+
m_regionForStyling = nullptr;
226226
m_pendingImageProperties.clear();
227227
#if ENABLE(CSS_SHADERS)
228228
m_hasPendingShaders = false;
@@ -2090,9 +2090,9 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
20902090
CSSValue* item = i.value();
20912091
if (item->isImageGeneratorValue()) {
20922092
if (item->isGradientValue())
2093-
state.style()->setContent(StyleGeneratedImage::create(toCSSGradientValue(item)->gradientWithStylesResolved(this).get()), didSet);
2093+
state.style()->setContent(StyleGeneratedImage::create(*toCSSGradientValue(item)->gradientWithStylesResolved(this)), didSet);
20942094
else
2095-
state.style()->setContent(StyleGeneratedImage::create(static_cast<CSSImageGeneratorValue*>(item)), didSet);
2095+
state.style()->setContent(StyleGeneratedImage::create(*toCSSImageGeneratorValue(item)), didSet);
20962096
didSet = true;
20972097
#if ENABLE(CSS_IMAGE_SET)
20982098
} else if (item->isImageSetValue()) {
@@ -3067,8 +3067,8 @@ PassRefPtr<StyleImage> StyleResolver::styleImage(CSSPropertyID property, CSSValu
30673067

30683068
if (value->isImageGeneratorValue()) {
30693069
if (value->isGradientValue())
3070-
return generatedOrPendingFromValue(property, toCSSGradientValue(value)->gradientWithStylesResolved(this).get());
3071-
return generatedOrPendingFromValue(property, static_cast<CSSImageGeneratorValue*>(value));
3070+
return generatedOrPendingFromValue(property, *toCSSGradientValue(value)->gradientWithStylesResolved(this));
3071+
return generatedOrPendingFromValue(property, toCSSImageGeneratorValue(*value));
30723072
}
30733073

30743074
#if ENABLE(CSS_IMAGE_SET)
@@ -3090,17 +3090,17 @@ PassRefPtr<StyleImage> StyleResolver::cachedOrPendingFromValue(CSSPropertyID pro
30903090
return image.release();
30913091
}
30923092

3093-
PassRefPtr<StyleImage> StyleResolver::generatedOrPendingFromValue(CSSPropertyID property, CSSImageGeneratorValue* value)
3093+
PassRefPtr<StyleImage> StyleResolver::generatedOrPendingFromValue(CSSPropertyID property, CSSImageGeneratorValue& value)
30943094
{
30953095
#if ENABLE(CSS_FILTERS)
3096-
if (value->isFilterImageValue()) {
3096+
if (value.isFilterImageValue()) {
30973097
// FilterImage needs to calculate FilterOperations.
3098-
toCSSFilterImageValue(value)->createFilterOperations(this);
3098+
toCSSFilterImageValue(value).createFilterOperations(this);
30993099
}
31003100
#endif
3101-
if (value->isPending()) {
3102-
m_state.pendingImageProperties().set(property, value);
3103-
return StylePendingImage::create(value);
3101+
if (value.isPending()) {
3102+
m_state.pendingImageProperties().set(property, &value);
3103+
return StylePendingImage::create(&value);
31043104
}
31053105
return StyleGeneratedImage::create(value);
31063106
}
@@ -3881,7 +3881,7 @@ PassRefPtr<StyleImage> StyleResolver::loadPendingImage(StylePendingImage* pendin
38813881

38823882
if (auto imageGeneratorValue = pendingImage->cssImageGeneratorValue()) {
38833883
imageGeneratorValue->loadSubimages(m_state.document().cachedResourceLoader());
3884-
return StyleGeneratedImage::create(imageGeneratorValue);
3884+
return StyleGeneratedImage::create(*imageGeneratorValue);
38853885
}
38863886

38873887
if (auto cursorImageValue = pendingImage->cssCursorImageValue())
@@ -3923,8 +3923,8 @@ void StyleResolver::loadPendingImages()
39233923
if (m_state.pendingImageProperties().isEmpty())
39243924
return;
39253925

3926-
PendingImagePropertyMap::const_iterator::Keys end = m_state.pendingImageProperties().end().keys();
3927-
for (PendingImagePropertyMap::const_iterator::Keys it = m_state.pendingImageProperties().begin().keys(); it != end; ++it) {
3926+
auto end = m_state.pendingImageProperties().end().keys();
3927+
for (auto it = m_state.pendingImageProperties().begin().keys(); it != end; ++it) {
39283928
CSSPropertyID currentProperty = *it;
39293929

39303930
switch (currentProperty) {

Source/WebCore/css/StyleResolver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ class StyleResolver {
503503

504504
PassRefPtr<StyleImage> styleImage(CSSPropertyID, CSSValue*);
505505
PassRefPtr<StyleImage> cachedOrPendingFromValue(CSSPropertyID, CSSImageValue*);
506-
PassRefPtr<StyleImage> generatedOrPendingFromValue(CSSPropertyID, CSSImageGeneratorValue*);
506+
PassRefPtr<StyleImage> generatedOrPendingFromValue(CSSPropertyID, CSSImageGeneratorValue&);
507507
#if ENABLE(CSS_IMAGE_SET)
508508
PassRefPtr<StyleImage> setOrPendingFromValue(CSSPropertyID, CSSImageSetValue*);
509509
#endif

Source/WebCore/page/animation/CSSPropertyAnimation.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ static inline PassRefPtr<StyleImage> blendFilter(const AnimationBase* anim, Cach
221221
RefPtr<CSSFilterImageValue> result = CSSFilterImageValue::create(std::move(imageValue), filterValue);
222222
result->setFilterOperations(filterResult);
223223

224-
return StyleGeneratedImage::create(result.get());
224+
return StyleGeneratedImage::create(*result);
225225
}
226226
#endif // ENABLE(CSS_FILTERS)
227227

@@ -288,7 +288,7 @@ static inline PassRefPtr<StyleImage> crossfadeBlend(const AnimationBase*, StyleC
288288

289289
crossfadeValue->setPercentage(CSSPrimitiveValue::create(progress, CSSPrimitiveValue::CSS_NUMBER));
290290

291-
return StyleGeneratedImage::create(crossfadeValue.get());
291+
return StyleGeneratedImage::create(*crossfadeValue);
292292
}
293293

294294
static inline PassRefPtr<StyleImage> blendFunc(const AnimationBase* anim, StyleImage* from, StyleImage* to, double progress)
@@ -298,42 +298,42 @@ static inline PassRefPtr<StyleImage> blendFunc(const AnimationBase* anim, StyleI
298298

299299
// Animation between two generated images. Cross fade for all other cases.
300300
if (from->isGeneratedImage() && to->isGeneratedImage()) {
301-
CSSImageGeneratorValue* fromGenerated = toStyleGeneratedImage(from)->imageValue();
302-
CSSImageGeneratorValue* toGenerated = toStyleGeneratedImage(to)->imageValue();
301+
CSSImageGeneratorValue& fromGenerated = toStyleGeneratedImage(from)->imageValue();
302+
CSSImageGeneratorValue& toGenerated = toStyleGeneratedImage(to)->imageValue();
303303

304304
#if ENABLE(CSS_FILTERS)
305-
if (fromGenerated->isFilterImageValue() && toGenerated->isFilterImageValue()) {
305+
if (fromGenerated.isFilterImageValue() && toGenerated.isFilterImageValue()) {
306306
// Animation of generated images just possible if input images are equal.
307307
// Otherwise fall back to cross fade animation.
308-
CSSFilterImageValue& fromFilter = *toCSSFilterImageValue(fromGenerated);
309-
CSSFilterImageValue& toFilter = *toCSSFilterImageValue(toGenerated);
308+
CSSFilterImageValue& fromFilter = toCSSFilterImageValue(fromGenerated);
309+
CSSFilterImageValue& toFilter = toCSSFilterImageValue(toGenerated);
310310
if (fromFilter.equalInputImages(toFilter) && fromFilter.cachedImage())
311311
return blendFilter(anim, fromFilter.cachedImage(), fromFilter.filterOperations(), toFilter.filterOperations(), progress);
312312
}
313313
#endif
314314

315-
if (fromGenerated->isCrossfadeValue() && toGenerated->isCrossfadeValue()) {
316-
CSSCrossfadeValue& fromCrossfade = *toCSSCrossfadeValue(fromGenerated);
317-
CSSCrossfadeValue& toCrossfade = *toCSSCrossfadeValue(toGenerated);
315+
if (fromGenerated.isCrossfadeValue() && toGenerated.isCrossfadeValue()) {
316+
CSSCrossfadeValue& fromCrossfade = toCSSCrossfadeValue(fromGenerated);
317+
CSSCrossfadeValue& toCrossfade = toCSSCrossfadeValue(toGenerated);
318318
if (fromCrossfade.equalInputImages(toCrossfade))
319-
return StyleGeneratedImage::create(toCrossfade.blend(fromCrossfade, progress).get());
319+
return StyleGeneratedImage::create(*toCrossfade.blend(fromCrossfade, progress));
320320
}
321321

322322
// FIXME: Add support for animation between two *gradient() functions.
323323
// https://bugs.webkit.org/show_bug.cgi?id=119956
324324
#if ENABLE(CSS_FILTERS)
325325
} else if (from->isGeneratedImage() && to->isCachedImage()) {
326-
CSSImageGeneratorValue* fromGenerated = toStyleGeneratedImage(from)->imageValue();
327-
if (fromGenerated->isFilterImageValue()) {
328-
CSSFilterImageValue& fromFilter = *toCSSFilterImageValue(fromGenerated);
326+
CSSImageGeneratorValue& fromGenerated = toStyleGeneratedImage(from)->imageValue();
327+
if (fromGenerated.isFilterImageValue()) {
328+
CSSFilterImageValue& fromFilter = toCSSFilterImageValue(fromGenerated);
329329
if (fromFilter.cachedImage() && static_cast<StyleCachedImage*>(to)->cachedImage() == fromFilter.cachedImage())
330330
return blendFilter(anim, fromFilter.cachedImage(), fromFilter.filterOperations(), FilterOperations(), progress);
331331
}
332332
// FIXME: Add interpolation between cross-fade and image source.
333333
} else if (from->isCachedImage() && to->isGeneratedImage()) {
334-
CSSImageGeneratorValue* toGenerated = toStyleGeneratedImage(to)->imageValue();
335-
if (toGenerated->isFilterImageValue()) {
336-
CSSFilterImageValue& toFilter = *toCSSFilterImageValue(toGenerated);
334+
CSSImageGeneratorValue& toGenerated = toStyleGeneratedImage(to)->imageValue();
335+
if (toGenerated.isFilterImageValue()) {
336+
CSSFilterImageValue& toFilter = toCSSFilterImageValue(toGenerated);
337337
if (toFilter.cachedImage() && static_cast<StyleCachedImage*>(from)->cachedImage() == toFilter.cachedImage())
338338
return blendFilter(anim, toFilter.cachedImage(), FilterOperations(), toFilter.filterOperations(), progress);
339339
}

0 commit comments

Comments
 (0)