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

Unified Diff: sky/engine/core/page/scrolling/ScrollingCoordinator.cpp

Issue 661633003: Get rid of slow repaint objects and main thread scrolling reasons. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: merge to ToT Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/engine/core/page/scrolling/ScrollingCoordinator.h ('k') | sky/engine/core/rendering/RenderObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/page/scrolling/ScrollingCoordinator.cpp
diff --git a/sky/engine/core/page/scrolling/ScrollingCoordinator.cpp b/sky/engine/core/page/scrolling/ScrollingCoordinator.cpp
index d3efd68d04425ec2575d0d1675b7ad92ac50b650..499d588c294c86fbf0818f89b8b1b198efa98452 100644
--- a/sky/engine/core/page/scrolling/ScrollingCoordinator.cpp
+++ b/sky/engine/core/page/scrolling/ScrollingCoordinator.cpp
@@ -87,7 +87,6 @@ ScrollingCoordinator::ScrollingCoordinator(Page* page)
, m_touchEventTargetRectsAreDirty(false)
, m_shouldScrollOnMainThreadDirty(false)
, m_wasFrameScrollable(false)
- , m_lastMainThreadScrollingReasons(0)
{
}
@@ -140,12 +139,7 @@ void ScrollingCoordinator::updateAfterCompositingChangeIfNeeded()
}
FrameView* frameView = m_page->mainFrame()->view();
- bool frameIsScrollable = frameView && frameView->isScrollable();
- if (m_shouldScrollOnMainThreadDirty || m_wasFrameScrollable != frameIsScrollable) {
- setShouldUpdateScrollLayerPositionOnMainThread(mainThreadScrollingReasons());
- m_shouldScrollOnMainThreadDirty = false;
- }
- m_wasFrameScrollable = frameIsScrollable;
+ m_wasFrameScrollable = frameView && frameView->isScrollable();
// The mainFrame view doesn't get included in the FrameTree below, so we
// update its size separately.
@@ -427,10 +421,6 @@ void ScrollingCoordinator::reset()
m_verticalScrollbars.clear();
m_layersWithTouchRects.clear();
m_wasFrameScrollable = false;
-
- // This is retained for testing.
- m_lastMainThreadScrollingReasons = 0;
- setShouldUpdateScrollLayerPositionOnMainThread(m_lastMainThreadScrollingReasons);
}
// Note that in principle this could be called more often than computeTouchEventTargetRects, for
@@ -540,14 +530,6 @@ void ScrollingCoordinator::updateHaveScrollEventHandlers()
}
}
-void ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread(MainThreadScrollingReasons reasons)
-{
- if (WebLayer* scrollLayer = toWebLayer(m_page->mainFrame()->view()->layerForScrolling())) {
- m_lastMainThreadScrollingReasons = reasons;
- scrollLayer->setShouldScrollOnMainThread(reasons);
- }
-}
-
void ScrollingCoordinator::willBeDestroyed()
{
ASSERT(m_page);
@@ -558,22 +540,6 @@ void ScrollingCoordinator::willBeDestroyed()
GraphicsLayer::unregisterContentsLayer(it->value->layer());
}
-bool ScrollingCoordinator::coordinatesScrollingForFrameView(FrameView* frameView) const
-{
- ASSERT(isMainThread());
- ASSERT(m_page);
-
- // We currently only handle the main frame.
- if (&frameView->frame() != m_page->mainFrame())
- return false;
-
- // We currently only support composited mode.
- RenderView* renderView = m_page->mainFrame()->contentRenderer();
- if (!renderView)
- return false;
- return renderView->usesCompositing();
-}
-
Region ScrollingCoordinator::computeShouldHandleScrollGestureOnMainThreadRegion(const LocalFrame* frame, const IntPoint& frameLocation) const
{
Region shouldHandleScrollGestureOnMainThreadRegion;
@@ -685,47 +651,12 @@ void ScrollingCoordinator::computeTouchEventTargetRects(LayerHitTestRects& rects
accumulateDocumentTouchEventTargetRects(rects, document);
}
-void ScrollingCoordinator::frameViewHasSlowRepaintObjectsDidChange(FrameView* frameView)
-{
- ASSERT(isMainThread());
- ASSERT(m_page);
-
- if (!coordinatesScrollingForFrameView(frameView))
- return;
-
- m_shouldScrollOnMainThreadDirty = true;
-}
-
-void ScrollingCoordinator::frameViewFixedObjectsDidChange(FrameView* frameView)
-{
- ASSERT(isMainThread());
- ASSERT(m_page);
-
- if (!coordinatesScrollingForFrameView(frameView))
- return;
-
- m_shouldScrollOnMainThreadDirty = true;
-}
-
bool ScrollingCoordinator::isForMainFrame(ScrollableArea* scrollableArea) const
{
// FIXME(sky): Remove
return false;
}
-void ScrollingCoordinator::frameViewRootLayerDidChange(FrameView* frameView)
-{
- ASSERT(isMainThread());
- ASSERT(m_page);
-
- if (!coordinatesScrollingForFrameView(frameView))
- return;
-
- notifyLayoutUpdated();
- updateHaveWheelEventHandlers();
- updateHaveScrollEventHandlers();
-}
-
#if OS(MACOSX)
void ScrollingCoordinator::handleWheelEventPhase(PlatformWheelEventPhase phase)
{
@@ -742,33 +673,6 @@ void ScrollingCoordinator::handleWheelEventPhase(PlatformWheelEventPhase phase)
}
#endif
-MainThreadScrollingReasons ScrollingCoordinator::mainThreadScrollingReasons() const
-{
- MainThreadScrollingReasons reasons = static_cast<MainThreadScrollingReasons>(0);
-
- FrameView* frameView = m_page->mainFrame()->view();
- if (!frameView)
- return reasons;
-
- if (frameView->hasSlowRepaintObjects())
- reasons |= HasSlowRepaintObjects;
-
- return reasons;
-}
-
-String ScrollingCoordinator::mainThreadScrollingReasonsAsText(MainThreadScrollingReasons reasons)
-{
- if (reasons & ScrollingCoordinator::HasSlowRepaintObjects)
- return "Has slow repaint objects";
- return "";
-}
-
-String ScrollingCoordinator::mainThreadScrollingReasonsAsText() const
-{
- ASSERT(m_page->mainFrame()->document()->lifecycle().state() >= DocumentLifecycle::CompositingClean);
- return mainThreadScrollingReasonsAsText(m_lastMainThreadScrollingReasons);
-}
-
bool ScrollingCoordinator::frameViewIsDirty() const
{
// FIXME(sky): Remove
« no previous file with comments | « sky/engine/core/page/scrolling/ScrollingCoordinator.h ('k') | sky/engine/core/rendering/RenderObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698