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

Side by Side Diff: sky/engine/core/editing/FrameSelection.h

Issue 845093002: Delete an assortment of unneeded paint invalidation code. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « sky/engine/core/editing/Caret.cpp ('k') | sky/engine/core/editing/FrameSelection.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 160
161 PassRefPtr<Range> toNormalizedRange() const { return m_selection.toNormalize dRange(); } 161 PassRefPtr<Range> toNormalizedRange() const { return m_selection.toNormalize dRange(); }
162 162
163 void nodeWillBeRemoved(Node&); 163 void nodeWillBeRemoved(Node&);
164 void didUpdateCharacterData(CharacterData*, unsigned offset, unsigned oldLen gth, unsigned newLength); 164 void didUpdateCharacterData(CharacterData*, unsigned offset, unsigned oldLen gth, unsigned newLength);
165 void didMergeTextNodes(const Text& oldNode, unsigned offset); 165 void didMergeTextNodes(const Text& oldNode, unsigned offset);
166 void didSplitTextNode(const Text& oldNode); 166 void didSplitTextNode(const Text& oldNode);
167 167
168 void updateAppearance(ResetCaretBlinkOption = None); 168 void updateAppearance(ResetCaretBlinkOption = None);
169 void setCaretVisible(bool caretIsVisible) { setCaretVisibility(caretIsVisibl e ? Visible : Hidden); } 169 void setCaretVisible(bool caretIsVisible) { setCaretVisibility(caretIsVisibl e ? Visible : Hidden); }
170 bool isCaretBoundsDirty() const { return m_caretRectDirty; }
171 void setCaretRectNeedsUpdate(); 170 void setCaretRectNeedsUpdate();
172 void scheduleVisualUpdate() const; 171 void scheduleVisualUpdate() const;
173 void invalidateCaretRect();
174 void paintCaret(GraphicsContext*, const LayoutPoint&, const LayoutRect& clip Rect); 172 void paintCaret(GraphicsContext*, const LayoutPoint&, const LayoutRect& clip Rect);
175 bool ShouldPaintCaretForTesting() const { return m_shouldPaintCaret; } 173 bool ShouldPaintCaretForTesting() const { return m_shouldPaintCaret; }
176 174
177 // Used to suspend caret blinking while the mouse is down. 175 // Used to suspend caret blinking while the mouse is down.
178 void setCaretBlinkingSuspended(bool suspended) { m_isCaretBlinkingSuspended = suspended; } 176 void setCaretBlinkingSuspended(bool suspended) { m_isCaretBlinkingSuspended = suspended; }
179 bool isCaretBlinkingSuspended() const { return m_isCaretBlinkingSuspended; } 177 bool isCaretBlinkingSuspended() const { return m_isCaretBlinkingSuspended; }
180 178
181 // Focus 179 // Focus
182 void setFocused(bool); 180 void setFocused(bool);
183 bool isFocused() const { return m_focused; } 181 bool isFocused() const { return m_focused; }
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 VisibleSelection m_selection; 259 VisibleSelection m_selection;
262 bool m_observingVisibleSelection; 260 bool m_observingVisibleSelection;
263 VisiblePosition m_originalBase; // Used to store base before the adjustment at bidi boundary 261 VisiblePosition m_originalBase; // Used to store base before the adjustment at bidi boundary
264 TextGranularity m_granularity; 262 TextGranularity m_granularity;
265 263
266 // The range specified by the user, which may not be visually canonicalized (hence "logical"). 264 // The range specified by the user, which may not be visually canonicalized (hence "logical").
267 // This will be invalidated if the underlying VisibleSelection changes. If t hat happens, this variable will 265 // This will be invalidated if the underlying VisibleSelection changes. If t hat happens, this variable will
268 // become null, in which case logical positions == visible positions. 266 // become null, in which case logical positions == visible positions.
269 RefPtr<Range> m_logicalRange; 267 RefPtr<Range> m_logicalRange;
270 268
271 RefPtr<Node> m_previousCaretNode; // The last node which painted the caret. Retained for clearing the old caret when it moves.
272 LayoutRect m_previousCaretRect;
273
274 RefPtr<EditingStyle> m_typingStyle; 269 RefPtr<EditingStyle> m_typingStyle;
275 270
276 Timer<FrameSelection> m_caretBlinkTimer; 271 Timer<FrameSelection> m_caretBlinkTimer;
277 272
278 bool m_caretRectDirty : 1;
279 bool m_shouldPaintCaret : 1; 273 bool m_shouldPaintCaret : 1;
280 bool m_isCaretBlinkingSuspended : 1; 274 bool m_isCaretBlinkingSuspended : 1;
281 bool m_focused : 1; 275 bool m_focused : 1;
282 bool m_shouldShowBlockCursor : 1; 276 bool m_shouldShowBlockCursor : 1;
283 }; 277 };
284 278
285 inline EditingStyle* FrameSelection::typingStyle() const 279 inline EditingStyle* FrameSelection::typingStyle() const
286 { 280 {
287 return m_typingStyle.get(); 281 return m_typingStyle.get();
288 } 282 }
289 283
290 inline void FrameSelection::clearTypingStyle() 284 inline void FrameSelection::clearTypingStyle()
291 { 285 {
292 m_typingStyle.clear(); 286 m_typingStyle.clear();
293 } 287 }
294 288
295 inline void FrameSelection::setTypingStyle(PassRefPtr<EditingStyle> style) 289 inline void FrameSelection::setTypingStyle(PassRefPtr<EditingStyle> style)
296 { 290 {
297 m_typingStyle = style; 291 m_typingStyle = style;
298 } 292 }
299 } // namespace blink 293 } // namespace blink
300 294
301 #ifndef NDEBUG 295 #ifndef NDEBUG
302 // Outside the WebCore namespace for ease of invocation from gdb. 296 // Outside the WebCore namespace for ease of invocation from gdb.
303 void showTree(const blink::FrameSelection&); 297 void showTree(const blink::FrameSelection&);
304 void showTree(const blink::FrameSelection*); 298 void showTree(const blink::FrameSelection*);
305 #endif 299 #endif
306 300
307 #endif // SKY_ENGINE_CORE_EDITING_FRAMESELECTION_H_ 301 #endif // SKY_ENGINE_CORE_EDITING_FRAMESELECTION_H_
OLDNEW
« no previous file with comments | « sky/engine/core/editing/Caret.cpp ('k') | sky/engine/core/editing/FrameSelection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698