OLD | NEW |
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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 bool isOpaqueScrollbar = !scrollbar->isOverlayScrollbar(); | 260 bool isOpaqueScrollbar = !scrollbar->isOverlayScrollbar(); |
261 if (!scrollbarGraphicsLayer->contentsOpaque()) | 261 if (!scrollbarGraphicsLayer->contentsOpaque()) |
262 scrollbarGraphicsLayer->setContentsOpaque(isMainFrame && isOpaqueScr
ollbar); | 262 scrollbarGraphicsLayer->setContentsOpaque(isMainFrame && isOpaqueScr
ollbar); |
263 scrollbarLayer->layer()->setOpaque(scrollbarGraphicsLayer->contentsOpaqu
e()); | 263 scrollbarLayer->layer()->setOpaque(scrollbarGraphicsLayer->contentsOpaqu
e()); |
264 | 264 |
265 setupScrollbarLayer(scrollbarGraphicsLayer, scrollbarLayer, scrollingWeb
LayerForScrollableArea(scrollableArea)); | 265 setupScrollbarLayer(scrollbarGraphicsLayer, scrollbarLayer, scrollingWeb
LayerForScrollableArea(scrollableArea)); |
266 } else | 266 } else |
267 removeWebScrollbarLayer(scrollableArea, orientation); | 267 removeWebScrollbarLayer(scrollableArea, orientation); |
268 } | 268 } |
269 | 269 |
270 void ScrollingCoordinator::scrollableAreaScrollLayerDidChange(ScrollableArea* sc
rollableArea) | 270 bool ScrollingCoordinator::scrollableAreaScrollLayerDidChange(ScrollableArea* sc
rollableArea) |
271 { | 271 { |
272 GraphicsLayer* scrollLayer = scrollLayerForScrollableArea(scrollableArea); | 272 GraphicsLayer* scrollLayer = scrollLayerForScrollableArea(scrollableArea); |
273 if (scrollLayer) | 273 if (scrollLayer) |
274 scrollLayer->setScrollableArea(scrollableArea); | 274 scrollLayer->setScrollableArea(scrollableArea); |
275 | 275 |
276 WebLayer* webLayer = scrollingWebLayerForScrollableArea(scrollableArea); | 276 WebLayer* webLayer = scrollingWebLayerForScrollableArea(scrollableArea); |
277 if (webLayer) { | 277 if (webLayer) { |
278 webLayer->setScrollable(true); | 278 webLayer->setScrollable(true); |
279 webLayer->setScrollPosition(IntPoint(scrollableArea->scrollPosition() -
scrollableArea->minimumScrollPosition())); | 279 webLayer->setScrollPosition(IntPoint(scrollableArea->scrollPosition() -
scrollableArea->minimumScrollPosition())); |
280 webLayer->setMaxScrollPosition(IntSize(scrollableArea->scrollSize(Horizo
ntalScrollbar), scrollableArea->scrollSize(VerticalScrollbar))); | 280 webLayer->setMaxScrollPosition(IntSize(scrollableArea->scrollSize(Horizo
ntalScrollbar), scrollableArea->scrollSize(VerticalScrollbar))); |
281 } | 281 } |
282 if (WebScrollbarLayer* scrollbarLayer = getWebScrollbarLayer(scrollableArea,
HorizontalScrollbar)) | 282 if (WebScrollbarLayer* scrollbarLayer = getWebScrollbarLayer(scrollableArea,
HorizontalScrollbar)) |
283 setupScrollbarLayer(horizontalScrollbarLayerForScrollableArea(scrollable
Area), scrollbarLayer, webLayer); | 283 setupScrollbarLayer(horizontalScrollbarLayerForScrollableArea(scrollable
Area), scrollbarLayer, webLayer); |
284 if (WebScrollbarLayer* scrollbarLayer = getWebScrollbarLayer(scrollableArea,
VerticalScrollbar)) | 284 if (WebScrollbarLayer* scrollbarLayer = getWebScrollbarLayer(scrollableArea,
VerticalScrollbar)) |
285 setupScrollbarLayer(verticalScrollbarLayerForScrollableArea(scrollableAr
ea), scrollbarLayer, webLayer); | 285 setupScrollbarLayer(verticalScrollbarLayerForScrollableArea(scrollableAr
ea), scrollbarLayer, webLayer); |
| 286 |
| 287 return !!webLayer; |
286 } | 288 } |
287 | 289 |
288 void ScrollingCoordinator::setTouchEventTargetRects(const Vector<IntRect>& absol
uteHitTestRects) | 290 void ScrollingCoordinator::setTouchEventTargetRects(const Vector<IntRect>& absol
uteHitTestRects) |
289 { | 291 { |
290 if (WebLayer* scrollLayer = scrollingWebLayerForScrollableArea(m_page->mainF
rame()->view())) { | 292 if (WebLayer* scrollLayer = scrollingWebLayerForScrollableArea(m_page->mainF
rame()->view())) { |
291 WebVector<WebRect> webRects(absoluteHitTestRects.size()); | 293 WebVector<WebRect> webRects(absoluteHitTestRects.size()); |
292 for (size_t i = 0; i < absoluteHitTestRects.size(); ++i) | 294 for (size_t i = 0; i < absoluteHitTestRects.size(); ++i) |
293 webRects[i] = absoluteHitTestRects[i]; | 295 webRects[i] = absoluteHitTestRects[i]; |
294 scrollLayer->setTouchEventHandlerRegion(webRects); | 296 scrollLayer->setTouchEventHandlerRegion(webRects); |
295 } | 297 } |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 stringBuilder.resize(stringBuilder.length() - 2); | 634 stringBuilder.resize(stringBuilder.length() - 2); |
633 return stringBuilder.toString(); | 635 return stringBuilder.toString(); |
634 } | 636 } |
635 | 637 |
636 String ScrollingCoordinator::mainThreadScrollingReasonsAsText() const | 638 String ScrollingCoordinator::mainThreadScrollingReasonsAsText() const |
637 { | 639 { |
638 return mainThreadScrollingReasonsAsText(mainThreadScrollingReasons()); | 640 return mainThreadScrollingReasonsAsText(mainThreadScrollingReasons()); |
639 } | 641 } |
640 | 642 |
641 } // namespace WebCore | 643 } // namespace WebCore |
OLD | NEW |