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

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: review-induced improvements 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 {
100 ASSERT(!m_page);
101 }
102
103 DEFINE_TRACE(ScrollingCoordinator)
104 {
105 visitor->trace(m_page);
106 #if ENABLE(OILPAN)
107 visitor->trace(m_horizontalScrollbars);
108 visitor->trace(m_verticalScrollbars);
109 #endif
100 } 110 }
101 111
102 void ScrollingCoordinator::setShouldHandleScrollGestureOnMainThreadRegion(const Region& region) 112 void ScrollingCoordinator::setShouldHandleScrollGestureOnMainThreadRegion(const Region& region)
103 { 113 {
104 if (!m_page->mainFrame()->isLocalFrame() || !m_page->deprecatedLocalMainFram e()->view()) 114 if (!m_page->mainFrame()->isLocalFrame() || !m_page->deprecatedLocalMainFram e()->view())
105 return; 115 return;
106 if (WebLayer* scrollLayer = toWebLayer(m_page->deprecatedLocalMainFrame()->v iew()->layerForScrolling())) { 116 if (WebLayer* scrollLayer = toWebLayer(m_page->deprecatedLocalMainFrame()->v iew()->layerForScrolling())) {
107 Vector<IntRect> rects = region.rects(); 117 Vector<IntRect> rects = region.rects();
108 WebVector<WebRect> webRects(rects.size()); 118 WebVector<WebRect> webRects(rects.size());
109 for (size_t i = 0; i < rects.size(); ++i) 119 for (size_t i = 0; i < rects.size(); ++i)
(...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after
1051 bool frameIsScrollable = frameView && frameView->isScrollable(); 1061 bool frameIsScrollable = frameView && frameView->isScrollable();
1052 if (frameIsScrollable != m_wasFrameScrollable) 1062 if (frameIsScrollable != m_wasFrameScrollable)
1053 return true; 1063 return true;
1054 1064
1055 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll ing()) : nullptr) 1065 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll ing()) : nullptr)
1056 return WebSize(frameView->contentsSize()) != scrollLayer->bounds(); 1066 return WebSize(frameView->contentsSize()) != scrollLayer->bounds();
1057 return false; 1067 return false;
1058 } 1068 }
1059 1069
1060 } // namespace blink 1070 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/page/scrolling/ScrollingCoordinator.h ('k') | Source/core/paint/DeprecatedPaintLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698