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

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameView.h

Issue 2470793002: Revert of Use intersection observer to control frame throttling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 1 month 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
OLDNEW
1 /* 1 /*
2 Copyright (C) 1997 Martin Jones (mjones@kde.org) 2 Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 (C) 1998 Waldo Bastian (bastian@kde.org) 3 (C) 1998 Waldo Bastian (bastian@kde.org)
4 (C) 1998, 1999 Torben Weis (weis@kde.org) 4 (C) 1998, 1999 Torben Weis (weis@kde.org)
5 (C) 1999 Lars Knoll (knoll@kde.org) 5 (C) 1999 Lars Knoll (knoll@kde.org)
6 (C) 1999 Antti Koivisto (koivisto@kde.org) 6 (C) 1999 Antti Koivisto (koivisto@kde.org)
7 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights 7 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
8 reserved. 8 reserved.
9 9
10 This library is free software; you can redistribute it and/or 10 This library is free software; you can redistribute it and/or
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 #include <memory> 56 #include <memory>
57 57
58 namespace blink { 58 namespace blink {
59 59
60 class AXObjectCache; 60 class AXObjectCache;
61 class CancellableTaskFactory; 61 class CancellableTaskFactory;
62 class ComputedStyle; 62 class ComputedStyle;
63 class DocumentLifecycle; 63 class DocumentLifecycle;
64 class Cursor; 64 class Cursor;
65 class Element; 65 class Element;
66 class ElementVisibilityObserver;
67 class FloatSize; 66 class FloatSize;
68 class JSONArray; 67 class JSONArray;
69 class JSONObject; 68 class JSONObject;
70 class LayoutItem; 69 class LayoutItem;
71 class LayoutViewItem; 70 class LayoutViewItem;
72 class LayoutPart; 71 class LayoutPart;
73 class LocalFrame; 72 class LocalFrame;
74 class KURL; 73 class KURL;
75 class Node; 74 class Node;
76 class LayoutAnalyzer; 75 class LayoutAnalyzer;
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 668
670 LayoutAnalyzer* layoutAnalyzer() { return m_analyzer.get(); } 669 LayoutAnalyzer* layoutAnalyzer() { return m_analyzer.get(); }
671 670
672 // Returns true if this frame should not render or schedule visual updates. 671 // Returns true if this frame should not render or schedule visual updates.
673 bool shouldThrottleRendering() const; 672 bool shouldThrottleRendering() const;
674 673
675 // Returns true if this frame could potentially skip rendering and avoid 674 // Returns true if this frame could potentially skip rendering and avoid
676 // scheduling visual updates. 675 // scheduling visual updates.
677 bool canThrottleRendering() const; 676 bool canThrottleRendering() const;
678 bool isHiddenForThrottling() const { return m_hiddenForThrottling; } 677 bool isHiddenForThrottling() const { return m_hiddenForThrottling; }
679 void setupRenderThrottling();
680 678
681 // For testing, run pending intersection observer notifications for this 679 // For testing, run pending intersection observer notifications for this
682 // frame. 680 // frame.
683 void updateRenderThrottlingStatusForTesting(); 681 void notifyRenderThrottlingObserversForTesting();
684 682
685 // Paint properties for SPv2 Only. 683 // Paint properties for SPv2 Only.
686 void setPreTranslation( 684 void setPreTranslation(
687 PassRefPtr<TransformPaintPropertyNode> preTranslation) { 685 PassRefPtr<TransformPaintPropertyNode> preTranslation) {
688 m_preTranslation = preTranslation; 686 m_preTranslation = preTranslation;
689 } 687 }
690 TransformPaintPropertyNode* preTranslation() const { 688 TransformPaintPropertyNode* preTranslation() const {
691 return m_preTranslation.get(); 689 return m_preTranslation.get();
692 } 690 }
693 691
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
914 912
915 void collectAnnotatedRegions(LayoutObject&, 913 void collectAnnotatedRegions(LayoutObject&,
916 Vector<AnnotatedRegionValue>&) const; 914 Vector<AnnotatedRegionValue>&) const;
917 915
918 template <typename Function> 916 template <typename Function>
919 void forAllNonThrottledFrameViews(const Function&); 917 void forAllNonThrottledFrameViews(const Function&);
920 918
921 void setNeedsUpdateViewportIntersection(); 919 void setNeedsUpdateViewportIntersection();
922 void updateViewportIntersectionsForSubtree( 920 void updateViewportIntersectionsForSubtree(
923 DocumentLifecycle::LifecycleState targetState); 921 DocumentLifecycle::LifecycleState targetState);
924 void updateRenderThrottlingStatus(bool hidden, bool subtreeThrottled); 922 void updateViewportIntersectionIfNeeded();
923 void notifyRenderThrottlingObservers();
924 void updateThrottlingStatus();
925 void notifyResizeObservers(); 925 void notifyResizeObservers();
926 926
927 // PaintInvalidationCapableScrollableArea 927 // PaintInvalidationCapableScrollableArea
928 LayoutScrollbarPart* resizer() const override { return nullptr; } 928 LayoutScrollbarPart* resizer() const override { return nullptr; }
929 929
930 bool checkLayoutInvalidationIsAllowed() const; 930 bool checkLayoutInvalidationIsAllowed() const;
931 931
932 PaintController* paintController() { return m_paintController.get(); } 932 PaintController* paintController() { return m_paintController.get(); }
933 933
934 LayoutSize m_size; 934 LayoutSize m_size;
(...skipping 21 matching lines...) Expand all
956 bool m_hasPendingLayout; 956 bool m_hasPendingLayout;
957 LayoutSubtreeRootList m_layoutSubtreeRootList; 957 LayoutSubtreeRootList m_layoutSubtreeRootList;
958 DepthOrderedLayoutObjectList m_orthogonalWritingModeRootList; 958 DepthOrderedLayoutObjectList m_orthogonalWritingModeRootList;
959 959
960 bool m_layoutSchedulingEnabled; 960 bool m_layoutSchedulingEnabled;
961 bool m_inSynchronousPostLayout; 961 bool m_inSynchronousPostLayout;
962 int m_layoutCount; 962 int m_layoutCount;
963 unsigned m_nestedLayoutCount; 963 unsigned m_nestedLayoutCount;
964 Timer<FrameView> m_postLayoutTasksTimer; 964 Timer<FrameView> m_postLayoutTasksTimer;
965 Timer<FrameView> m_updateWidgetsTimer; 965 Timer<FrameView> m_updateWidgetsTimer;
966 std::unique_ptr<CancellableTaskFactory>
967 m_renderThrottlingObserverNotificationFactory;
966 968
967 bool m_firstLayout; 969 bool m_firstLayout;
968 bool m_isTransparent; 970 bool m_isTransparent;
969 Color m_baseBackgroundColor; 971 Color m_baseBackgroundColor;
970 IntSize m_lastViewportSize; 972 IntSize m_lastViewportSize;
971 float m_lastZoomFactor; 973 float m_lastZoomFactor;
972 974
973 AtomicString m_mediaType; 975 AtomicString m_mediaType;
974 AtomicString m_mediaTypeWhenNotPrinting; 976 AtomicString m_mediaTypeWhenNotPrinting;
975 977
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 1037
1036 // Mark if something has changed in the mapping from Frame to GraphicsLayer 1038 // Mark if something has changed in the mapping from Frame to GraphicsLayer
1037 // and the Frame Timing regions should be recalculated. 1039 // and the Frame Timing regions should be recalculated.
1038 bool m_frameTimingRequestsDirty; 1040 bool m_frameTimingRequestsDirty;
1039 1041
1040 // Exists only on root frame. 1042 // Exists only on root frame.
1041 // TODO(bokan): crbug.com/484188. We should specialize FrameView for the 1043 // TODO(bokan): crbug.com/484188. We should specialize FrameView for the
1042 // main frame. 1044 // main frame.
1043 Member<RootFrameViewport> m_viewportScrollableArea; 1045 Member<RootFrameViewport> m_viewportScrollableArea;
1044 1046
1047 // This frame's bounds in the root frame's content coordinates, clipped
1048 // recursively through every ancestor view.
1049 IntRect m_viewportIntersection;
1050 bool m_viewportIntersectionValid;
1051
1045 // The following members control rendering pipeline throttling for this 1052 // The following members control rendering pipeline throttling for this
1046 // frame. They are only updated in response to intersection observer 1053 // frame. They are only updated in response to intersection observer
1047 // notifications, i.e., not in the middle of the lifecycle. 1054 // notifications, i.e., not in the middle of the lifecycle.
1048 bool m_hiddenForThrottling; 1055 bool m_hiddenForThrottling;
1056 bool m_crossOriginForThrottling;
1049 bool m_subtreeThrottled; 1057 bool m_subtreeThrottled;
1050 1058
1051 // Paint properties for SPv2 Only. 1059 // Paint properties for SPv2 Only.
1052 // The hierarchy of transform subtree created by a FrameView. 1060 // The hierarchy of transform subtree created by a FrameView.
1053 // [ preTranslation ] The offset from Widget::frameRect. 1061 // [ preTranslation ] The offset from Widget::frameRect.
1054 // | Establishes viewport. 1062 // | Establishes viewport.
1055 // +---[ scrollTranslation ] Frame scrolling. 1063 // +---[ scrollTranslation ] Frame scrolling.
1056 // TODO(trchen): These will not be needed once settings->rootLayerScrolls() is 1064 // TODO(trchen): These will not be needed once settings->rootLayerScrolls() is
1057 // enabled. 1065 // enabled.
1058 RefPtr<TransformPaintPropertyNode> m_preTranslation; 1066 RefPtr<TransformPaintPropertyNode> m_preTranslation;
(...skipping 16 matching lines...) Expand all
1075 HeapLinkedHashSet<WeakMember<ScrollableArea>>; 1083 HeapLinkedHashSet<WeakMember<ScrollableArea>>;
1076 AnchoringAdjustmentQueue m_anchoringAdjustmentQueue; 1084 AnchoringAdjustmentQueue m_anchoringAdjustmentQueue;
1077 1085
1078 // ScrollbarManager holds the Scrollbar instances. 1086 // ScrollbarManager holds the Scrollbar instances.
1079 ScrollbarManager m_scrollbarManager; 1087 ScrollbarManager m_scrollbarManager;
1080 1088
1081 bool m_needsScrollbarsUpdate; 1089 bool m_needsScrollbarsUpdate;
1082 bool m_suppressAdjustViewSize; 1090 bool m_suppressAdjustViewSize;
1083 bool m_allowsLayoutInvalidationAfterLayoutClean; 1091 bool m_allowsLayoutInvalidationAfterLayoutClean;
1084 1092
1085 Member<ElementVisibilityObserver> m_visibilityObserver;
1086
1087 // For testing. 1093 // For testing.
1088 struct ObjectPaintInvalidation { 1094 struct ObjectPaintInvalidation {
1089 String name; 1095 String name;
1090 PaintInvalidationReason reason; 1096 PaintInvalidationReason reason;
1091 }; 1097 };
1092 std::unique_ptr<Vector<ObjectPaintInvalidation>> 1098 std::unique_ptr<Vector<ObjectPaintInvalidation>>
1093 m_trackedObjectPaintInvalidations; 1099 m_trackedObjectPaintInvalidations;
1094 1100
1095 // For Slimming Paint v2 only. 1101 // For Slimming Paint v2 only.
1096 std::unique_ptr<PaintController> m_paintController; 1102 std::unique_ptr<PaintController> m_paintController;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 widget.isFrameView()); 1134 widget.isFrameView());
1129 DEFINE_TYPE_CASTS(FrameView, 1135 DEFINE_TYPE_CASTS(FrameView,
1130 ScrollableArea, 1136 ScrollableArea,
1131 scrollableArea, 1137 scrollableArea,
1132 scrollableArea->isFrameView(), 1138 scrollableArea->isFrameView(),
1133 scrollableArea.isFrameView()); 1139 scrollableArea.isFrameView());
1134 1140
1135 } // namespace blink 1141 } // namespace blink
1136 1142
1137 #endif // FrameView_h 1143 #endif // FrameView_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/IntersectionObserver.cpp ('k') | third_party/WebKit/Source/core/frame/FrameView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698