Changeset 20675 in webkit


Ignore:
Timestamp:
Apr 2, 2007 10:54:33 PM (17 years ago)
Author:
adele
Message:

Reviewed by Maciej.

Fix for <rdar://problem/5107095> REGRESSION: disabled text color calculations are slowing down launchtime measurements

Hardcode disabled text colors for the most common cases- black and white.

  • rendering/RenderTextControl.cpp: (WebCore::disabledTextColor):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r20674 r20675  
     12007-04-02  Adele Peterson  <adele@apple.com>
     2
     3        Reviewed by Maciej.
     4
     5        Fix for <rdar://problem/5107095> REGRESSION: disabled text color calculations are slowing down launchtime measurements
     6
     7        Hardcode disabled text colors for the most common cases- black and white.
     8
     9        * rendering/RenderTextControl.cpp: (WebCore::disabledTextColor):
     10
    1112007-04-02  David Hyatt  <hyatt@apple.com>
    212
  • trunk/WebCore/rendering/RenderTextControl.cpp

    r20349 r20675  
    104104}
    105105
     106// Hardcode these common cases for speed.
     107const unsigned blackDisabledColor = 0xFF545454;
     108const unsigned whiteDisabledColor = 0xFFABABAB;
    106109static Color disabledTextColor(const Color& textColor, const Color& backgroundColor)
    107110{
    108111    if (differenceSquared(textColor, Color::white) > differenceSquared(backgroundColor, Color::white))
    109         return textColor.light();
    110     return textColor.dark();
     112        return textColor == Color::black ? Color(blackDisabledColor) : textColor.light();
     113    return textColor == Color::white ? Color(whiteDisabledColor) : textColor.dark();
    111114}
    112115
Note: See TracChangeset for help on using the changeset viewer.