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