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

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

Issue 729523002: Add fast/inline to virtual/slimmingpaint and make the tests pass (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Expectation for fast/inline/justify-emphasis-inline-box.html. Created 6 years, 1 month 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/paint/BlockPainter.cpp ('k') | Source/core/paint/InlinePainter.cpp » ('j') | 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 5a454a94cd7cb23809f30d635551dfd4ea5142e8..e88fba81e657e97b1e0c76958dc237463850012a 100644
--- a/Source/core/paint/BoxPainter.cpp
+++ b/Source/core/paint/BoxPainter.cpp
@@ -54,11 +54,18 @@ void BoxPainter::paintBoxDecorationBackgroundWithRect(PaintInfo& paintInfo, cons
RenderStyle* style = m_renderBox.style();
BoxDecorationData boxDecorationData(*style, m_renderBox.canRenderBorderImage(), m_renderBox.backgroundHasOpaqueTopLayer(), paintInfo.context);
- IntRect snappedPaintRect(pixelSnappedIntRect(paintRect));
- // The document element is specified to paint its background infinitely.
- DrawingRecorder recorder(paintInfo.context, &m_renderBox, paintInfo.phase,
- m_renderBox.isDocumentElement() ? m_renderBox.view()->backgroundRect(&m_renderBox) : snappedPaintRect);
-
+ LayoutRect bounds;
+ if (RuntimeEnabledFeatures::slimmingPaintEnabled()) {
+ if (m_renderBox.isDocumentElement()) {
+ // The document element is specified to paint its background infinitely.
+ bounds = m_renderBox.view()->backgroundRect(&m_renderBox);
+ } else {
+ // Use the visual overflow rect here, because it will include overflow introduced by the theme.
+ bounds = m_renderBox.visualOverflowRect();
+ bounds.moveBy(paintOffset);
+ }
+ }
+ DrawingRecorder recorder(paintInfo.context, &m_renderBox, paintInfo.phase, bounds);
// FIXME: Should eventually give the theme control over whether the box shadow should paint, since controls could have
// custom shadows of their own.
@@ -74,6 +81,7 @@ void BoxPainter::paintBoxDecorationBackgroundWithRect(PaintInfo& paintInfo, cons
// If we have a native theme appearance, paint that before painting our background.
// The theme will tell us whether or not we should also paint the CSS background.
+ IntRect snappedPaintRect(pixelSnappedIntRect(paintRect));
bool themePainted = boxDecorationData.hasAppearance && !RenderTheme::theme().paint(&m_renderBox, paintInfo, snappedPaintRect);
if (!themePainted) {
if (boxDecorationData.bleedAvoidance() == BackgroundBleedBackgroundOverBorder)
« no previous file with comments | « Source/core/paint/BlockPainter.cpp ('k') | Source/core/paint/InlinePainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698