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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 RenderView* view = m_owningLayer->renderer()->view(); | 359 RenderView* view = m_owningLayer->renderer()->view(); |
360 RenderLayer* rootLayer = view->layer(); | 360 RenderLayer* rootLayer = view->layer(); |
361 | 361 |
362 LayoutRect clippingBounds; | 362 LayoutRect clippingBounds; |
363 if (renderer()->style()->position() == FixedPosition && renderer()->cont
ainer() == view) | 363 if (renderer()->style()->position() == FixedPosition && renderer()->cont
ainer() == view) |
364 clippingBounds = view->frameView()->viewportConstrainedVisibleConten
tRect(); | 364 clippingBounds = view->frameView()->viewportConstrainedVisibleConten
tRect(); |
365 else | 365 else |
366 clippingBounds = view->unscaledDocumentRect(); | 366 clippingBounds = view->unscaledDocumentRect(); |
367 | 367 |
368 if (m_owningLayer != rootLayer) | 368 if (m_owningLayer != rootLayer) |
369 clippingBounds.intersect(m_owningLayer->clipper().backgroundClipRect
(ClipRectsContext(rootLayer, 0, AbsoluteClipRects)).rect()); // FIXME: Incorrect
for CSS regions. | 369 clippingBounds.intersect(m_owningLayer->clipper().backgroundClipRect
(ClipRectsContext(rootLayer, AbsoluteClipRects)).rect()); |
370 | 370 |
371 LayoutPoint delta; | 371 LayoutPoint delta; |
372 m_owningLayer->convertToLayerCoords(rootLayer, delta); | 372 m_owningLayer->convertToLayerCoords(rootLayer, delta); |
373 clippingBounds.move(-delta.x(), -delta.y()); | 373 clippingBounds.move(-delta.x(), -delta.y()); |
374 | 374 |
375 layerBounds.intersect(clippingBounds); | 375 layerBounds.intersect(clippingBounds); |
376 } | 376 } |
377 | 377 |
378 // If the element has a transform-origin that has fixed lengths, and the ren
derer has zero size, | 378 // If the element has a transform-origin that has fixed lengths, and the ren
derer has zero size, |
379 // then we need to ensure that the compositing layer has non-zero size so th
at we can apply | 379 // then we need to ensure that the compositing layer has non-zero size so th
at we can apply |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 if (renderer->isRenderPart()) | 532 if (renderer->isRenderPart()) |
533 layerConfigChanged = RenderLayerCompositor::parentFrameContentLayers(toR
enderPart(renderer)); | 533 layerConfigChanged = RenderLayerCompositor::parentFrameContentLayers(toR
enderPart(renderer)); |
534 | 534 |
535 return layerConfigChanged; | 535 return layerConfigChanged; |
536 } | 536 } |
537 | 537 |
538 static IntRect clipBox(RenderBox* renderer) | 538 static IntRect clipBox(RenderBox* renderer) |
539 { | 539 { |
540 LayoutRect result = PaintInfo::infiniteRect(); | 540 LayoutRect result = PaintInfo::infiniteRect(); |
541 if (renderer->hasOverflowClip()) | 541 if (renderer->hasOverflowClip()) |
542 result = renderer->overflowClipRect(LayoutPoint(), 0); // FIXME: Incorre
ct for CSS regions. | 542 result = renderer->overflowClipRect(LayoutPoint()); |
543 | 543 |
544 if (renderer->hasClip()) | 544 if (renderer->hasClip()) |
545 result.intersect(renderer->clipRect(LayoutPoint(), 0)); // FIXME: Incorr
ect for CSS regions. | 545 result.intersect(renderer->clipRect(LayoutPoint())); |
546 | 546 |
547 return pixelSnappedIntRect(result); | 547 return pixelSnappedIntRect(result); |
548 } | 548 } |
549 | 549 |
550 void CompositedLayerMapping::adjustBoundsForSubPixelAccumulation(const RenderLay
er* compositedAncestor, IntRect& localBounds, IntRect& relativeBounds, IntPoint&
delta) | 550 void CompositedLayerMapping::adjustBoundsForSubPixelAccumulation(const RenderLay
er* compositedAncestor, IntRect& localBounds, IntRect& relativeBounds, IntPoint&
delta) |
551 { | 551 { |
552 LayoutRect localRawCompositingBounds = compositedBounds(); | 552 LayoutRect localRawCompositingBounds = compositedBounds(); |
553 LayoutPoint rawDelta; | 553 LayoutPoint rawDelta; |
554 m_owningLayer->convertToLayerCoords(compositedAncestor, rawDelta); | 554 m_owningLayer->convertToLayerCoords(compositedAncestor, rawDelta); |
555 delta = flooredIntPoint(rawDelta); | 555 delta = flooredIntPoint(rawDelta); |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 RenderBox* renderBox = toRenderBox(compAncestor->renderer()); | 684 RenderBox* renderBox = toRenderBox(compAncestor->renderer()); |
685 IntSize scrollOffset = renderBox->scrolledContentOffset(); | 685 IntSize scrollOffset = renderBox->scrolledContentOffset(); |
686 IntPoint scrollOrigin(renderBox->borderLeft(), renderBox->borderTop()); | 686 IntPoint scrollOrigin(renderBox->borderLeft(), renderBox->borderTop()); |
687 graphicsLayerParentLocation = scrollOrigin - scrollOffset; | 687 graphicsLayerParentLocation = scrollOrigin - scrollOffset; |
688 } | 688 } |
689 | 689 |
690 if (compAncestor && m_ancestorClippingLayer) { | 690 if (compAncestor && m_ancestorClippingLayer) { |
691 // Call calculateRects to get the backgroundRect which is what is used t
o clip the contents of this | 691 // Call calculateRects to get the backgroundRect which is what is used t
o clip the contents of this |
692 // layer. Note that we call it with temporaryClipRects = true because no
rmally when computing clip rects | 692 // layer. Note that we call it with temporaryClipRects = true because no
rmally when computing clip rects |
693 // for a compositing layer, rootLayer is the layer itself. | 693 // for a compositing layer, rootLayer is the layer itself. |
694 ClipRectsContext clipRectsContext(compAncestor, 0, TemporaryClipRects, I
gnoreOverlayScrollbarSize, IgnoreOverflowClip); | 694 ClipRectsContext clipRectsContext(compAncestor, TemporaryClipRects, Igno
reOverlayScrollbarSize, IgnoreOverflowClip); |
695 IntRect parentClipRect = pixelSnappedIntRect(m_owningLayer->clipper().ba
ckgroundClipRect(clipRectsContext).rect()); // FIXME: Incorrect for CSS regions. | 695 IntRect parentClipRect = pixelSnappedIntRect(m_owningLayer->clipper().ba
ckgroundClipRect(clipRectsContext).rect()); |
696 ASSERT(parentClipRect != PaintInfo::infiniteRect()); | 696 ASSERT(parentClipRect != PaintInfo::infiniteRect()); |
697 m_ancestorClippingLayer->setPosition(FloatPoint(parentClipRect.location(
) - graphicsLayerParentLocation)); | 697 m_ancestorClippingLayer->setPosition(FloatPoint(parentClipRect.location(
) - graphicsLayerParentLocation)); |
698 m_ancestorClippingLayer->setSize(parentClipRect.size()); | 698 m_ancestorClippingLayer->setSize(parentClipRect.size()); |
699 | 699 |
700 // backgroundRect is relative to compAncestor, so subtract deltaX/deltaY
to get back to local coords. | 700 // backgroundRect is relative to compAncestor, so subtract deltaX/deltaY
to get back to local coords. |
701 m_ancestorClippingLayer->setOffsetFromRenderer(parentClipRect.location()
- delta); | 701 m_ancestorClippingLayer->setOffsetFromRenderer(parentClipRect.location()
- delta); |
702 | 702 |
703 // The primary layer is then parented in, and positioned relative to thi
s clipping layer. | 703 // The primary layer is then parented in, and positioned relative to thi
s clipping layer. |
704 graphicsLayerParentLocation = parentClipRect.location(); | 704 graphicsLayerParentLocation = parentClipRect.location(); |
705 } | 705 } |
(...skipping 1430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2136 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { | 2136 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { |
2137 name = "Scrolling Contents Layer"; | 2137 name = "Scrolling Contents Layer"; |
2138 } else { | 2138 } else { |
2139 ASSERT_NOT_REACHED(); | 2139 ASSERT_NOT_REACHED(); |
2140 } | 2140 } |
2141 | 2141 |
2142 return name; | 2142 return name; |
2143 } | 2143 } |
2144 | 2144 |
2145 } // namespace WebCore | 2145 } // namespace WebCore |
OLD | NEW |