| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. |
| 3 * | 3 * |
| 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 5 * | 5 * |
| 6 * Other contributors: | 6 * Other contributors: |
| 7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
| 9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
| 10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
| (...skipping 1702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1713 if (compositingState() == PaintsIntoOwnBacking) | 1713 if (compositingState() == PaintsIntoOwnBacking) |
| 1714 offsetFromRoot.move(subpixelAccumulation()); | 1714 offsetFromRoot.move(subpixelAccumulation()); |
| 1715 | 1715 |
| 1716 LayoutRect rootRelativeBounds; | 1716 LayoutRect rootRelativeBounds; |
| 1717 bool rootRelativeBoundsComputed = false; | 1717 bool rootRelativeBoundsComputed = false; |
| 1718 | 1718 |
| 1719 // Apply clip-path to context. | 1719 // Apply clip-path to context. |
| 1720 GraphicsContextStateSaver clipStateSaver(*context, false); | 1720 GraphicsContextStateSaver clipStateSaver(*context, false); |
| 1721 RenderStyle* style = renderer()->style(); | 1721 RenderStyle* style = renderer()->style(); |
| 1722 RenderSVGResourceClipper* resourceClipper = 0; | 1722 RenderSVGResourceClipper* resourceClipper = 0; |
| 1723 ClipperContext clipperContext; | 1723 RenderSVGResourceClipper::ClipperState clipperState = RenderSVGResourceClipp
er::ClipperNotApplied; |
| 1724 | 1724 |
| 1725 // Clip-path, like border radius, must not be applied to the contents of a c
omposited-scrolling container. | 1725 // Clip-path, like border radius, must not be applied to the contents of a c
omposited-scrolling container. |
| 1726 // It must, however, still be applied to the mask layer, so that the composi
tor can properly mask the | 1726 // It must, however, still be applied to the mask layer, so that the composi
tor can properly mask the |
| 1727 // scrolling contents and scrollbars. | 1727 // scrolling contents and scrollbars. |
| 1728 if (renderer()->hasClipPath() && style && (!needsCompositedScrolling() || pa
intFlags & PaintLayerPaintingChildClippingMaskPhase)) { | 1728 if (renderer()->hasClipPath() && style && (!needsCompositedScrolling() || pa
intFlags & PaintLayerPaintingChildClippingMaskPhase)) { |
| 1729 ASSERT(style->clipPath()); | 1729 ASSERT(style->clipPath()); |
| 1730 if (style->clipPath()->type() == ClipPathOperation::SHAPE) { | 1730 if (style->clipPath()->type() == ClipPathOperation::SHAPE) { |
| 1731 ShapeClipPathOperation* clipPath = toShapeClipPathOperation(style->c
lipPath()); | 1731 ShapeClipPathOperation* clipPath = toShapeClipPathOperation(style->c
lipPath()); |
| 1732 if (clipPath->isValid()) { | 1732 if (clipPath->isValid()) { |
| 1733 clipStateSaver.save(); | 1733 clipStateSaver.save(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1748 // FIXME: Saving at this point is not required in the 'mask'- | 1748 // FIXME: Saving at this point is not required in the 'mask'- |
| 1749 // case, or if the clip ends up empty. | 1749 // case, or if the clip ends up empty. |
| 1750 clipStateSaver.save(); | 1750 clipStateSaver.save(); |
| 1751 if (!rootRelativeBoundsComputed) { | 1751 if (!rootRelativeBoundsComputed) { |
| 1752 rootRelativeBounds = physicalBoundingBoxIncludingReflectionA
ndStackingChildren(paintingInfo.rootLayer, offsetFromRoot); | 1752 rootRelativeBounds = physicalBoundingBoxIncludingReflectionA
ndStackingChildren(paintingInfo.rootLayer, offsetFromRoot); |
| 1753 rootRelativeBoundsComputed = true; | 1753 rootRelativeBoundsComputed = true; |
| 1754 } | 1754 } |
| 1755 | 1755 |
| 1756 resourceClipper = toRenderSVGResourceClipper(toRenderSVGResource
Container(element->renderer())); | 1756 resourceClipper = toRenderSVGResourceClipper(toRenderSVGResource
Container(element->renderer())); |
| 1757 if (!resourceClipper->applyClippingToContext(renderer(), rootRel
ativeBounds, | 1757 if (!resourceClipper->applyClippingToContext(renderer(), rootRel
ativeBounds, |
| 1758 paintingInfo.paintDirtyRect, context, clipperContext)) { | 1758 paintingInfo.paintDirtyRect, context, clipperState)) { |
| 1759 // No need to post-apply the clipper if this failed. | 1759 // No need to post-apply the clipper if this failed. |
| 1760 resourceClipper = 0; | 1760 resourceClipper = 0; |
| 1761 } | 1761 } |
| 1762 } | 1762 } |
| 1763 } | 1763 } |
| 1764 } | 1764 } |
| 1765 | 1765 |
| 1766 // Blending operations must be performed only with the nearest ancestor stac
king context. | 1766 // Blending operations must be performed only with the nearest ancestor stac
king context. |
| 1767 // Note that there is no need to create a transparency layer if we're painti
ng the root. | 1767 // Note that there is no need to create a transparency layer if we're painti
ng the root. |
| 1768 bool createTransparencyLayerForBlendMode = !renderer()->isDocumentElement()
&& m_stackingNode->isStackingContext() && hasDescendantWithBlendMode(); | 1768 bool createTransparencyLayerForBlendMode = !renderer()->isDocumentElement()
&& m_stackingNode->isStackingContext() && hasDescendantWithBlendMode(); |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1901 } | 1901 } |
| 1902 | 1902 |
| 1903 // End our transparency layer | 1903 // End our transparency layer |
| 1904 if ((haveTransparency || paintsWithBlendMode() || createTransparencyLayerFor
BlendMode) && m_usedTransparency && !(m_reflectionInfo && m_reflectionInfo->isPa
intingInsideReflection())) { | 1904 if ((haveTransparency || paintsWithBlendMode() || createTransparencyLayerFor
BlendMode) && m_usedTransparency && !(m_reflectionInfo && m_reflectionInfo->isPa
intingInsideReflection())) { |
| 1905 context->endLayer(); | 1905 context->endLayer(); |
| 1906 context->restore(); | 1906 context->restore(); |
| 1907 m_usedTransparency = false; | 1907 m_usedTransparency = false; |
| 1908 } | 1908 } |
| 1909 | 1909 |
| 1910 if (resourceClipper) | 1910 if (resourceClipper) |
| 1911 resourceClipper->postApplyStatefulResource(renderer(), context, clipperC
ontext); | 1911 resourceClipper->postApplyStatefulResource(renderer(), context, clipperS
tate); |
| 1912 } | 1912 } |
| 1913 | 1913 |
| 1914 void RenderLayer::paintLayerByApplyingTransform(GraphicsContext* context, const
LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags, const LayoutPoint&
translationOffset) | 1914 void RenderLayer::paintLayerByApplyingTransform(GraphicsContext* context, const
LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags, const LayoutPoint&
translationOffset) |
| 1915 { | 1915 { |
| 1916 // This involves subtracting out the position of the layer in our current co
ordinate space, but preserving | 1916 // This involves subtracting out the position of the layer in our current co
ordinate space, but preserving |
| 1917 // the accumulated error for sub-pixel layout. | 1917 // the accumulated error for sub-pixel layout. |
| 1918 LayoutPoint delta; | 1918 LayoutPoint delta; |
| 1919 convertToLayerCoords(paintingInfo.rootLayer, delta); | 1919 convertToLayerCoords(paintingInfo.rootLayer, delta); |
| 1920 delta.moveBy(translationOffset); | 1920 delta.moveBy(translationOffset); |
| 1921 TransformationMatrix transform(renderableTransform(paintingInfo.paintBehavio
r)); | 1921 TransformationMatrix transform(renderableTransform(paintingInfo.paintBehavio
r)); |
| (...skipping 1765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3687 } | 3687 } |
| 3688 } | 3688 } |
| 3689 | 3689 |
| 3690 void showLayerTree(const blink::RenderObject* renderer) | 3690 void showLayerTree(const blink::RenderObject* renderer) |
| 3691 { | 3691 { |
| 3692 if (!renderer) | 3692 if (!renderer) |
| 3693 return; | 3693 return; |
| 3694 showLayerTree(renderer->enclosingLayer()); | 3694 showLayerTree(renderer->enclosingLayer()); |
| 3695 } | 3695 } |
| 3696 #endif | 3696 #endif |
| OLD | NEW |