| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010, 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 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 | 709 |
| 710 updateMaskLayerGeometry(); | 710 updateMaskLayerGeometry(); |
| 711 updateTransformGeometry(snappedOffsetFromCompositedAncestor, relativeComposi
tingBounds); | 711 updateTransformGeometry(snappedOffsetFromCompositedAncestor, relativeComposi
tingBounds); |
| 712 updateForegroundLayerGeometry(contentsSize, clippingBox); | 712 updateForegroundLayerGeometry(contentsSize, clippingBox); |
| 713 updateBackgroundLayerGeometry(contentsSize); | 713 updateBackgroundLayerGeometry(contentsSize); |
| 714 updateReflectionLayerGeometry(layersNeedingPaintInvalidation); | 714 updateReflectionLayerGeometry(layersNeedingPaintInvalidation); |
| 715 updateScrollingLayerGeometry(localCompositingBounds); | 715 updateScrollingLayerGeometry(localCompositingBounds); |
| 716 updateChildClippingMaskLayerGeometry(); | 716 updateChildClippingMaskLayerGeometry(); |
| 717 | 717 |
| 718 if (m_owningLayer.scrollableArea() && m_owningLayer.scrollableArea()->scroll
sOverflow()) | 718 if (m_owningLayer.scrollableArea() && m_owningLayer.scrollableArea()->scroll
sOverflow()) |
| 719 m_owningLayer.scrollableArea()->positionOverflowControls(IntSize()); | 719 m_owningLayer.scrollableArea()->positionOverflowControls(); |
| 720 | 720 |
| 721 if (RuntimeEnabledFeatures::cssCompositingEnabled()) { | 721 if (RuntimeEnabledFeatures::cssCompositingEnabled()) { |
| 722 updateLayerBlendMode(renderer()->styleRef()); | 722 updateLayerBlendMode(renderer()->styleRef()); |
| 723 updateIsRootForIsolatedGroup(); | 723 updateIsRootForIsolatedGroup(); |
| 724 } | 724 } |
| 725 | 725 |
| 726 updateContentsRect(); | 726 updateContentsRect(); |
| 727 updateBackgroundColor(); | 727 updateBackgroundColor(); |
| 728 updateDrawsContent(); | 728 updateDrawsContent(); |
| 729 updateContentsOpaque(); | 729 updateContentsOpaque(); |
| (...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1323 if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLay
er(m_owningLayer)) { | 1323 if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLay
er(m_owningLayer)) { |
| 1324 if (horizontalScrollbarLayerChanged) | 1324 if (horizontalScrollbarLayerChanged) |
| 1325 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_owning
Layer.scrollableArea(), HorizontalScrollbar); | 1325 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_owning
Layer.scrollableArea(), HorizontalScrollbar); |
| 1326 if (verticalScrollbarLayerChanged) | 1326 if (verticalScrollbarLayerChanged) |
| 1327 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_owning
Layer.scrollableArea(), VerticalScrollbar); | 1327 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_owning
Layer.scrollableArea(), VerticalScrollbar); |
| 1328 } | 1328 } |
| 1329 | 1329 |
| 1330 return horizontalScrollbarLayerChanged || verticalScrollbarLayerChanged || s
crollCornerLayerChanged; | 1330 return horizontalScrollbarLayerChanged || verticalScrollbarLayerChanged || s
crollCornerLayerChanged; |
| 1331 } | 1331 } |
| 1332 | 1332 |
| 1333 void CompositedLayerMapping::positionOverflowControlsLayers(const IntSize& offse
tFromRoot) | 1333 void CompositedLayerMapping::positionOverflowControlsLayers() |
| 1334 { | 1334 { |
| 1335 IntSize offsetFromRenderer = m_graphicsLayer->offsetFromRenderer() - rounded
IntSize(m_owningLayer.subpixelAccumulation()); | 1335 IntSize offsetFromRenderer = m_graphicsLayer->offsetFromRenderer() - rounded
IntSize(m_owningLayer.subpixelAccumulation()); |
| 1336 if (GraphicsLayer* layer = layerForHorizontalScrollbar()) { | 1336 if (GraphicsLayer* layer = layerForHorizontalScrollbar()) { |
| 1337 Scrollbar* hBar = m_owningLayer.scrollableArea()->horizontalScrollbar(); | 1337 Scrollbar* hBar = m_owningLayer.scrollableArea()->horizontalScrollbar(); |
| 1338 if (hBar) { | 1338 if (hBar) { |
| 1339 layer->setPosition(hBar->frameRect().location() - offsetFromRoot - o
ffsetFromRenderer); | 1339 layer->setPosition(hBar->frameRect().location() - offsetFromRenderer
); |
| 1340 layer->setSize(hBar->frameRect().size()); | 1340 layer->setSize(hBar->frameRect().size()); |
| 1341 if (layer->hasContentsLayer()) | 1341 if (layer->hasContentsLayer()) |
| 1342 layer->setContentsRect(IntRect(IntPoint(), hBar->frameRect().siz
e())); | 1342 layer->setContentsRect(IntRect(IntPoint(), hBar->frameRect().siz
e())); |
| 1343 } | 1343 } |
| 1344 layer->setDrawsContent(hBar && !layer->hasContentsLayer()); | 1344 layer->setDrawsContent(hBar && !layer->hasContentsLayer()); |
| 1345 } | 1345 } |
| 1346 | 1346 |
| 1347 if (GraphicsLayer* layer = layerForVerticalScrollbar()) { | 1347 if (GraphicsLayer* layer = layerForVerticalScrollbar()) { |
| 1348 Scrollbar* vBar = m_owningLayer.scrollableArea()->verticalScrollbar(); | 1348 Scrollbar* vBar = m_owningLayer.scrollableArea()->verticalScrollbar(); |
| 1349 if (vBar) { | 1349 if (vBar) { |
| 1350 layer->setPosition(vBar->frameRect().location() - offsetFromRoot - o
ffsetFromRenderer); | 1350 layer->setPosition(vBar->frameRect().location() - offsetFromRenderer
); |
| 1351 layer->setSize(vBar->frameRect().size()); | 1351 layer->setSize(vBar->frameRect().size()); |
| 1352 if (layer->hasContentsLayer()) | 1352 if (layer->hasContentsLayer()) |
| 1353 layer->setContentsRect(IntRect(IntPoint(), vBar->frameRect().siz
e())); | 1353 layer->setContentsRect(IntRect(IntPoint(), vBar->frameRect().siz
e())); |
| 1354 } | 1354 } |
| 1355 layer->setDrawsContent(vBar && !layer->hasContentsLayer()); | 1355 layer->setDrawsContent(vBar && !layer->hasContentsLayer()); |
| 1356 } | 1356 } |
| 1357 | 1357 |
| 1358 if (GraphicsLayer* layer = layerForScrollCorner()) { | 1358 if (GraphicsLayer* layer = layerForScrollCorner()) { |
| 1359 const IntRect& scrollCornerAndResizer = m_owningLayer.scrollableArea()->
scrollCornerAndResizerRect(); | 1359 const IntRect& scrollCornerAndResizer = m_owningLayer.scrollableArea()->
scrollCornerAndResizerRect(); |
| 1360 layer->setPosition(FloatPoint(scrollCornerAndResizer.location() - offset
FromRenderer)); | 1360 layer->setPosition(FloatPoint(scrollCornerAndResizer.location() - offset
FromRenderer)); |
| (...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2164 } | 2164 } |
| 2165 } | 2165 } |
| 2166 } | 2166 } |
| 2167 } | 2167 } |
| 2168 | 2168 |
| 2169 static void paintScrollbar(Scrollbar* scrollbar, GraphicsContext& context, const
IntRect& clip) | 2169 static void paintScrollbar(Scrollbar* scrollbar, GraphicsContext& context, const
IntRect& clip) |
| 2170 { | 2170 { |
| 2171 if (!scrollbar) | 2171 if (!scrollbar) |
| 2172 return; | 2172 return; |
| 2173 | 2173 |
| 2174 context.save(); | |
| 2175 const IntRect& scrollbarRect = scrollbar->frameRect(); | 2174 const IntRect& scrollbarRect = scrollbar->frameRect(); |
| 2176 context.translate(-scrollbarRect.x(), -scrollbarRect.y()); | 2175 TransformRecorder transformRecorder(context, scrollbar->displayItemClient(),
AffineTransform::translation(-scrollbarRect.x(), -scrollbarRect.y())); |
| 2177 IntRect transformedClip = clip; | 2176 IntRect transformedClip = clip; |
| 2178 transformedClip.moveBy(scrollbarRect.location()); | 2177 transformedClip.moveBy(scrollbarRect.location()); |
| 2179 scrollbar->paint(&context, transformedClip); | 2178 scrollbar->paint(&context, transformedClip); |
| 2180 context.restore(); | |
| 2181 } | 2179 } |
| 2182 | 2180 |
| 2183 // Up-call from compositing layer drawing callback. | 2181 // Up-call from compositing layer drawing callback. |
| 2184 void CompositedLayerMapping::paintContents(const GraphicsLayer* graphicsLayer, G
raphicsContext& context, GraphicsLayerPaintingPhase graphicsLayerPaintingPhase,
const IntRect& clip) | 2182 void CompositedLayerMapping::paintContents(const GraphicsLayer* graphicsLayer, G
raphicsContext& context, GraphicsLayerPaintingPhase graphicsLayerPaintingPhase,
const IntRect& clip) |
| 2185 { | 2183 { |
| 2186 // https://code.google.com/p/chromium/issues/detail?id=343772 | 2184 // https://code.google.com/p/chromium/issues/detail?id=343772 |
| 2187 DisableCompositingQueryAsserts disabler; | 2185 DisableCompositingQueryAsserts disabler; |
| 2188 #if ENABLE(ASSERT) | 2186 #if ENABLE(ASSERT) |
| 2189 // FIXME: once the state machine is ready, this can be removed and we can re
fer to that instead. | 2187 // FIXME: once the state machine is ready, this can be removed and we can re
fer to that instead. |
| 2190 if (Page* page = renderer()->frame()->page()) | 2188 if (Page* page = renderer()->frame()->page()) |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2364 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { | 2362 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { |
| 2365 name = "Scrolling Block Selection Layer"; | 2363 name = "Scrolling Block Selection Layer"; |
| 2366 } else { | 2364 } else { |
| 2367 ASSERT_NOT_REACHED(); | 2365 ASSERT_NOT_REACHED(); |
| 2368 } | 2366 } |
| 2369 | 2367 |
| 2370 return name; | 2368 return name; |
| 2371 } | 2369 } |
| 2372 | 2370 |
| 2373 } // namespace blink | 2371 } // namespace blink |
| OLD | NEW |