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

Side by Side Diff: third_party/WebKit/Source/core/editing/CaretDisplayItemClient.h

Issue 2698313003: Fix caret paint invalidation when moving between blocks (Closed)
Patch Set: - Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 } 84 }
85 void paintCaret(GraphicsContext&, 85 void paintCaret(GraphicsContext&,
86 const LayoutPoint& paintOffset, 86 const LayoutPoint& paintOffset,
87 DisplayItem::Type) const; 87 DisplayItem::Type) const;
88 88
89 // DisplayItemClient methods. 89 // DisplayItemClient methods.
90 LayoutRect visualRect() const final; 90 LayoutRect visualRect() const final;
91 String debugName() const final; 91 String debugName() const final;
92 92
93 private: 93 private:
94 void invalidatePaintInCurrentLayoutBlock(
95 const PaintInvalidatorContext&,
96 PaintInvalidationReason layoutBlockPaintInvalidationReason);
97
98 void invalidatePaintInPreviousLayoutBlock(
99 const PaintInvalidatorContext&,
100 PaintInvalidationReason layoutBlockPaintInvalidationReason);
101
94 // These are updated by updateStyleAndLayoutIfNeeded(). 102 // These are updated by updateStyleAndLayoutIfNeeded().
95 Color m_color; 103 Color m_color;
96 LayoutRect m_localRect; 104 LayoutRect m_localRect;
97 LayoutBlock* m_layoutBlock = nullptr; 105 LayoutBlock* m_layoutBlock = nullptr;
98 106
99 // This is set to the previous m_layoutBlock if m_layoutLayout will change 107 // This is set to the previous value of m_layoutBlock during
100 // during updateStyleAndLayoutIfNeeded() and can be used in 108 // updateStyleAndLayoutIfNeeded() and can be used in invalidatePaintIfNeeded()
101 // invalidatePaintIfNeeded() only. 109 // only.
102 const LayoutBlock* m_previousLayoutBlock = nullptr; 110 const LayoutBlock* m_previousLayoutBlock = nullptr;
103 111
104 // This is updated by invalidatePaintIfNeeded(). 112 // Visual rect of the caret in m_layoutBlock. This is updated by
113 // invalidatePaintIfNeeded().
105 LayoutRect m_visualRect; 114 LayoutRect m_visualRect;
106 115
116 // This is set to the previous value of m_visualRect during
117 // updateStyleAndLayoutIfNeeded() and can be used in invalidatePaintIfNeeded()
118 // only.
119 LayoutRect m_previousVisualRect;
120
107 bool m_needsPaintInvalidation = false; 121 bool m_needsPaintInvalidation = false;
108 }; 122 };
109 123
110 } // namespace blink 124 } // namespace blink
111 125
112 #endif // CaretDisplayItemClient_h 126 #endif // CaretDisplayItemClient_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698