Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: 766d0eca343b7fd0ca5f29ab89e12bdd4c531244 https://github.com/WebKit/WebKit/commit/766d0eca343b7fd0ca5f29ab89e12bdd4c531244 Author: Sam Weinig <wei...@apple.com> Date: 2023-01-29 (Sun, 29 Jan 2023)
Changed paths: M Source/WebCore/css/CSSCanvasValue.cpp M Source/WebCore/css/CSSCanvasValue.h M Source/WebCore/css/CSSFilterImageValue.cpp M Source/WebCore/css/CSSGradientValue.cpp M Source/WebCore/css/CSSGradientValue.h M Source/WebCore/css/CSSNamedImageValue.cpp M Source/WebCore/css/CSSNamedImageValue.h Log Message: ----------- Optimize CSS images by caching StyleImages when possible https://bugs.webkit.org/show_bug.cgi?id=251162 rdar://104654181 Reviewed by Antti Koivisto. Add caching of StyleImages in CSSValue classes to avoid duplicate processing and allocation where possible. This is a pretty conservative pass of caching opertunities, further opertunities may be available. The largest optimization here is for CSS gradients, where by caching the StyleGradientImage, we can avoid recomputing color stops in many cases. * Source/WebCore/css/CSSCanvasValue.cpp: (WebCore::CSSCanvasValue::createStyleImage const): * Source/WebCore/css/CSSCanvasValue.h: * Source/WebCore/css/CSSGradientValue.cpp: (WebCore::CSSLinearGradientValue::createStyleImage const): (WebCore::CSSPrefixedLinearGradientValue::createStyleImage const): (WebCore::CSSDeprecatedLinearGradientValue::createStyleImage const): (WebCore::CSSRadialGradientValue::createStyleImage const): (WebCore::CSSPrefixedRadialGradientValue::createStyleImage const): (WebCore::CSSDeprecatedRadialGradientValue::createStyleImage const): (WebCore::CSSConicGradientValue::createStyleImage const): * Source/WebCore/css/CSSGradientValue.h: * Source/WebCore/css/CSSNamedImageValue.cpp: * Source/WebCore/css/CSSNamedImageValue.h: Canonical link: https://commits.webkit.org/259538@main _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes