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

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

Issue 2654883002: Give OOPIF FrameViews their own scroll animation timelines and hosts (Closed)
Patch Set: Created 3 years, 10 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
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 22 matching lines...) Expand all
33 #include "core/frame/RootFrameViewport.h" 33 #include "core/frame/RootFrameViewport.h"
34 #include "core/layout/MapCoordinatesFlags.h" 34 #include "core/layout/MapCoordinatesFlags.h"
35 #include "core/layout/ScrollAnchor.h" 35 #include "core/layout/ScrollAnchor.h"
36 #include "core/paint/FirstMeaningfulPaintDetector.h" 36 #include "core/paint/FirstMeaningfulPaintDetector.h"
37 #include "core/paint/ObjectPaintProperties.h" 37 #include "core/paint/ObjectPaintProperties.h"
38 #include "core/paint/PaintInvalidationCapableScrollableArea.h" 38 #include "core/paint/PaintInvalidationCapableScrollableArea.h"
39 #include "core/paint/PaintPhase.h" 39 #include "core/paint/PaintPhase.h"
40 #include "core/paint/ScrollbarManager.h" 40 #include "core/paint/ScrollbarManager.h"
41 #include "platform/RuntimeEnabledFeatures.h" 41 #include "platform/RuntimeEnabledFeatures.h"
42 #include "platform/Widget.h" 42 #include "platform/Widget.h"
43 #include "platform/animation/CompositorAnimationHost.h"
44 #include "platform/animation/CompositorAnimationTimeline.h"
43 #include "platform/geometry/IntRect.h" 45 #include "platform/geometry/IntRect.h"
44 #include "platform/geometry/LayoutRect.h" 46 #include "platform/geometry/LayoutRect.h"
45 #include "platform/graphics/Color.h" 47 #include "platform/graphics/Color.h"
46 #include "platform/graphics/GraphicsLayerClient.h" 48 #include "platform/graphics/GraphicsLayerClient.h"
47 #include "platform/scroll/ScrollTypes.h" 49 #include "platform/scroll/ScrollTypes.h"
48 #include "platform/scroll/Scrollbar.h" 50 #include "platform/scroll/Scrollbar.h"
49 #include "public/platform/ShapeProperties.h" 51 #include "public/platform/ShapeProperties.h"
50 #include "public/platform/WebDisplayMode.h" 52 #include "public/platform/WebDisplayMode.h"
51 #include "public/platform/WebRect.h" 53 #include "public/platform/WebRect.h"
52 #include "wtf/Allocator.h" 54 #include "wtf/Allocator.h"
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after
812 void mapQuadToAncestorFrameIncludingScrollOffset( 814 void mapQuadToAncestorFrameIncludingScrollOffset(
813 LayoutRect&, 815 LayoutRect&,
814 const LayoutObject* descendant, 816 const LayoutObject* descendant,
815 const LayoutView* ancestor, 817 const LayoutView* ancestor,
816 MapCoordinatesFlags mode); 818 MapCoordinatesFlags mode);
817 819
818 bool mapToVisualRectInTopFrameSpace(LayoutRect&); 820 bool mapToVisualRectInTopFrameSpace(LayoutRect&);
819 821
820 void applyTransformForTopFrameSpace(TransformState&); 822 void applyTransformForTopFrameSpace(TransformState&);
821 823
824 // TODO(kenrb): These are temporary methods pending resolution of
825 // https://crbug.com/680606. Animation timelines and hosts for scrolling
826 // are normally owned by ScrollingCoordinator, but there is only one
827 // of those objects per page. To get around this, we temporarily stash a
828 // unique timeline and host on each OOPIF FrameView.
829 void setAnimationTimeline(std::unique_ptr<CompositorAnimationTimeline>);
830 void setAnimationHost(std::unique_ptr<CompositorAnimationHost>);
831
822 protected: 832 protected:
823 // Scroll the content via the compositor. 833 // Scroll the content via the compositor.
824 bool scrollContentsFastPath(const IntSize& scrollDelta); 834 bool scrollContentsFastPath(const IntSize& scrollDelta);
825 835
826 // Scroll the content by invalidating everything. 836 // Scroll the content by invalidating everything.
827 void scrollContentsSlowPath(); 837 void scrollContentsSlowPath();
828 838
829 ScrollBehavior scrollBehaviorStyle() const override; 839 ScrollBehavior scrollBehaviorStyle() const override;
830 840
831 void scrollContentsIfNeeded(); 841 void scrollContentsIfNeeded();
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
1183 std::unique_ptr<PaintController> m_paintController; 1193 std::unique_ptr<PaintController> m_paintController;
1184 std::unique_ptr<PaintArtifactCompositor> m_paintArtifactCompositor; 1194 std::unique_ptr<PaintArtifactCompositor> m_paintArtifactCompositor;
1185 1195
1186 bool m_isStoringCompositedLayerDebugInfo; 1196 bool m_isStoringCompositedLayerDebugInfo;
1187 MainThreadScrollingReasons m_mainThreadScrollingReasons; 1197 MainThreadScrollingReasons m_mainThreadScrollingReasons;
1188 // For recording main thread scrolling reasons 1198 // For recording main thread scrolling reasons
1189 // due to layout object properties. e.g. opacity, transform. 1199 // due to layout object properties. e.g. opacity, transform.
1190 // The size of the vector depends on the number of 1200 // The size of the vector depends on the number of
1191 // main thread scrolling reasons. 1201 // main thread scrolling reasons.
1192 Vector<int> m_mainThreadScrollingReasonsCounter; 1202 Vector<int> m_mainThreadScrollingReasonsCounter;
1203
1204 // TODO(kenrb): Remove these when https://crbug.com/680606 is resolved.
1205 std::unique_ptr<CompositorAnimationTimeline> m_animationTimeline;
1206 std::unique_ptr<CompositorAnimationHost> m_animationHost;
1193 }; 1207 };
1194 1208
1195 inline void FrameView::incrementVisuallyNonEmptyCharacterCount(unsigned count) { 1209 inline void FrameView::incrementVisuallyNonEmptyCharacterCount(unsigned count) {
1196 if (m_isVisuallyNonEmpty) 1210 if (m_isVisuallyNonEmpty)
1197 return; 1211 return;
1198 m_visuallyNonEmptyCharacterCount += count; 1212 m_visuallyNonEmptyCharacterCount += count;
1199 // Use a threshold value to prevent very small amounts of visible content from 1213 // Use a threshold value to prevent very small amounts of visible content from
1200 // triggering didMeaningfulLayout. The first few hundred characters rarely 1214 // triggering didMeaningfulLayout. The first few hundred characters rarely
1201 // contain the interesting content of the page. 1215 // contain the interesting content of the page.
1202 static const unsigned visualCharacterThreshold = 200; 1216 static const unsigned visualCharacterThreshold = 200;
(...skipping 20 matching lines...) Expand all
1223 widget.isFrameView()); 1237 widget.isFrameView());
1224 DEFINE_TYPE_CASTS(FrameView, 1238 DEFINE_TYPE_CASTS(FrameView,
1225 ScrollableArea, 1239 ScrollableArea,
1226 scrollableArea, 1240 scrollableArea,
1227 scrollableArea->isFrameView(), 1241 scrollableArea->isFrameView(),
1228 scrollableArea.isFrameView()); 1242 scrollableArea.isFrameView());
1229 1243
1230 } // namespace blink 1244 } // namespace blink
1231 1245
1232 #endif // FrameView_h 1246 #endif // FrameView_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698