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

Unified Diff: Source/core/paint/BoxPainter.cpp

Issue 1110193002: Remove CTM-dependent paintBoxShadow() heuristic (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: expectations Created 5 years, 8 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') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/BoxPainter.cpp
diff --git a/Source/core/paint/BoxPainter.cpp b/Source/core/paint/BoxPainter.cpp
index 3844d9aab233a6374df3cdf0b8bc421738b1d93f..e38e127547a43204643b1c0268290d96a5d74ca0 100644
--- a/Source/core/paint/BoxPainter.cpp
+++ b/Source/core/paint/BoxPainter.cpp
@@ -2009,13 +2009,12 @@ void BoxPainter::paintBoxShadow(const PaintInfo& info, const LayoutRect& paintRe
// If the box is opaque, it is unnecessary to clip it out. However, doing so saves time
// when painting the shadow. On the other hand, it introduces subpixel gaps along the
- // corners. Those are avoided by insetting the clipping path by one pixel.
+ // corners. Those are avoided by insetting the clipping path by one CSS pixel.
if (hasOpaqueBackground)
rectToClipOut.inflateWithRadii(-1);
- if (!rectToClipOut.isEmpty()) {
+ if (!rectToClipOut.isEmpty())
context->clipOutRoundedRect(rectToClipOut);
- }
} else {
// This IntRect is correct even with fractional shadows, because it is used for the rectangle
// of the box itself, which is always pixel-aligned.
@@ -2024,21 +2023,12 @@ void BoxPainter::paintBoxShadow(const PaintInfo& info, const LayoutRect& paintRe
// If the box is opaque, it is unnecessary to clip it out. However, doing so saves time
// when painting the shadow. On the other hand, it introduces subpixel gaps along the
// edges if they are not pixel-aligned. Those are avoided by insetting the clipping path
- // by one pixel.
- // When Slimming Paint is enabled, turn off this heuristic. See crbug.com/382491 for details.
- if (hasOpaqueBackground && !RuntimeEnabledFeatures::slimmingPaintEnabled()) {
- // FIXME: The function to decide on the policy based on the transform should be a named function.
- // FIXME: It's not clear if this check is right. What about integral scale factors?
- // FIXME: See crbug.com/382491. The use of getCTM may also be wrong because it does not include
- // device zoom applied at raster time.
- AffineTransform transform = context->getCTM();
- if (transform.a() != 1 || (transform.d() != 1 && transform.d() != -1) || transform.b() || transform.c())
- rectToClipOut.inflate(-1);
- }
-
- if (!rectToClipOut.isEmpty()) {
+ // by one CSS pixel.
+ if (hasOpaqueBackground)
+ rectToClipOut.inflate(-1);
+
+ if (!rectToClipOut.isEmpty())
context->clipOut(rectToClipOut);
- }
}
}
« no previous file with comments | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698