Changeset 89221 in webkit
- Timestamp:
- Jun 19, 2011 1:48:17 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r89220 r89221 1 2011-06-19 Una Sabovic <una.sabovic@palm.com> 2 3 Reviewed by Darin Adler. 4 5 Optimization: avoid call to clearRect() when bgColor is valid when painting the root background in RenderBoxModelObject::paintFillLayerExtended 6 https://bugs.webkit.org/show_bug.cgi?id=62908 7 8 When root layers base color is fully transparent backgroundRect was cleared before bgColor is applied. 9 Instead of clearing the rect we apply CompositeCopy operation when painting the background color. 10 11 No new tests. This is an optimization, it doesn't change any existing functionality. 12 13 * platform/graphics/GraphicsContext.cpp: 14 (WebCore::GraphicsContext::fillRect): 15 * platform/graphics/GraphicsContext.h: 16 * rendering/RenderBoxModelObject.cpp: 17 (WebCore::RenderBoxModelObject::paintFillLayerExtended): 18 1 19 2011-06-19 Dirk Schulze <krit@webkit.org> 2 20 -
trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp
r85853 r89221 614 614 } 615 615 616 void GraphicsContext::fillRect(const FloatRect& rect, const Color& color, ColorSpace styleColorSpace, CompositeOperator op) 617 { 618 if (paintingDisabled()) 619 return; 620 621 CompositeOperator previousOperator = compositeOperation(); 622 setCompositeOperation(op); 623 fillRect(rect, color, styleColorSpace); 624 setCompositeOperation(previousOperator); 625 } 626 616 627 void GraphicsContext::fillRoundedRect(const RoundedIntRect& rect, const Color& color, ColorSpace colorSpace) 617 628 { -
trunk/Source/WebCore/platform/graphics/GraphicsContext.h
r87745 r89221 294 294 void fillRect(const FloatRect&, const Color&, ColorSpace); 295 295 void fillRect(const FloatRect&, Generator&); 296 void fillRect(const FloatRect&, const Color&, ColorSpace, CompositeOperator); 296 297 void fillRoundedRect(const IntRect&, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight, const Color&, ColorSpace); 297 298 void fillRoundedRect(const RoundedIntRect&, const Color&, ColorSpace); -
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp
r89057 r89221 743 743 // If we have an alpha and we are painting the root element, go ahead and blend with the base background color. 744 744 Color baseColor; 745 bool shouldClearBackground = false; 745 746 if (isOpaqueRoot) { 746 747 baseColor = view()->frameView()->baseBackgroundColor(); 747 748 if (!baseColor.alpha()) 748 context->clearRect(backgroundRect);749 } 750 751 if (baseColor.alpha() > 0) {749 shouldClearBackground = true; 750 } 751 752 if (baseColor.alpha()) { 752 753 if (bgColor.alpha()) 753 754 baseColor = baseColor.blend(bgColor); 754 755 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)760 context-> fillRect(backgroundRect, bgColor, style()->colorSpace());756 context->fillRect(backgroundRect, baseColor, style()->colorSpace(), CompositeCopy); 757 } else if (bgColor.alpha()) { 758 CompositeOperator operation = shouldClearBackground ? CompositeCopy : context->compositeOperation(); 759 context->fillRect(backgroundRect, bgColor, style()->colorSpace(), operation); 760 } else if (shouldClearBackground) 761 context->clearRect(backgroundRect); 761 762 } 762 763
Note: See TracChangeset
for help on using the changeset viewer.