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

Side by Side Diff: Source/core/frame/FrameView.cpp

Issue 1329553004: Add a FOUC painting test. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Clean up. Created 5 years, 3 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 | Annotate | Revision Log
OLDNEW
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
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
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_trackedPaintInvalidationRects.clear(); 212 m_trackedPaintInvalidationRects.clear();
211 m_lastPaintTime = 0; 213 m_lastPaintTime = 0;
212 m_isPainting = false; 214 m_isPainting = false;
213 m_visuallyNonEmptyCharacterCount = 0; 215 m_visuallyNonEmptyCharacterCount = 0;
214 m_visuallyNonEmptyPixelCount = 0; 216 m_visuallyNonEmptyPixelCount = 0;
215 m_isVisuallyNonEmpty = false; 217 m_isVisuallyNonEmpty = false;
216 clearScrollAnchor(); 218 clearScrollAnchor();
217 m_viewportConstrainedObjects.clear(); 219 m_viewportConstrainedObjects.clear();
218 m_layoutSubtreeRootList.clear(); 220 m_layoutSubtreeRootList.clear();
219 } 221 }
(...skipping 1427 matching lines...) Expand 10 before | Expand all | Expand 10 after
1647 Page* page = frame().page(); 1649 Page* page = frame().page();
1648 if (!page) 1650 if (!page)
1649 return nullptr; 1651 return nullptr;
1650 return &page->chromeClient(); 1652 return &page->chromeClient();
1651 } 1653 }
1652 1654
1653 void FrameView::contentRectangleForPaintInvalidation(const IntRect& rectInConten t) 1655 void FrameView::contentRectangleForPaintInvalidation(const IntRect& rectInConten t)
1654 { 1656 {
1655 ASSERT(!m_frame->ownerLayoutObject()); 1657 ASSERT(!m_frame->ownerLayoutObject());
1656 1658
1657 if (m_isTrackingPaintInvalidations) {
1658 m_trackedPaintInvalidationRects.append(contentsToFrame(rectInContent));
1659 // FIXME: http://crbug.com/368518. Eventually, invalidateContentRectangl eForPaint
1660 // is going away entirely once all layout tests are FCM. In the short
1661 // term, no code should be tracking non-composited FrameView paint inval idations.
1662 RELEASE_ASSERT_NOT_REACHED();
1663 }
1664
1665 IntRect paintRect = rectInContent; 1659 IntRect paintRect = rectInContent;
1666 if (clipsPaintInvalidations()) 1660 if (clipsPaintInvalidations())
1667 paintRect.intersect(visibleContentRect()); 1661 paintRect.intersect(visibleContentRect());
1668 if (paintRect.isEmpty()) 1662 if (paintRect.isEmpty())
1669 return; 1663 return;
1670 1664
1671 if (HostWindow* window = hostWindow()) 1665 if (HostWindow* window = hostWindow())
1672 window->invalidateRect(contentsToRootFrame(paintRect)); 1666 window->invalidateRect(contentsToRootFrame(paintRect));
1673 } 1667 }
1674 1668
(...skipping 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after
2816 IntPoint point = parentView->convertToLayoutObject(*layoutObject, parent Point); 2810 IntPoint point = parentView->convertToLayoutObject(*layoutObject, parent Point);
2817 // Subtract borders and padding 2811 // Subtract borders and padding
2818 point.move(-layoutObject->borderLeft() - layoutObject->paddingLeft(), 2812 point.move(-layoutObject->borderLeft() - layoutObject->paddingLeft(),
2819 -layoutObject->borderTop() - layoutObject->paddingTop()); 2813 -layoutObject->borderTop() - layoutObject->paddingTop());
2820 return point; 2814 return point;
2821 } 2815 }
2822 2816
2823 return parentPoint; 2817 return parentPoint;
2824 } 2818 }
2825 2819
2820 void FrameView::setInitialTracksPaintInvalidationsForUnitTestsOnly(bool trackPai ntInvalidations)
2821 {
2822 s_initialTrackAllPaintInvalidations = trackPaintInvalidations;
2823 }
2824
2826 void FrameView::setTracksPaintInvalidations(bool trackPaintInvalidations) 2825 void FrameView::setTracksPaintInvalidations(bool trackPaintInvalidations)
2827 { 2826 {
2828 if (trackPaintInvalidations == m_isTrackingPaintInvalidations) 2827 if (trackPaintInvalidations == m_isTrackingPaintInvalidations)
2829 return; 2828 return;
2830 2829
2831 for (Frame* frame = m_frame->tree().top(); frame; frame = frame->tree().trav erseNext()) { 2830 for (Frame* frame = m_frame->tree().top(); frame; frame = frame->tree().trav erseNext()) {
2832 if (!frame->isLocalFrame()) 2831 if (!frame->isLocalFrame())
2833 continue; 2832 continue;
2834 if (LayoutView* layoutView = toLocalFrame(frame)->contentLayoutObject()) 2833 if (LayoutView* layoutView = toLocalFrame(frame)->contentLayoutObject())
2835 layoutView->compositor()->setTracksPaintInvalidations(trackPaintInva lidations); 2834 layoutView->compositor()->setTracksPaintInvalidations(trackPaintInva lidations);
(...skipping 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after
3971 3970
3972 if (!graphicsLayer) 3971 if (!graphicsLayer)
3973 return; 3972 return;
3974 3973
3975 DeprecatedPaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentL ayoutObject(), paintInvalidationContainer, viewRect); 3974 DeprecatedPaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentL ayoutObject(), paintInvalidationContainer, viewRect);
3976 3975
3977 graphicsLayerTimingRequests.add(graphicsLayer, Vector<std::pair<int64_t, Web Rect>>()).storedValue->value.append(std::make_pair(m_frame->frameID(), enclosing IntRect(viewRect))); 3976 graphicsLayerTimingRequests.add(graphicsLayer, Vector<std::pair<int64_t, Web Rect>>()).storedValue->value.append(std::make_pair(m_frame->frameID(), enclosing IntRect(viewRect)));
3978 } 3977 }
3979 3978
3980 } // namespace blink 3979 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698