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

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

Issue 12089070: Merge 141160 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Patch Set: Created 7 years, 11 months 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 | « LayoutTests/platform/chromium/TestExpectations ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/rendering/RenderBoxModelObject.cpp
===================================================================
--- Source/WebCore/rendering/RenderBoxModelObject.cpp (revision 141266)
+++ Source/WebCore/rendering/RenderBoxModelObject.cpp (working copy)
@@ -912,35 +912,37 @@
// Paint the color first underneath all images, culled if background image occludes it.
// FIXME: In the bgLayer->hasFiniteBounds() case, we could improve the culling test
// by verifying whether the background image covers the entire layout rect.
- if (!bgLayer->next() && !(shouldPaintBackgroundImage && bgLayer->hasOpaqueImage(this) && bgLayer->hasRepeatXY())) {
+ if (!bgLayer->next()) {
IntRect backgroundRect(pixelSnappedIntRect(scrolledPaintRect));
bool boxShadowShouldBeAppliedToBackground = this->boxShadowShouldBeAppliedToBackground(bleedAvoidance, box);
- if (!boxShadowShouldBeAppliedToBackground)
- backgroundRect.intersect(paintInfo.rect);
+ if (boxShadowShouldBeAppliedToBackground || !shouldPaintBackgroundImage || !bgLayer->hasOpaqueImage(this) || !bgLayer->hasRepeatXY()) {
+ 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;
- }
+ // 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, style());
+ GraphicsContextStateSaver shadowStateSaver(*context, boxShadowShouldBeAppliedToBackground);
+ if (boxShadowShouldBeAppliedToBackground)
+ applyBoxShadowForBackground(context, style());
- if (baseColor.alpha()) {
- if (bgColor.alpha())
- baseColor = baseColor.blend(bgColor);
+ if (baseColor.alpha()) {
+ if (bgColor.alpha())
+ baseColor = baseColor.blend(bgColor);
- context->fillRect(backgroundRect, baseColor, style()->colorSpace(), CompositeCopy);
- } else if (bgColor.alpha()) {
- CompositeOperator operation = shouldClearBackground ? CompositeCopy : context->compositeOperation();
- context->fillRect(backgroundRect, bgColor, style()->colorSpace(), operation);
- } else if (shouldClearBackground)
- context->clearRect(backgroundRect);
+ context->fillRect(backgroundRect, baseColor, style()->colorSpace(), CompositeCopy);
+ } else if (bgColor.alpha()) {
+ CompositeOperator operation = shouldClearBackground ? CompositeCopy : context->compositeOperation();
+ context->fillRect(backgroundRect, bgColor, style()->colorSpace(), operation);
+ } else if (shouldClearBackground)
+ context->clearRect(backgroundRect);
+ }
}
// no progressive loading of the background image
« no previous file with comments | « LayoutTests/platform/chromium/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698