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

Side by Side Diff: Source/core/page/scrolling/ScrollingCoordinator.cpp

Issue 1215973002: Oilpan: improve ScrollableArea handling. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: clear out animators on DeprecatedPaintLayerScrollableArea dispose Created 5 years, 5 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 WebLayer* toWebLayer(blink::GraphicsLayer* layer) 74 WebLayer* toWebLayer(blink::GraphicsLayer* layer)
75 { 75 {
76 return layer ? layer->platformLayer() : nullptr; 76 return layer ? layer->platformLayer() : nullptr;
77 } 77 }
78 78
79 } // namespace 79 } // namespace
80 80
81 namespace blink { 81 namespace blink {
82 82
83 PassOwnPtr<ScrollingCoordinator> ScrollingCoordinator::create(Page* page) 83 PassOwnPtrWillBeRawPtr<ScrollingCoordinator> ScrollingCoordinator::create(Page* page)
84 { 84 {
85 return adoptPtr(new ScrollingCoordinator(page)); 85 return adoptPtrWillBeNoop(new ScrollingCoordinator(page));
86 } 86 }
87 87
88 ScrollingCoordinator::ScrollingCoordinator(Page* page) 88 ScrollingCoordinator::ScrollingCoordinator(Page* page)
89 : m_page(page) 89 : m_page(page)
90 , m_scrollGestureRegionIsDirty(false) 90 , m_scrollGestureRegionIsDirty(false)
91 , m_touchEventTargetRectsAreDirty(false) 91 , m_touchEventTargetRectsAreDirty(false)
92 , m_shouldScrollOnMainThreadDirty(false) 92 , m_shouldScrollOnMainThreadDirty(false)
93 , m_wasFrameScrollable(false) 93 , m_wasFrameScrollable(false)
94 , m_lastMainThreadScrollingReasons(0) 94 , m_lastMainThreadScrollingReasons(0)
95 { 95 {
96 } 96 }
97 97
98 ScrollingCoordinator::~ScrollingCoordinator() 98 ScrollingCoordinator::~ScrollingCoordinator()
99 { 99 {
haraken 2015/06/30 10:30:35 Not mandatory, but it would be a good idea to add
sof 2015/06/30 11:34:09 Added
100 } 100 }
101 101
102 DEFINE_TRACE(ScrollingCoordinator)
103 {
104 visitor->trace(m_page);
105 #if ENABLE(OILPAN)
106 visitor->trace(m_horizontalScrollbars);
107 visitor->trace(m_verticalScrollbars);
108 #endif
109 }
110
102 void ScrollingCoordinator::setShouldHandleScrollGestureOnMainThreadRegion(const Region& region) 111 void ScrollingCoordinator::setShouldHandleScrollGestureOnMainThreadRegion(const Region& region)
103 { 112 {
104 if (!m_page->mainFrame()->isLocalFrame() || !m_page->deprecatedLocalMainFram e()->view()) 113 if (!m_page->mainFrame()->isLocalFrame() || !m_page->deprecatedLocalMainFram e()->view())
105 return; 114 return;
106 if (WebLayer* scrollLayer = toWebLayer(m_page->deprecatedLocalMainFrame()->v iew()->layerForScrolling())) { 115 if (WebLayer* scrollLayer = toWebLayer(m_page->deprecatedLocalMainFrame()->v iew()->layerForScrolling())) {
107 Vector<IntRect> rects = region.rects(); 116 Vector<IntRect> rects = region.rects();
108 WebVector<WebRect> webRects(rects.size()); 117 WebVector<WebRect> webRects(rects.size());
109 for (size_t i = 0; i < rects.size(); ++i) 118 for (size_t i = 0; i < rects.size(); ++i)
110 webRects[i] = rects[i]; 119 webRects[i] = rects[i];
111 scrollLayer->setNonFastScrollableRegion(webRects); 120 scrollLayer->setNonFastScrollableRegion(webRects);
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after
1051 bool frameIsScrollable = frameView && frameView->isScrollable(); 1060 bool frameIsScrollable = frameView && frameView->isScrollable();
1052 if (frameIsScrollable != m_wasFrameScrollable) 1061 if (frameIsScrollable != m_wasFrameScrollable)
1053 return true; 1062 return true;
1054 1063
1055 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll ing()) : nullptr) 1064 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll ing()) : nullptr)
1056 return WebSize(frameView->contentsSize()) != scrollLayer->bounds(); 1065 return WebSize(frameView->contentsSize()) != scrollLayer->bounds();
1057 return false; 1066 return false;
1058 } 1067 }
1059 1068
1060 } // namespace blink 1069 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698