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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutScrollbarPart.cpp

Issue 1406133005: Calculate paint invalidation rect for scrollbars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
Index: third_party/WebKit/Source/core/layout/LayoutScrollbarPart.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutScrollbarPart.cpp b/third_party/WebKit/Source/core/layout/LayoutScrollbarPart.cpp
index 0af88ce7cbfc9e4f9584c6c62475cbb79e0f4add..87294efd1a6af8d8c583f3bf12bb108dd8822061 100644
--- a/third_party/WebKit/Source/core/layout/LayoutScrollbarPart.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutScrollbarPart.cpp
@@ -31,6 +31,7 @@
#include "core/layout/LayoutScrollbar.h"
#include "core/layout/LayoutScrollbarTheme.h"
#include "core/layout/LayoutView.h"
+#include "core/paint/PaintLayerScrollableArea.h"
#include "platform/LengthFunctions.h"
namespace blink {
@@ -179,24 +180,14 @@ void LayoutScrollbarPart::styleDidChange(StyleDifference diff, const ComputedSty
clearPositionedState();
setFloating(false);
setHasOverflowClip(false);
- if (oldStyle && m_scrollbar && m_part != NoPart && (diff.needsPaintInvalidation() || diff.needsLayout()))
- m_scrollbar->theme()->invalidatePart(m_scrollbar, m_part);
+ if (oldStyle && (diff.needsPaintInvalidation() || diff.needsLayout()))
+ setNeedsPaintInvalidation();
}
void LayoutScrollbarPart::imageChanged(WrappedImagePtr image, const IntRect* rect)
{
- if (m_scrollbar && m_part != NoPart) {
- m_scrollbar->theme()->invalidatePart(m_scrollbar, m_part);
- } else {
- if (FrameView* frameView = view()->frameView()) {
- if (frameView->isFrameViewScrollCorner(this)) {
- frameView->invalidateScrollCorner(frameView->scrollCornerRect());
- return;
- }
- }
-
- LayoutBlock::imageChanged(image, rect);
- }
+ setNeedsPaintInvalidation();
+ LayoutBlock::imageChanged(image, rect);
}
LayoutObject* LayoutScrollbarPart::layoutObjectOwningScrollbar() const
@@ -204,4 +195,24 @@ LayoutObject* LayoutScrollbarPart::layoutObjectOwningScrollbar() const
return (!m_scrollbar) ? nullptr : m_scrollbar->owningLayoutObject();
}
+void LayoutScrollbarPart::setNeedsPaintInvalidation()
+{
+ if (m_scrollbar) {
+ m_scrollbar->setNeedsPaintInvalidation();
+ return;
+ }
+
+ // This LayoutScrollbarPart is a scroll corner or a resizer.
+ ASSERT(m_part == NoPart);
+ if (FrameView* frameView = view()->frameView()) {
+ if (frameView->isFrameViewScrollCorner(this)) {
+ frameView->setScrollCornerNeedsPaintInvalidation();
+ return;
+ }
+ }
+
+ // This LayoutScrollbarPart belongs to a PaintLayerScrollableArea.
+ toLayoutBox(parent())->scrollableArea()->setScrollCornerNeedsPaintInvalidation();
+}
+
}
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutScrollbarPart.h ('k') | third_party/WebKit/Source/core/layout/LayoutTheme.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698