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

Unified Diff: third_party/WebKit/Source/core/editing/CaretDisplayItemClient.h

Issue 2745793002: Fix caret paint invalidation issues (Closed)
Patch Set: Created 3 years, 9 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/editing/CaretDisplayItemClient.h
diff --git a/third_party/WebKit/Source/core/editing/CaretDisplayItemClient.h b/third_party/WebKit/Source/core/editing/CaretDisplayItemClient.h
index 576381e0f7a23dae49da8521e18c93c24bd8a043..742a3c453cdbd002185f2a691a8d152fd35eb026 100644
--- a/third_party/WebKit/Source/core/editing/CaretDisplayItemClient.h
+++ b/third_party/WebKit/Source/core/editing/CaretDisplayItemClient.h
@@ -74,10 +74,8 @@ class CaretDisplayItemClient final : public DisplayItemClient {
void updateStyleAndLayoutIfNeeded(const PositionWithAffinity& caretPosition);
// Called during LayoutBlock paint invalidation.
- void invalidatePaintIfNeeded(
- const LayoutBlock&,
- const PaintInvalidatorContext&,
- PaintInvalidationReason layoutBlockPaintInvalidationReason);
+ void invalidatePaintIfNeeded(const LayoutBlock&,
+ const PaintInvalidatorContext&);
bool shouldPaintCaret(const LayoutBlock& block) const {
return &block == m_layoutBlock;
@@ -91,32 +89,25 @@ class CaretDisplayItemClient final : public DisplayItemClient {
String debugName() const final;
private:
- void invalidatePaintInCurrentLayoutBlock(
- const PaintInvalidatorContext&,
- PaintInvalidationReason layoutBlockPaintInvalidationReason);
+ void invalidatePaintInCurrentLayoutBlock(const PaintInvalidatorContext&);
- void invalidatePaintInPreviousLayoutBlock(
- const PaintInvalidatorContext&,
- PaintInvalidationReason layoutBlockPaintInvalidationReason);
+ void invalidatePaintInPreviousLayoutBlock(const PaintInvalidatorContext&);
// These are updated by updateStyleAndLayoutIfNeeded().
Color m_color;
LayoutRect m_localRect;
LayoutBlock* m_layoutBlock = nullptr;
- // This is set to the previous value of m_layoutBlock during
- // updateStyleAndLayoutIfNeeded() and can be used in invalidatePaintIfNeeded()
- // only.
- const LayoutBlock* m_previousLayoutBlock = nullptr;
-
// Visual rect of the caret in m_layoutBlock. This is updated by
// invalidatePaintIfNeeded().
LayoutRect m_visualRect;
- // This is set to the previous value of m_visualRect during
- // updateStyleAndLayoutIfNeeded() and can be used in invalidatePaintIfNeeded()
- // only.
- LayoutRect m_previousVisualRect;
+ // These are set to the previous value of m_layoutBlock and m_visualRect
+ // during updateStyleAndLayoutIfNeeded() if they haven't been set since the
+ // last paint invalidation. They can only be used in invalidatePaintIfNeeded()
+ // to invalidate the caret in the previous layout block.
+ const LayoutBlock* m_previousLayoutBlock = nullptr;
+ LayoutRect m_visualRectInPreviousLayoutBlock;
bool m_needsPaintInvalidation = false;
};

Powered by Google App Engine
This is Rietveld 408576698