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 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 // Transform each rect to the co-ordinate space of the graphicsLayer. | 485 // Transform each rect to the co-ordinate space of the graphicsLayer. |
486 for (size_t i = 0; i < layerIter->value.size(); ++i) { | 486 for (size_t i = 0; i < layerIter->value.size(); ++i) { |
487 LayoutRect rect = layerIter->value[i]; | 487 LayoutRect rect = layerIter->value[i]; |
488 if (compositedLayer != curLayer) { | 488 if (compositedLayer != curLayer) { |
489 FloatQuad compositorQuad = geometryMap.mapToContainer(rect, comp
ositedLayer->renderer()); | 489 FloatQuad compositorQuad = geometryMap.mapToContainer(rect, comp
ositedLayer->renderer()); |
490 rect = LayoutRect(compositorQuad.boundingBox()); | 490 rect = LayoutRect(compositorQuad.boundingBox()); |
491 // If the enclosing composited layer itself is scrolled, we have
to undo the subtraction | 491 // If the enclosing composited layer itself is scrolled, we have
to undo the subtraction |
492 // of its scroll offset since we want the offset relative to the
scrolling content, not | 492 // of its scroll offset since we want the offset relative to the
scrolling content, not |
493 // the element itself. | 493 // the element itself. |
494 if (compositedLayer->renderer()->hasOverflowClip()) | 494 if (compositedLayer->renderer()->hasOverflowClip()) |
495 rect.move(compositedLayer->renderBox()->scrolledContentOffse
t()); | 495 rect.move(compositedLayer->layoutBox()->scrolledContentOffse
t()); |
496 } | 496 } |
497 Layer::mapRectToPaintBackingCoordinates(compositedLayer->renderer(),
rect); | 497 Layer::mapRectToPaintBackingCoordinates(compositedLayer->renderer(),
rect); |
498 glRects->append(rect); | 498 glRects->append(rect); |
499 } | 499 } |
500 } | 500 } |
501 | 501 |
502 // Walk child layers of interest | 502 // Walk child layers of interest |
503 for (const Layer* childLayer = curLayer->firstChild(); childLayer; childLaye
r = childLayer->nextSibling()) { | 503 for (const Layer* childLayer = curLayer->firstChild(); childLayer; childLaye
r = childLayer->nextSibling()) { |
504 if (layersWithRects.contains(childLayer)) { | 504 if (layersWithRects.contains(childLayer)) { |
505 geometryMap.pushMappingsToAncestor(childLayer, curLayer); | 505 geometryMap.pushMappingsToAncestor(childLayer, curLayer); |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
755 box.moveBy(offset); | 755 box.moveBy(offset); |
756 shouldHandleScrollGestureOnMainThreadRegion.unite(box); | 756 shouldHandleScrollGestureOnMainThreadRegion.unite(box); |
757 } | 757 } |
758 } | 758 } |
759 | 759 |
760 // We use GestureScrollBegin/Update/End for moving the resizer handle. So we
mark these | 760 // We use GestureScrollBegin/Update/End for moving the resizer handle. So we
mark these |
761 // small resizer areas as non-fast-scrollable to allow the scroll gestures t
o be passed to | 761 // small resizer areas as non-fast-scrollable to allow the scroll gestures t
o be passed to |
762 // main thread if they are targeting the resizer area. (Resizing is done in
EventHandler.cpp | 762 // main thread if they are targeting the resizer area. (Resizing is done in
EventHandler.cpp |
763 // on main thread). | 763 // on main thread). |
764 if (const FrameView::ResizerAreaSet* resizerAreas = frameView->resizerAreas(
)) { | 764 if (const FrameView::ResizerAreaSet* resizerAreas = frameView->resizerAreas(
)) { |
765 for (const RenderBox* box : *resizerAreas) { | 765 for (const LayoutBox* box : *resizerAreas) { |
766 IntRect bounds = box->absoluteBoundingBoxRect(); | 766 IntRect bounds = box->absoluteBoundingBoxRect(); |
767 IntRect corner = box->layer()->scrollableArea()->touchResizerCornerR
ect(bounds); | 767 IntRect corner = box->layer()->scrollableArea()->touchResizerCornerR
ect(bounds); |
768 corner.moveBy(offset); | 768 corner.moveBy(offset); |
769 shouldHandleScrollGestureOnMainThreadRegion.unite(corner); | 769 shouldHandleScrollGestureOnMainThreadRegion.unite(corner); |
770 } | 770 } |
771 } | 771 } |
772 | 772 |
773 if (const FrameView::ChildrenWidgetSet* children = frameView->children()) { | 773 if (const FrameView::ChildrenWidgetSet* children = frameView->children()) { |
774 for (const RefPtrWillBeMember<Widget>& child : *children) { | 774 for (const RefPtrWillBeMember<Widget>& child : *children) { |
775 if (!(*child).isPluginView()) | 775 if (!(*child).isPluginView()) |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1054 bool frameIsScrollable = frameView && frameView->isScrollable(); | 1054 bool frameIsScrollable = frameView && frameView->isScrollable(); |
1055 if (frameIsScrollable != m_wasFrameScrollable) | 1055 if (frameIsScrollable != m_wasFrameScrollable) |
1056 return true; | 1056 return true; |
1057 | 1057 |
1058 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll
ing()) : nullptr) | 1058 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll
ing()) : nullptr) |
1059 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds(
); | 1059 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds(
); |
1060 return false; | 1060 return false; |
1061 } | 1061 } |
1062 | 1062 |
1063 } // namespace blink | 1063 } // namespace blink |
OLD | NEW |