| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 m_inSynchronousPostLayout = false; | 119 m_inSynchronousPostLayout = false; |
| 120 m_layoutCount = 0; | 120 m_layoutCount = 0; |
| 121 m_nestedLayoutCount = 0; | 121 m_nestedLayoutCount = 0; |
| 122 m_postLayoutTasksTimer.stop(); | 122 m_postLayoutTasksTimer.stop(); |
| 123 m_firstLayout = true; | 123 m_firstLayout = true; |
| 124 m_firstLayoutCallbackPending = false; | 124 m_firstLayoutCallbackPending = false; |
| 125 m_lastViewportSize = IntSize(); | 125 m_lastViewportSize = IntSize(); |
| 126 m_isTrackingPaintInvalidations = false; | 126 m_isTrackingPaintInvalidations = false; |
| 127 m_trackedPaintInvalidationRects.clear(); | 127 m_trackedPaintInvalidationRects.clear(); |
| 128 m_lastPaintTime = 0; | 128 m_lastPaintTime = 0; |
| 129 m_paintBehavior = PaintBehaviorNormal; | |
| 130 m_isPainting = false; | 129 m_isPainting = false; |
| 131 } | 130 } |
| 132 | 131 |
| 133 void FrameView::init() | 132 void FrameView::init() |
| 134 { | 133 { |
| 135 reset(); | 134 reset(); |
| 136 | 135 |
| 137 m_size = LayoutSize(); | 136 m_size = LayoutSize(); |
| 138 } | 137 } |
| 139 | 138 |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 805 RELEASE_ASSERT(!needsLayout()); | 804 RELEASE_ASSERT(!needsLayout()); |
| 806 ASSERT(document->lifecycle().state() >= DocumentLifecycle::PaintInvalidation
Clean); | 805 ASSERT(document->lifecycle().state() >= DocumentLifecycle::PaintInvalidation
Clean); |
| 807 | 806 |
| 808 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Paint", "data"
, InspectorPaintEvent::data(renderView, rect)); | 807 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Paint", "data"
, InspectorPaintEvent::data(renderView, rect)); |
| 809 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), "
CallStack", TRACE_EVENT_SCOPE_PROCESS, "stack", InspectorCallStackEvent::current
CallStack()); | 808 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), "
CallStack", TRACE_EVENT_SCOPE_PROCESS, "stack", InspectorCallStackEvent::current
CallStack()); |
| 810 | 809 |
| 811 bool isTopLevelPainter = !s_inPaintContents; | 810 bool isTopLevelPainter = !s_inPaintContents; |
| 812 s_inPaintContents = true; | 811 s_inPaintContents = true; |
| 813 | 812 |
| 814 FontCachePurgePreventer fontCachePurgePreventer; | 813 FontCachePurgePreventer fontCachePurgePreventer; |
| 815 | 814 document->markers().invalidateRenderedRectsForMarkersInRect(rect); |
| 816 PaintBehavior oldPaintBehavior = m_paintBehavior; // FIXME(sky): is this nee
ded? | |
| 817 | |
| 818 if (m_paintBehavior == PaintBehaviorNormal) | |
| 819 document->markers().invalidateRenderedRectsForMarkersInRect(rect); | |
| 820 | 815 |
| 821 ASSERT(!m_isPainting); | 816 ASSERT(!m_isPainting); |
| 822 m_isPainting = true; | 817 m_isPainting = true; |
| 823 | 818 |
| 824 // m_nodeToDraw is used to draw only one element (and its descendants) | 819 // m_nodeToDraw is used to draw only one element (and its descendants) |
| 825 RenderObject* renderer = m_nodeToDraw ? m_nodeToDraw->renderer() : 0; | 820 RenderObject* renderer = m_nodeToDraw ? m_nodeToDraw->renderer() : 0; |
| 826 RenderLayer* rootLayer = renderView->layer(); | 821 RenderLayer* rootLayer = renderView->layer(); |
| 827 | 822 |
| 828 #if ENABLE(ASSERT) | 823 #if ENABLE(ASSERT) |
| 829 renderView->assertSubtreeIsLaidOut(); | 824 renderView->assertSubtreeIsLaidOut(); |
| 830 RenderObject::SetLayoutNeededForbiddenScope forbidSetNeedsLayout(*rootLayer-
>renderer()); | 825 RenderObject::SetLayoutNeededForbiddenScope forbidSetNeedsLayout(*rootLayer-
>renderer()); |
| 831 #endif | 826 #endif |
| 832 | 827 |
| 833 rootLayer->paint(p, rect, m_paintBehavior, renderer); | 828 rootLayer->paint(p, rect, renderer); |
| 834 | 829 |
| 835 if (rootLayer->containsDirtyOverlayScrollbars()) | 830 if (rootLayer->containsDirtyOverlayScrollbars()) |
| 836 rootLayer->paintOverlayScrollbars(p, rect, m_paintBehavior, renderer); | 831 rootLayer->paintOverlayScrollbars(p, rect, renderer); |
| 837 | 832 |
| 838 m_isPainting = false; | 833 m_isPainting = false; |
| 839 | |
| 840 m_paintBehavior = oldPaintBehavior; | |
| 841 m_lastPaintTime = currentTime(); | 834 m_lastPaintTime = currentTime(); |
| 842 | 835 |
| 843 if (isTopLevelPainter) { | 836 if (isTopLevelPainter) { |
| 844 // Everything that happens after paintContents completions is considered | 837 // Everything that happens after paintContents completions is considered |
| 845 // to be part of the next frame. | 838 // to be part of the next frame. |
| 846 s_currentFrameTimeStamp = currentTime(); | 839 s_currentFrameTimeStamp = currentTime(); |
| 847 s_inPaintContents = false; | 840 s_inPaintContents = false; |
| 848 } | 841 } |
| 849 } | 842 } |
| 850 | 843 |
| 851 void FrameView::setPaintBehavior(PaintBehavior behavior) | |
| 852 { | |
| 853 m_paintBehavior = behavior; | |
| 854 } | |
| 855 | |
| 856 PaintBehavior FrameView::paintBehavior() const | |
| 857 { | |
| 858 return m_paintBehavior; | |
| 859 } | |
| 860 | |
| 861 bool FrameView::isPainting() const | 844 bool FrameView::isPainting() const |
| 862 { | 845 { |
| 863 return m_isPainting; | 846 return m_isPainting; |
| 864 } | 847 } |
| 865 | 848 |
| 866 void FrameView::setNodeToDraw(Node* node) | 849 void FrameView::setNodeToDraw(Node* node) |
| 867 { | 850 { |
| 868 m_nodeToDraw = node; | 851 m_nodeToDraw = node; |
| 869 } | 852 } |
| 870 | 853 |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1033 totalObjects = 0; | 1016 totalObjects = 0; |
| 1034 | 1017 |
| 1035 for (RenderObject* o = root; o; o = o->nextInPreOrder(root)) { | 1018 for (RenderObject* o = root; o; o = o->nextInPreOrder(root)) { |
| 1036 ++totalObjects; | 1019 ++totalObjects; |
| 1037 if (o->needsLayout()) | 1020 if (o->needsLayout()) |
| 1038 ++needsLayoutObjects; | 1021 ++needsLayoutObjects; |
| 1039 } | 1022 } |
| 1040 } | 1023 } |
| 1041 | 1024 |
| 1042 } // namespace blink | 1025 } // namespace blink |
| OLD | NEW |