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

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

Issue 165213005: Avoid using transparency layer for fancy borders. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: expanded test expectations Created 6 years, 10 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/TestExpectations ('k') | Source/core/rendering/RenderBoxModelObject.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderBox.cpp
diff --git a/Source/core/rendering/RenderBox.cpp b/Source/core/rendering/RenderBox.cpp
index 7f60d7f2e941e497b994cab8b4eb465edb95bc45..311d9dfc207ec4ce24cc4f5ec6605d55a085f153 100644
--- a/Source/core/rendering/RenderBox.cpp
+++ b/Source/core/rendering/RenderBox.cpp
@@ -1204,7 +1204,7 @@ BackgroundBleedAvoidance RenderBox::determineBackgroundBleedAvoidance(GraphicsCo
if (!style->hasAppearance() && borderObscuresBackground() && backgroundHasOpaqueTopLayer())
return BackgroundBleedBackgroundOverBorder;
- return BackgroundBleedUseTransparencyLayer;
+ return BackgroundBleedClipBackground;
}
void RenderBox::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
@@ -1227,20 +1227,13 @@ void RenderBox::paintBoxDecorationsWithRect(PaintInfo& paintInfo, const LayoutPo
paintBoxShadow(paintInfo, paintRect, style(), Normal);
GraphicsContextStateSaver stateSaver(*paintInfo.context, false);
- if (bleedAvoidance == BackgroundBleedUseTransparencyLayer) {
- // To avoid the background color bleeding out behind the border, we'll render background and border
- // into a transparency layer, and then clip that in one go (which requires setting up the clip before
- // beginning the layer).
- RoundedRect border = style()->getRoundedBorderFor(paintRect);
+ if (bleedAvoidance == BackgroundBleedClipBackground) {
stateSaver.save();
+ RoundedRect border = style()->getRoundedBorderFor(paintRect);
paintInfo.context->clipRoundedRect(border);
- paintInfo.context->beginTransparencyLayer(1);
}
paintBackgroundWithBorderAndBoxShadow(paintInfo, paintRect, bleedAvoidance);
-
- if (bleedAvoidance == BackgroundBleedUseTransparencyLayer)
- paintInfo.context->endLayer();
}
void RenderBox::paintBackgroundWithBorderAndBoxShadow(PaintInfo& paintInfo, const LayoutRect& paintRect, BackgroundBleedAvoidance bleedAvoidance)
« no previous file with comments | « LayoutTests/TestExpectations ('k') | Source/core/rendering/RenderBoxModelObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698