[webkit-changes] [WebKit/WebKit] 567ebf: Speedup setting canvas colors from strings

Commit Queue noreply at github.com
Mon Jul 15 11:48:11 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 567ebfd314d66058ab43964381737dd0ce12ea0d
      https://github.com/WebKit/WebKit/commit/567ebfd314d66058ab43964381737dd0ce12ea0d
  Author: Sam Weinig <sam at webkit.org>
  Date:   2024-07-15 (Mon, 15 Jul 2024)

  Changed paths:
    M Source/WebCore/css/color/CSSUnresolvedColorResolutionContext.h
    M Source/WebCore/css/parser/CSSPropertyParserConsumer+Color.cpp
    M Source/WebCore/css/parser/CSSPropertyParserConsumer+Color.h
    M Source/WebCore/html/canvas/CanvasStyle.cpp

  Log Message:
  -----------
  Speedup setting canvas colors from strings
https://bugs.webkit.org/show_bug.cgi?id=276541

Reviewed by Darin Adler.

Speedup the common case for setting canvas colors from strings by:

- Ensuring the common fast path (CSSParserFastPaths::parseSimpleColor) is
  called before any additional work is done to setup things like the eager
  resolution context.
- Remove the allocation of the eager resolution context by using it directly
  from the stack.

* Source/WebCore/css/color/CSSUnresolvedColorResolutionContext.h:
* Source/WebCore/css/parser/CSSPropertyParserConsumer+Color.cpp:
(WebCore::CSSPropertyParserHelpers::parseColorRawSlow):
(WebCore::CSSPropertyParserHelpers::parseColorRaw): Deleted.
* Source/WebCore/css/parser/CSSPropertyParserConsumer+Color.h:
(WebCore::CSSPropertyParserHelpers::parseColorRawSlow):
(WebCore::CSSPropertyParserHelpers::parseColorRaw):
* Source/WebCore/html/canvas/CanvasStyle.cpp:
(WebCore::CanvasStyleColorResolutionDelegate::currentColor const):
(WebCore::elementlessColorParsingParameters):
(WebCore::colorParsingParameters):
(WebCore::parseColor):

Canonical link: https://commits.webkit.org/280976@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list