| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 #include "platform/TraceEvent.h" | 80 #include "platform/TraceEvent.h" |
| 81 #include "platform/fonts/FontCache.h" | 81 #include "platform/fonts/FontCache.h" |
| 82 #include "platform/geometry/FloatRect.h" | 82 #include "platform/geometry/FloatRect.h" |
| 83 #include "platform/graphics/GraphicsContext.h" | 83 #include "platform/graphics/GraphicsContext.h" |
| 84 #include "platform/graphics/GraphicsContextStateSaver.h" | 84 #include "platform/graphics/GraphicsContextStateSaver.h" |
| 85 #include "platform/graphics/GraphicsLayer.h" | 85 #include "platform/graphics/GraphicsLayer.h" |
| 86 #include "platform/graphics/GraphicsLayerDebugInfo.h" | 86 #include "platform/graphics/GraphicsLayerDebugInfo.h" |
| 87 #include "platform/graphics/paint/DisplayItemList.h" | 87 #include "platform/graphics/paint/DisplayItemList.h" |
| 88 #include "platform/scroll/ScrollAnimator.h" | 88 #include "platform/scroll/ScrollAnimator.h" |
| 89 #include "platform/text/TextStream.h" | 89 #include "platform/text/TextStream.h" |
| 90 #include "public/platform/Platform.h" |
| 90 #include "wtf/CurrentTime.h" | 91 #include "wtf/CurrentTime.h" |
| 91 #include "wtf/StdLibExtras.h" | 92 #include "wtf/StdLibExtras.h" |
| 92 #include "wtf/TemporaryChange.h" | 93 #include "wtf/TemporaryChange.h" |
| 93 | 94 |
| 94 namespace blink { | 95 namespace blink { |
| 95 | 96 |
| 96 using namespace HTMLNames; | 97 using namespace HTMLNames; |
| 97 | 98 |
| 98 double FrameView::s_currentFrameTimeStamp = 0.0; | 99 double FrameView::s_currentFrameTimeStamp = 0.0; |
| 99 | 100 |
| (...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 828 document->evaluateMediaQueryList(); | 829 document->evaluateMediaQueryList(); |
| 829 } | 830 } |
| 830 | 831 |
| 831 document->updateRenderTreeIfNeeded(); | 832 document->updateRenderTreeIfNeeded(); |
| 832 lifecycle().advanceTo(DocumentLifecycle::StyleClean); | 833 lifecycle().advanceTo(DocumentLifecycle::StyleClean); |
| 833 } | 834 } |
| 834 | 835 |
| 835 void FrameView::performLayout(RenderObject* rootForThisLayout, bool inSubtreeLay
out) | 836 void FrameView::performLayout(RenderObject* rootForThisLayout, bool inSubtreeLay
out) |
| 836 { | 837 { |
| 837 TRACE_EVENT0("blink,benchmark", "FrameView::performLayout"); | 838 TRACE_EVENT0("blink,benchmark", "FrameView::performLayout"); |
| 839 double start = WTF::currentTimeMS(); |
| 838 | 840 |
| 839 ScriptForbiddenScope forbidScript; | 841 ScriptForbiddenScope forbidScript; |
| 840 | 842 |
| 841 ASSERT(!isInPerformLayout()); | 843 ASSERT(!isInPerformLayout()); |
| 842 lifecycle().advanceTo(DocumentLifecycle::InPerformLayout); | 844 lifecycle().advanceTo(DocumentLifecycle::InPerformLayout); |
| 843 | 845 |
| 844 TemporaryChange<bool> changeInPerformLayout(m_inPerformLayout, true); | 846 TemporaryChange<bool> changeInPerformLayout(m_inPerformLayout, true); |
| 845 | 847 |
| 846 // performLayout is the actual guts of layout(). | 848 // performLayout is the actual guts of layout(). |
| 847 // FIXME: The 300 other lines in layout() probably belong in other helper fu
nctions | 849 // FIXME: The 300 other lines in layout() probably belong in other helper fu
nctions |
| 848 // so that a single human could understand what layout() is actually doing. | 850 // so that a single human could understand what layout() is actually doing. |
| 849 | 851 |
| 850 LayoutState layoutState(*rootForThisLayout); | 852 LayoutState layoutState(*rootForThisLayout); |
| 851 | 853 |
| 852 forceLayoutParentViewIfNeeded(); | 854 forceLayoutParentViewIfNeeded(); |
| 853 | 855 |
| 854 // FIXME (crbug.com/256657): Do not do two layouts for text autosizing. | 856 // FIXME (crbug.com/256657): Do not do two layouts for text autosizing. |
| 855 rootForThisLayout->layout(); | 857 rootForThisLayout->layout(); |
| 856 gatherDebugLayoutRects(rootForThisLayout); | 858 gatherDebugLayoutRects(rootForThisLayout); |
| 857 | 859 |
| 858 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->updateAllIma
geResourcePriorities(); | 860 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->updateAllIma
geResourcePriorities(); |
| 859 | 861 |
| 860 lifecycle().advanceTo(DocumentLifecycle::AfterPerformLayout); | 862 lifecycle().advanceTo(DocumentLifecycle::AfterPerformLayout); |
| 863 int layoutMs = (WTF::currentTimeMS() - start); |
| 864 Platform::current()->histogramCustomCounts("Renderer.LayoutMs", layoutMs, 0,
1000 * 60, 50); |
| 861 } | 865 } |
| 862 | 866 |
| 863 void FrameView::scheduleOrPerformPostLayoutTasks() | 867 void FrameView::scheduleOrPerformPostLayoutTasks() |
| 864 { | 868 { |
| 865 if (m_postLayoutTasksTimer.isActive()) | 869 if (m_postLayoutTasksTimer.isActive()) |
| 866 return; | 870 return; |
| 867 | 871 |
| 868 if (!m_inSynchronousPostLayout) { | 872 if (!m_inSynchronousPostLayout) { |
| 869 m_inSynchronousPostLayout = true; | 873 m_inSynchronousPostLayout = true; |
| 870 // Calls resumeScheduledEvents() | 874 // Calls resumeScheduledEvents() |
| (...skipping 3167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4038 { | 4042 { |
| 4039 Settings* settings = frame().settings(); | 4043 Settings* settings = frame().settings(); |
| 4040 if (!settings || !settings->rootLayerScrolls()) | 4044 if (!settings || !settings->rootLayerScrolls()) |
| 4041 return this; | 4045 return this; |
| 4042 | 4046 |
| 4043 RenderView* renderView = this->renderView(); | 4047 RenderView* renderView = this->renderView(); |
| 4044 return renderView ? renderView->scrollableArea() : nullptr; | 4048 return renderView ? renderView->scrollableArea() : nullptr; |
| 4045 } | 4049 } |
| 4046 | 4050 |
| 4047 } // namespace blink | 4051 } // namespace blink |
| OLD | NEW |