OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
5 * 2000 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. |
10 * | 10 * |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 #include "wtf/TemporaryChange.h" | 101 #include "wtf/TemporaryChange.h" |
102 | 102 |
103 namespace blink { | 103 namespace blink { |
104 | 104 |
105 using namespace HTMLNames; | 105 using namespace HTMLNames; |
106 | 106 |
107 // The maximum number of updateWidgets iterations that should be done before ret
urning. | 107 // The maximum number of updateWidgets iterations that should be done before ret
urning. |
108 static const unsigned maxUpdateWidgetsIterations = 2; | 108 static const unsigned maxUpdateWidgetsIterations = 2; |
109 static const double resourcePriorityUpdateDelayAfterScroll = 0.250; | 109 static const double resourcePriorityUpdateDelayAfterScroll = 0.250; |
110 | 110 |
| 111 static bool s_initialTrackAllPaintInvalidations = false; |
| 112 |
111 FrameView::FrameView(LocalFrame* frame) | 113 FrameView::FrameView(LocalFrame* frame) |
112 : m_frame(frame) | 114 : m_frame(frame) |
113 , m_displayMode(WebDisplayModeBrowser) | 115 , m_displayMode(WebDisplayModeBrowser) |
114 , m_canHaveScrollbars(true) | 116 , m_canHaveScrollbars(true) |
115 , m_slowRepaintObjectCount(0) | 117 , m_slowRepaintObjectCount(0) |
116 , m_hasPendingLayout(false) | 118 , m_hasPendingLayout(false) |
117 , m_inSynchronousPostLayout(false) | 119 , m_inSynchronousPostLayout(false) |
118 , m_postLayoutTasksTimer(this, &FrameView::postLayoutTimerFired) | 120 , m_postLayoutTasksTimer(this, &FrameView::postLayoutTimerFired) |
119 , m_updateWidgetsTimer(this, &FrameView::updateWidgetsTimerFired) | 121 , m_updateWidgetsTimer(this, &FrameView::updateWidgetsTimerFired) |
120 , m_isTransparent(false) | 122 , m_isTransparent(false) |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 m_inPerformLayout = false; | 201 m_inPerformLayout = false; |
200 m_inSynchronousPostLayout = false; | 202 m_inSynchronousPostLayout = false; |
201 m_layoutCount = 0; | 203 m_layoutCount = 0; |
202 m_nestedLayoutCount = 0; | 204 m_nestedLayoutCount = 0; |
203 m_postLayoutTasksTimer.stop(); | 205 m_postLayoutTasksTimer.stop(); |
204 m_updateWidgetsTimer.stop(); | 206 m_updateWidgetsTimer.stop(); |
205 m_firstLayout = true; | 207 m_firstLayout = true; |
206 m_safeToPropagateScrollToParent = true; | 208 m_safeToPropagateScrollToParent = true; |
207 m_lastViewportSize = IntSize(); | 209 m_lastViewportSize = IntSize(); |
208 m_lastZoomFactor = 1.0f; | 210 m_lastZoomFactor = 1.0f; |
209 m_isTrackingPaintInvalidations = false; | 211 m_isTrackingPaintInvalidations = s_initialTrackAllPaintInvalidations; |
210 m_lastPaintTime = 0; | 212 m_lastPaintTime = 0; |
211 m_isPainting = false; | 213 m_isPainting = false; |
212 m_visuallyNonEmptyCharacterCount = 0; | 214 m_visuallyNonEmptyCharacterCount = 0; |
213 m_visuallyNonEmptyPixelCount = 0; | 215 m_visuallyNonEmptyPixelCount = 0; |
214 m_isVisuallyNonEmpty = false; | 216 m_isVisuallyNonEmpty = false; |
215 clearScrollAnchor(); | 217 clearScrollAnchor(); |
216 m_viewportConstrainedObjects.clear(); | 218 m_viewportConstrainedObjects.clear(); |
217 m_layoutSubtreeRootList.clear(); | 219 m_layoutSubtreeRootList.clear(); |
218 } | 220 } |
219 | 221 |
(...skipping 2579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2799 IntPoint point = parentView->convertToLayoutObject(*layoutObject, parent
Point); | 2801 IntPoint point = parentView->convertToLayoutObject(*layoutObject, parent
Point); |
2800 // Subtract borders and padding | 2802 // Subtract borders and padding |
2801 point.move(-layoutObject->borderLeft() - layoutObject->paddingLeft(), | 2803 point.move(-layoutObject->borderLeft() - layoutObject->paddingLeft(), |
2802 -layoutObject->borderTop() - layoutObject->paddingTop()); | 2804 -layoutObject->borderTop() - layoutObject->paddingTop()); |
2803 return point; | 2805 return point; |
2804 } | 2806 } |
2805 | 2807 |
2806 return parentPoint; | 2808 return parentPoint; |
2807 } | 2809 } |
2808 | 2810 |
| 2811 void FrameView::setInitialTracksPaintInvalidationsForTesting(bool trackPaintInva
lidations) |
| 2812 { |
| 2813 s_initialTrackAllPaintInvalidations = trackPaintInvalidations; |
| 2814 } |
| 2815 |
2809 void FrameView::setTracksPaintInvalidations(bool trackPaintInvalidations) | 2816 void FrameView::setTracksPaintInvalidations(bool trackPaintInvalidations) |
2810 { | 2817 { |
2811 if (trackPaintInvalidations == m_isTrackingPaintInvalidations) | 2818 if (trackPaintInvalidations == m_isTrackingPaintInvalidations) |
2812 return; | 2819 return; |
2813 | 2820 |
2814 for (Frame* frame = m_frame->tree().top(); frame; frame = frame->tree().trav
erseNext()) { | 2821 for (Frame* frame = m_frame->tree().top(); frame; frame = frame->tree().trav
erseNext()) { |
2815 if (!frame->isLocalFrame()) | 2822 if (!frame->isLocalFrame()) |
2816 continue; | 2823 continue; |
2817 if (LayoutView* layoutView = toLocalFrame(frame)->contentLayoutObject()) | 2824 if (LayoutView* layoutView = toLocalFrame(frame)->contentLayoutObject()) |
2818 layoutView->compositor()->setTracksPaintInvalidations(trackPaintInva
lidations); | 2825 layoutView->compositor()->setTracksPaintInvalidations(trackPaintInva
lidations); |
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3934 | 3941 |
3935 if (!graphicsLayer) | 3942 if (!graphicsLayer) |
3936 return; | 3943 return; |
3937 | 3944 |
3938 DeprecatedPaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentL
ayoutObject(), paintInvalidationContainer, viewRect); | 3945 DeprecatedPaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentL
ayoutObject(), paintInvalidationContainer, viewRect); |
3939 | 3946 |
3940 graphicsLayerTimingRequests.add(graphicsLayer, Vector<std::pair<int64_t, Web
Rect>>()).storedValue->value.append(std::make_pair(m_frame->frameID(), enclosing
IntRect(viewRect))); | 3947 graphicsLayerTimingRequests.add(graphicsLayer, Vector<std::pair<int64_t, Web
Rect>>()).storedValue->value.append(std::make_pair(m_frame->frameID(), enclosing
IntRect(viewRect))); |
3941 } | 3948 } |
3942 | 3949 |
3943 } // namespace blink | 3950 } // namespace blink |
OLD | NEW |