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

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

Issue 2327243002: Use a scroll recorder rather than scroll offset for composited-scrolling backgrounds. (Closed)
Patch Set: none Created 4 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/BoxPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/BoxPainter.cpp b/third_party/WebKit/Source/core/paint/BoxPainter.cpp
index b8149222ab70dc5d5adbc6a521ab69610ae1032c..8eeac40f20b340539a3dc056508e18b64cd5f38c 100644
--- a/third_party/WebKit/Source/core/paint/BoxPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/BoxPainter.cpp
@@ -25,6 +25,7 @@
#include "core/paint/PaintInfo.h"
#include "core/paint/PaintLayer.h"
#include "core/paint/RoundedInnerRectClipper.h"
+#include "core/paint/ScrollRecorder.h"
#include "core/paint/ThemePainter.h"
#include "platform/LengthFunctions.h"
#include "platform/geometry/LayoutPoint.h"
@@ -58,11 +59,12 @@ void BoxPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOffse
void BoxPainter::paintBoxDecorationBackground(const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
LayoutRect paintRect;
+ Optional<ScrollRecorder> scrollRecorder;
if (isPaintingBackgroundOfPaintContainerIntoScrollingContentsLayer(&m_layoutBox, paintInfo)) {
// For the case where we are painting the background into the scrolling contents layer
// of a composited scroller we need to include the entire overflow rect.
paintRect = m_layoutBox.layoutOverflowRect();
- paintRect.move(-m_layoutBox.scrolledContentOffset());
+ scrollRecorder.emplace(paintInfo.context, m_layoutBox, paintInfo.phase, m_layoutBox.scrolledContentOffset());
// The background painting code assumes that the borders are part of the paintRect so we
// expand the paintRect by the border size when painting the background into the
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698