Changeset 89057 in webkit


Ignore:
Timestamp:
Jun 16, 2011 12:14:29 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-06-16 una sabovic <una.sabovic@palm.com>

Reviewed by Simon Fraser.

Optimization: do a single fillRect when painting the root background in RenderBoxModelObject::paintFillLayerExtended
https://bugs.webkit.org/show_bug.cgi?id=62593

When painting the root background, instead of doing two fillRects blend the base with background color and do a single fillRect.

No new tests. This is an optimization and it doesn't change any existing functionality.

  • rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::paintFillLayerExtended):
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r89056 r89057  
     12011-06-16  una sabovic  <una.sabovic@palm.com>
     2
     3        Reviewed by Simon Fraser.
     4
     5        Optimization: do a single fillRect when painting the root background in RenderBoxModelObject::paintFillLayerExtended
     6        https://bugs.webkit.org/show_bug.cgi?id=62593
     7
     8        When painting the root background, instead of doing two fillRects blend the base with background color and do a single fillRect.
     9       
     10        No new tests. This is an optimization and it doesn't change any existing functionality.
     11
     12        * rendering/RenderBoxModelObject.cpp:
     13        (WebCore::RenderBoxModelObject::paintFillLayerExtended):
     14
    1152011-06-16  Ryosuke Niwa  <rniwa@webkit.org>
    216
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp

    r88250 r89057  
    742742        backgroundRect.intersect(paintInfo.rect);
    743743        // If we have an alpha and we are painting the root element, go ahead and blend with the base background color.
     744        Color baseColor;
    744745        if (isOpaqueRoot) {
    745             Color baseColor = view()->frameView()->baseBackgroundColor();
    746             if (baseColor.alpha() > 0) {
    747                 CompositeOperator previousOperator = context->compositeOperation();
    748                 context->setCompositeOperation(CompositeCopy);
    749                 context->fillRect(backgroundRect, baseColor, style()->colorSpace());
    750                 context->setCompositeOperation(previousOperator);
    751             } else
     746            baseColor = view()->frameView()->baseBackgroundColor();
     747            if (!baseColor.alpha())
    752748                context->clearRect(backgroundRect);
    753749        }
    754750
    755         if (bgColor.isValid() && bgColor.alpha() > 0)
     751        if (baseColor.alpha() > 0) {
     752            if (bgColor.alpha())
     753                baseColor = baseColor.blend(bgColor);
     754
     755            CompositeOperator previousOperator = context->compositeOperation();
     756            context->setCompositeOperation(CompositeCopy);
     757            context->fillRect(backgroundRect, baseColor, style()->colorSpace());
     758            context->setCompositeOperation(previousOperator);
     759        } else if (bgColor.alpha() > 0)
    756760            context->fillRect(backgroundRect, bgColor, style()->colorSpace());
    757761    }
Note: See TracChangeset for help on using the changeset viewer.