| OLD | NEW |
| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 m_visualRect = LayoutRect(); | 62 m_visualRect = LayoutRect(); |
| 63 } | 63 } |
| 64 | 64 |
| 65 void layoutBlockWillBeDestroyed(const LayoutBlock& block) { | 65 void layoutBlockWillBeDestroyed(const LayoutBlock& block) { |
| 66 if (!shouldPaintCaret(block)) | 66 if (!shouldPaintCaret(block)) |
| 67 return; | 67 return; |
| 68 m_visualRect = LayoutRect(); | 68 m_visualRect = LayoutRect(); |
| 69 m_layoutBlock = nullptr; | 69 m_layoutBlock = nullptr; |
| 70 } | 70 } |
| 71 | 71 |
| 72 // Called when a FrameView finishes layout. Updates style and geometry of the | 72 // Called before a FrameView starts paint invalidation. Updates style and |
| 73 // caret for paint invalidation and painting. | 73 // geometry of the caret for paint invalidation and painting. |
| 74 void updateStyleAndLayoutIfNeeded(const PositionWithAffinity& caretPosition); | 74 void updateForPaintInvalidation(const PositionWithAffinity& caretPosition); |
| 75 | 75 |
| 76 // Called during LayoutBlock paint invalidation. | 76 // Called during LayoutBlock paint invalidation. |
| 77 void invalidatePaintIfNeeded( | 77 void invalidatePaintIfNeeded( |
| 78 const LayoutBlock&, | 78 const LayoutBlock&, |
| 79 const PaintInvalidatorContext&, | 79 const PaintInvalidatorContext&, |
| 80 PaintInvalidationReason layoutBlockPaintInvalidationReason); | 80 PaintInvalidationReason layoutBlockPaintInvalidationReason); |
| 81 | 81 |
| 82 bool shouldPaintCaret(const LayoutBlock& block) const { | 82 bool shouldPaintCaret(const LayoutBlock& block) const { |
| 83 return &block == m_layoutBlock; | 83 return &block == m_layoutBlock; |
| 84 } | 84 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 // updateStyleAndLayoutIfNeeded() and can be used in invalidatePaintIfNeeded() | 117 // updateStyleAndLayoutIfNeeded() and can be used in invalidatePaintIfNeeded() |
| 118 // only. | 118 // only. |
| 119 LayoutRect m_previousVisualRect; | 119 LayoutRect m_previousVisualRect; |
| 120 | 120 |
| 121 bool m_needsPaintInvalidation = false; | 121 bool m_needsPaintInvalidation = false; |
| 122 }; | 122 }; |
| 123 | 123 |
| 124 } // namespace blink | 124 } // namespace blink |
| 125 | 125 |
| 126 #endif // CaretDisplayItemClient_h | 126 #endif // CaretDisplayItemClient_h |
| OLD | NEW |