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 | |
113 FrameView::FrameView(LocalFrame* frame) | 111 FrameView::FrameView(LocalFrame* frame) |
114 : m_frame(frame) | 112 : m_frame(frame) |
115 , m_displayMode(WebDisplayModeBrowser) | 113 , m_displayMode(WebDisplayModeBrowser) |
116 , m_canHaveScrollbars(true) | 114 , m_canHaveScrollbars(true) |
117 , m_slowRepaintObjectCount(0) | 115 , m_slowRepaintObjectCount(0) |
118 , m_hasPendingLayout(false) | 116 , m_hasPendingLayout(false) |
119 , m_inSynchronousPostLayout(false) | 117 , m_inSynchronousPostLayout(false) |
120 , m_postLayoutTasksTimer(this, &FrameView::postLayoutTimerFired) | 118 , m_postLayoutTasksTimer(this, &FrameView::postLayoutTimerFired) |
121 , m_updateWidgetsTimer(this, &FrameView::updateWidgetsTimerFired) | 119 , m_updateWidgetsTimer(this, &FrameView::updateWidgetsTimerFired) |
122 , m_isTransparent(false) | 120 , m_isTransparent(false) |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 m_inPerformLayout = false; | 199 m_inPerformLayout = false; |
202 m_inSynchronousPostLayout = false; | 200 m_inSynchronousPostLayout = false; |
203 m_layoutCount = 0; | 201 m_layoutCount = 0; |
204 m_nestedLayoutCount = 0; | 202 m_nestedLayoutCount = 0; |
205 m_postLayoutTasksTimer.stop(); | 203 m_postLayoutTasksTimer.stop(); |
206 m_updateWidgetsTimer.stop(); | 204 m_updateWidgetsTimer.stop(); |
207 m_firstLayout = true; | 205 m_firstLayout = true; |
208 m_safeToPropagateScrollToParent = true; | 206 m_safeToPropagateScrollToParent = true; |
209 m_lastViewportSize = IntSize(); | 207 m_lastViewportSize = IntSize(); |
210 m_lastZoomFactor = 1.0f; | 208 m_lastZoomFactor = 1.0f; |
211 m_isTrackingPaintInvalidations = s_initialTrackAllPaintInvalidations; | 209 m_isTrackingPaintInvalidations = false; |
212 m_lastPaintTime = 0; | 210 m_lastPaintTime = 0; |
213 m_isPainting = false; | 211 m_isPainting = false; |
214 m_visuallyNonEmptyCharacterCount = 0; | 212 m_visuallyNonEmptyCharacterCount = 0; |
215 m_visuallyNonEmptyPixelCount = 0; | 213 m_visuallyNonEmptyPixelCount = 0; |
216 m_isVisuallyNonEmpty = false; | 214 m_isVisuallyNonEmpty = false; |
217 clearScrollAnchor(); | 215 clearScrollAnchor(); |
218 m_viewportConstrainedObjects.clear(); | 216 m_viewportConstrainedObjects.clear(); |
219 m_layoutSubtreeRootList.clear(); | 217 m_layoutSubtreeRootList.clear(); |
220 } | 218 } |
221 | 219 |
(...skipping 2579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2801 IntPoint point = parentView->convertToLayoutObject(*layoutObject, parent
Point); | 2799 IntPoint point = parentView->convertToLayoutObject(*layoutObject, parent
Point); |
2802 // Subtract borders and padding | 2800 // Subtract borders and padding |
2803 point.move(-layoutObject->borderLeft() - layoutObject->paddingLeft(), | 2801 point.move(-layoutObject->borderLeft() - layoutObject->paddingLeft(), |
2804 -layoutObject->borderTop() - layoutObject->paddingTop()); | 2802 -layoutObject->borderTop() - layoutObject->paddingTop()); |
2805 return point; | 2803 return point; |
2806 } | 2804 } |
2807 | 2805 |
2808 return parentPoint; | 2806 return parentPoint; |
2809 } | 2807 } |
2810 | 2808 |
2811 void FrameView::setInitialTracksPaintInvalidationsForTesting(bool trackPaintInva
lidations) | |
2812 { | |
2813 s_initialTrackAllPaintInvalidations = trackPaintInvalidations; | |
2814 } | |
2815 | |
2816 void FrameView::setTracksPaintInvalidations(bool trackPaintInvalidations) | 2809 void FrameView::setTracksPaintInvalidations(bool trackPaintInvalidations) |
2817 { | 2810 { |
2818 if (trackPaintInvalidations == m_isTrackingPaintInvalidations) | 2811 if (trackPaintInvalidations == m_isTrackingPaintInvalidations) |
2819 return; | 2812 return; |
2820 | 2813 |
2821 for (Frame* frame = m_frame->tree().top(); frame; frame = frame->tree().trav
erseNext()) { | 2814 for (Frame* frame = m_frame->tree().top(); frame; frame = frame->tree().trav
erseNext()) { |
2822 if (!frame->isLocalFrame()) | 2815 if (!frame->isLocalFrame()) |
2823 continue; | 2816 continue; |
2824 if (LayoutView* layoutView = toLocalFrame(frame)->contentLayoutObject()) | 2817 if (LayoutView* layoutView = toLocalFrame(frame)->contentLayoutObject()) |
2825 layoutView->compositor()->setTracksPaintInvalidations(trackPaintInva
lidations); | 2818 layoutView->compositor()->setTracksPaintInvalidations(trackPaintInva
lidations); |
(...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3948 | 3941 |
3949 if (!graphicsLayer) | 3942 if (!graphicsLayer) |
3950 return; | 3943 return; |
3951 | 3944 |
3952 DeprecatedPaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentL
ayoutObject(), paintInvalidationContainer, viewRect); | 3945 DeprecatedPaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentL
ayoutObject(), paintInvalidationContainer, viewRect); |
3953 | 3946 |
3954 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))); |
3955 } | 3948 } |
3956 | 3949 |
3957 } // namespace blink | 3950 } // namespace blink |
OLD | NEW |