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

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

Issue 2736213002: 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 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 97
98 void invalidatePaintInPreviousLayoutBlock( 98 void invalidatePaintInPreviousLayoutBlock(
99 const PaintInvalidatorContext&, 99 const PaintInvalidatorContext&,
100 PaintInvalidationReason layoutBlockPaintInvalidationReason); 100 PaintInvalidationReason layoutBlockPaintInvalidationReason);
101 101
102 // These are updated by updateStyleAndLayoutIfNeeded(). 102 // These are updated by updateStyleAndLayoutIfNeeded().
103 Color m_color; 103 Color m_color;
104 LayoutRect m_localRect; 104 LayoutRect m_localRect;
105 LayoutBlock* m_layoutBlock = nullptr; 105 LayoutBlock* m_layoutBlock = nullptr;
106 106
107 // This is set to the previous value of m_layoutBlock during
108 // updateStyleAndLayoutIfNeeded() and can be used in invalidatePaintIfNeeded()
109 // only.
110 const LayoutBlock* m_previousLayoutBlock = nullptr;
111
112 // Visual rect of the caret in m_layoutBlock. This is updated by 107 // Visual rect of the caret in m_layoutBlock. This is updated by
113 // invalidatePaintIfNeeded(). 108 // invalidatePaintIfNeeded().
114 LayoutRect m_visualRect; 109 LayoutRect m_visualRect;
115 110
116 // This is set to the previous value of m_visualRect during 111 // These are set to the previous value of m_layoutBlock and m_visualRect
117 // updateStyleAndLayoutIfNeeded() and can be used in invalidatePaintIfNeeded() 112 // during updateStyleAndLayoutIfNeeded() if they haven't been set since the
118 // only. 113 // last paint invalidation. They can only be used in invalidatePaintIfNeeded()
119 LayoutRect m_previousVisualRect; 114 // to invalidate the caret in the previous layout block.
115 const LayoutBlock* m_previousLayoutBlock = nullptr;
116 LayoutRect m_visualRectInPreviousLayoutBlock;
120 117
121 bool m_needsPaintInvalidation = false; 118 bool m_needsPaintInvalidation = false;
122 }; 119 };
123 120
124 } // namespace blink 121 } // namespace blink
125 122
126 #endif // CaretDisplayItemClient_h 123 #endif // CaretDisplayItemClient_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698