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

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

Issue 2208463003: First step of PaintInvalidator implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 4 years, 4 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
Index: third_party/WebKit/Source/core/paint/BlockFlowPaintInvalidator.cpp
diff --git a/third_party/WebKit/Source/core/paint/BlockFlowPaintInvalidator.cpp b/third_party/WebKit/Source/core/paint/BlockFlowPaintInvalidator.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..b70c1f566968085122d73d5d3d6684cd6fcc6ffc
--- /dev/null
+++ b/third_party/WebKit/Source/core/paint/BlockFlowPaintInvalidator.cpp
@@ -0,0 +1,30 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/paint/BlockFlowPaintInvalidator.h"
+
+#include "core/layout/LayoutBlockFlow.h"
+#include "core/paint/BoxPaintInvalidator.h"
+#include "core/paint/PaintInvalidator.h"
+
+namespace blink {
+
+PaintInvalidationReason BlockFlowPaintInvalidator::invalidatePaintIfNeeded()
+{
+ PaintInvalidationReason reason = BoxPaintInvalidator(m_blockFlow, m_context).invalidatePaintIfNeeded();
+
+ if (reason == PaintInvalidationNone || reason == PaintInvalidationDelayedFull)
+ return reason;
+
+ RootInlineBox* line = m_blockFlow.firstRootBox();
+ if (line && line->isFirstLineStyle()) {
+ // It's the RootInlineBox that paints the ::first-line background. Note that since it may be
+ // expensive to figure out if the first line is affected by any ::first-line selectors at all,
+ // we just invalidate it unconditionally which is typically cheaper.
+ m_blockFlow.invalidateDisplayItemClient(*line, reason);
+ }
+ return reason;
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698