Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1049)

Unified Diff: Source/core/rendering/RenderBoxModelObject.cpp

Issue 110913005: Revert of Blend background with existing content (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/page/Settings.in ('k') | Source/web/WebSettingsImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderBoxModelObject.cpp
diff --git a/Source/core/rendering/RenderBoxModelObject.cpp b/Source/core/rendering/RenderBoxModelObject.cpp
index 36ac404b6f292148164fb1b087098e5770477bba..e39ec2174ffdffc6194e4a1749fcd36f5fda846a 100644
--- a/Source/core/rendering/RenderBoxModelObject.cpp
+++ b/Source/core/rendering/RenderBoxModelObject.cpp
@@ -702,28 +702,29 @@
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 (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 shouldClearDocumentBackground = document().settings() && document().settings()->shouldClearDocumentBackground();
- CompositeOperator operation = shouldClearDocumentBackground ? CompositeCopy : context->compositeOperation();
-
- 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 (shouldClearDocumentBackground) {
- context->clearRect(backgroundRect);
- }
+ if (baseColor.alpha()) {
+ if (bgColor.alpha())
+ baseColor = baseColor.blend(bgColor);
+
+ context->fillRect(backgroundRect, baseColor, CompositeCopy);
} else if (bgColor.alpha()) {
- context->fillRect(backgroundRect, bgColor, context->compositeOperation());
- }
+ CompositeOperator operation = shouldClearBackground ? CompositeCopy : context->compositeOperation();
+ context->fillRect(backgroundRect, bgColor, operation);
+ } else if (shouldClearBackground)
+ context->clearRect(backgroundRect);
}
}
« no previous file with comments | « Source/core/page/Settings.in ('k') | Source/web/WebSettingsImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698