| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
| 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) |
| 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
reserved. | 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
reserved. |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 // FIXME: groupedMapping() leaks the squashing abstraction. See Rend
erBlockSelectionInfo for more details. | 74 // FIXME: groupedMapping() leaks the squashing abstraction. See Rend
erBlockSelectionInfo for more details. |
| 75 if (m_paintInvalidationContainer && m_paintInvalidationContainer->la
yer()->groupedMapping()) | 75 if (m_paintInvalidationContainer && m_paintInvalidationContainer->la
yer()->groupedMapping()) |
| 76 RenderLayer::mapRectToPaintInvalidationBacking(m_paintInvalidati
onContainer, m_paintInvalidationContainer, m_rect); | 76 RenderLayer::mapRectToPaintInvalidationBacking(m_paintInvalidati
onContainer, m_paintInvalidationContainer, m_rect); |
| 77 } else { | 77 } else { |
| 78 m_rect = LayoutRect(); | 78 m_rect = LayoutRect(); |
| 79 } | 79 } |
| 80 } | 80 } |
| 81 | 81 |
| 82 void invalidatePaint() | 82 void invalidatePaint() |
| 83 { | 83 { |
| 84 m_object->invalidatePaintUsingContainer(m_paintInvalidationContainer, m_
rect, InvalidationSelection); | 84 m_object->invalidatePaintUsingContainer(m_paintInvalidationContainer, en
closingIntRect(m_rect), InvalidationSelection); |
| 85 } | 85 } |
| 86 | 86 |
| 87 LayoutRect rect() const { return m_rect; } | 87 LayoutRect rect() const { return m_rect; } |
| 88 | 88 |
| 89 private: | 89 private: |
| 90 LayoutRect m_rect; // relative to paint invalidation container | 90 LayoutRect m_rect; // relative to paint invalidation container |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 | 93 |
| 94 // This struct is used when the selection changes to cache the old and new state
of the selection for each RenderBlock. | 94 // This struct is used when the selection changes to cache the old and new state
of the selection for each RenderBlock. |
| 95 class RenderBlockSelectionInfo FINAL : public RenderSelectionInfoBase { | 95 class RenderBlockSelectionInfo FINAL : public RenderSelectionInfoBase { |
| 96 public: | 96 public: |
| 97 RenderBlockSelectionInfo(RenderBlock* b) | 97 RenderBlockSelectionInfo(RenderBlock* b) |
| 98 : RenderSelectionInfoBase(b) | 98 : RenderSelectionInfoBase(b) |
| 99 { | 99 { |
| 100 if (b->canUpdateSelectionOnRootLineBoxes()) | 100 if (b->canUpdateSelectionOnRootLineBoxes()) |
| 101 m_rects = block()->selectionGapRectsForPaintInvalidation(m_paintInva
lidationContainer); | 101 m_rects = block()->selectionGapRectsForPaintInvalidation(m_paintInva
lidationContainer); |
| 102 else | 102 else |
| 103 m_rects = GapRects(); | 103 m_rects = GapRects(); |
| 104 } | 104 } |
| 105 | 105 |
| 106 void invalidatePaint() | 106 void invalidatePaint() |
| 107 { | 107 { |
| 108 LayoutRect paintInvalidationRect = m_rects; | 108 LayoutRect paintInvalidationRect = m_rects; |
| 109 // FIXME: this is leaking the squashing abstraction. However, removing t
he groupedMapping() condiitional causes | 109 // FIXME: this is leaking the squashing abstraction. However, removing t
he groupedMapping() condiitional causes |
| 110 // RenderBox::mapRectToPaintInvalidationBacking to get called, which mak
es rect adjustments even if you pass the same | 110 // RenderBox::mapRectToPaintInvalidationBacking to get called, which mak
es rect adjustments even if you pass the same |
| 111 // paintInvalidationContainer as the render object. Find out why it does
that and fix. | 111 // paintInvalidationContainer as the render object. Find out why it does
that and fix. |
| 112 if (m_paintInvalidationContainer && m_paintInvalidationContainer->layer(
)->groupedMapping()) | 112 if (m_paintInvalidationContainer && m_paintInvalidationContainer->layer(
)->groupedMapping()) |
| 113 RenderLayer::mapRectToPaintInvalidationBacking(m_paintInvalidationCo
ntainer, m_paintInvalidationContainer, paintInvalidationRect); | 113 RenderLayer::mapRectToPaintInvalidationBacking(m_paintInvalidationCo
ntainer, m_paintInvalidationContainer, paintInvalidationRect); |
| 114 m_object->invalidatePaintUsingContainer(m_paintInvalidationContainer, pa
intInvalidationRect, InvalidationSelection); | 114 m_object->invalidatePaintUsingContainer(m_paintInvalidationContainer, en
closingIntRect(paintInvalidationRect), InvalidationSelection); |
| 115 } | 115 } |
| 116 | 116 |
| 117 RenderBlock* block() const { return toRenderBlock(m_object); } | 117 RenderBlock* block() const { return toRenderBlock(m_object); } |
| 118 GapRects rects() const { return m_rects; } | 118 GapRects rects() const { return m_rects; } |
| 119 | 119 |
| 120 private: | 120 private: |
| 121 GapRects m_rects; // relative to paint invalidation container | 121 GapRects m_rects; // relative to paint invalidation container |
| 122 }; | 122 }; |
| 123 | 123 |
| 124 } // namespace blink | 124 } // namespace blink |
| 125 | 125 |
| 126 | 126 |
| 127 #endif // RenderSelectionInfo_h | 127 #endif // RenderSelectionInfo_h |
| OLD | NEW |