Chromium Code Reviews| Index: Source/core/rendering/RenderBoxModelObject.cpp |
| diff --git a/Source/core/rendering/RenderBoxModelObject.cpp b/Source/core/rendering/RenderBoxModelObject.cpp |
| index 932db84e2a01905a1926066b8f1bb04e49f1d64a..7ca5136bc25d6956be28091f906e814784e8e318 100644 |
| --- a/Source/core/rendering/RenderBoxModelObject.cpp |
| +++ b/Source/core/rendering/RenderBoxModelObject.cpp |
| @@ -706,29 +706,28 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co |
| if (!boxShadowShouldBeAppliedToBackground) |
| backgroundRect.intersect(paintInfo.rect); |
| - // If we have an alpha and we are painting the root element, go ahead and blend with the base background color. |
| - Color baseColor; |
| - bool shouldClearBackground = false; |
| - if (isOpaqueRoot) { |
| - baseColor = view()->frameView()->baseBackgroundColor(); |
| - if (!baseColor.alpha()) |
| - shouldClearBackground = true; |
| - } |
| - |
| GraphicsContextStateSaver shadowStateSaver(*context, boxShadowShouldBeAppliedToBackground); |
| if (boxShadowShouldBeAppliedToBackground) |
| applyBoxShadowForBackground(context, this); |
| - if (baseColor.alpha()) { |
| - if (bgColor.alpha()) |
| - baseColor = baseColor.blend(bgColor); |
| - |
| - context->fillRect(backgroundRect, baseColor, CompositeCopy); |
| + if (isOpaqueRoot) { |
| + // If we have an alpha and we are painting the root element, go ahead and blend with the base background color. |
| + Color baseColor = view()->frameView()->baseBackgroundColor(); |
| + bool shouldBlendWithExistingContent = document().settings() && document().settings()->shouldBlendWithExistingContent(); |
|
enne (OOO)
2013/09/24 18:35:48
bikeshed: shouldBlendWithExistingContent is a litt
|
| + CompositeOperator operation = shouldBlendWithExistingContent ? context->compositeOperation() : CompositeCopy; |
| + |
| + if (baseColor.alpha()) { |
| + if (bgColor.alpha()) |
| + baseColor = baseColor.blend(bgColor); |
| + context->fillRect(backgroundRect, baseColor, operation); |
| + } else if (bgColor.alpha()) { |
| + context->fillRect(backgroundRect, bgColor, operation); |
| + } else if (!shouldBlendWithExistingContent) { |
| + context->clearRect(backgroundRect); |
| + } |
| } else if (bgColor.alpha()) { |
| - CompositeOperator operation = shouldClearBackground ? CompositeCopy : context->compositeOperation(); |
| - context->fillRect(backgroundRect, bgColor, operation); |
| - } else if (shouldClearBackground) |
| - context->clearRect(backgroundRect); |
| + context->fillRect(backgroundRect, bgColor, context->compositeOperation()); |
| + } |
| } |
| } |