| 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 3783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3794 } | 3794 } |
| 3795 | 3795 |
| 3796 // Make sure that we now use the original transparency context. | 3796 // Make sure that we now use the original transparency context. |
| 3797 ASSERT(transparencyLayerContext == context); | 3797 ASSERT(transparencyLayerContext == context); |
| 3798 | 3798 |
| 3799 if ((localPaintFlags & PaintLayerPaintingCompositingMaskPhase) && shouldPain
tContent && renderer()->hasMask() && !selectionOnly) { | 3799 if ((localPaintFlags & PaintLayerPaintingCompositingMaskPhase) && shouldPain
tContent && renderer()->hasMask() && !selectionOnly) { |
| 3800 // Paint the mask for the fragments. | 3800 // Paint the mask for the fragments. |
| 3801 paintMaskForFragments(layerFragments, context, localPaintingInfo, painti
ngRootForRenderer); | 3801 paintMaskForFragments(layerFragments, context, localPaintingInfo, painti
ngRootForRenderer); |
| 3802 } | 3802 } |
| 3803 | 3803 |
| 3804 if ((localPaintFlags & PaintLayerPaintingCompositingBorderRadiusMaskPhase) &
& renderer()->style()->hasBorderRadius() && shouldPaintContent && !selectionOnly
) { |
| 3805 // Paint the border radius mask for the fragments. |
| 3806 paintMaskForFragments(layerFragments, context, localPaintingInfo, painti
ngRootForRenderer, PaintPhaseBorderRadiusMask); |
| 3807 } |
| 3808 |
| 3804 // End our transparency layer | 3809 // End our transparency layer |
| 3805 if (haveTransparency && m_usedTransparency && !m_paintingInsideReflection) { | 3810 if (haveTransparency && m_usedTransparency && !m_paintingInsideReflection) { |
| 3806 context->endTransparencyLayer(); | 3811 context->endTransparencyLayer(); |
| 3807 context->restore(); | 3812 context->restore(); |
| 3808 m_usedTransparency = false; | 3813 m_usedTransparency = false; |
| 3809 } | 3814 } |
| 3810 | 3815 |
| 3811 if (hasClipPath) | 3816 if (hasClipPath) |
| 3812 context->restore(); | 3817 context->restore(); |
| 3813 } | 3818 } |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4073 | 4078 |
| 4074 // Paint our own outline | 4079 // Paint our own outline |
| 4075 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.outlineRect.re
ct()), PaintPhaseSelfOutline, paintBehavior, paintingRootForRenderer, localPaint
ingInfo.region, 0, 0, localPaintingInfo.rootLayer->renderer()); | 4080 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.outlineRect.re
ct()), PaintPhaseSelfOutline, paintBehavior, paintingRootForRenderer, localPaint
ingInfo.region, 0, 0, localPaintingInfo.rootLayer->renderer()); |
| 4076 clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.paint
DirtyRect, fragment.outlineRect, DoNotIncludeSelfForBorderRadius); | 4081 clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.paint
DirtyRect, fragment.outlineRect, DoNotIncludeSelfForBorderRadius); |
| 4077 renderer()->paint(paintInfo, toPoint(fragment.layerBounds.location() - r
enderBoxLocation() + localPaintingInfo.subPixelAccumulation)); | 4082 renderer()->paint(paintInfo, toPoint(fragment.layerBounds.location() - r
enderBoxLocation() + localPaintingInfo.subPixelAccumulation)); |
| 4078 restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.outlineR
ect); | 4083 restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.outlineR
ect); |
| 4079 } | 4084 } |
| 4080 } | 4085 } |
| 4081 | 4086 |
| 4082 void RenderLayer::paintMaskForFragments(const LayerFragments& layerFragments, Gr
aphicsContext* context, const LayerPaintingInfo& localPaintingInfo, | 4087 void RenderLayer::paintMaskForFragments(const LayerFragments& layerFragments, Gr
aphicsContext* context, const LayerPaintingInfo& localPaintingInfo, |
| 4083 RenderObject* paintingRootForRenderer) | 4088 RenderObject* paintingRootForRenderer, PaintPhase paintPhase) |
| 4084 { | 4089 { |
| 4085 for (size_t i = 0; i < layerFragments.size(); ++i) { | 4090 for (size_t i = 0; i < layerFragments.size(); ++i) { |
| 4086 const LayerFragment& fragment = layerFragments.at(i); | 4091 const LayerFragment& fragment = layerFragments.at(i); |
| 4087 if (!fragment.shouldPaintContent) | 4092 if (!fragment.shouldPaintContent) |
| 4088 continue; | 4093 continue; |
| 4089 | 4094 |
| 4090 if (localPaintingInfo.clipToDirtyRect) | 4095 if (localPaintingInfo.clipToDirtyRect) |
| 4091 clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.p
aintDirtyRect, fragment.backgroundRect, DoNotIncludeSelfForBorderRadius); // Mas
k painting will handle clipping to self. | 4096 clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.p
aintDirtyRect, fragment.backgroundRect, DoNotIncludeSelfForBorderRadius); // Mas
k painting will handle clipping to self. |
| 4092 | 4097 |
| 4093 // Paint the mask. | 4098 // Paint the mask. |
| 4094 // FIXME: Eventually we will collect the region from the fragment itself
instead of just from the paint info. | 4099 // FIXME: Eventually we will collect the region from the fragment itself
instead of just from the paint info. |
| 4095 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.backgroundRect
.rect()), PaintPhaseMask, PaintBehaviorNormal, paintingRootForRenderer, localPai
ntingInfo.region, 0, 0, localPaintingInfo.rootLayer->renderer()); | 4100 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.backgroundRect
.rect()), paintPhase, PaintBehaviorNormal, paintingRootForRenderer, localPaintin
gInfo.region, 0, 0, localPaintingInfo.rootLayer->renderer()); |
| 4096 renderer()->paint(paintInfo, toPoint(fragment.layerBounds.location() - r
enderBoxLocation() + localPaintingInfo.subPixelAccumulation)); | 4101 renderer()->paint(paintInfo, toPoint(fragment.layerBounds.location() - r
enderBoxLocation() + localPaintingInfo.subPixelAccumulation)); |
| 4097 | 4102 |
| 4098 if (localPaintingInfo.clipToDirtyRect) | 4103 if (localPaintingInfo.clipToDirtyRect) |
| 4099 restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.back
groundRect); | 4104 restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.back
groundRect); |
| 4100 } | 4105 } |
| 4101 } | 4106 } |
| 4102 | 4107 |
| 4103 void RenderLayer::paintOverflowControlsForFragments(const LayerFragments& layerF
ragments, GraphicsContext* context, const LayerPaintingInfo& localPaintingInfo) | 4108 void RenderLayer::paintOverflowControlsForFragments(const LayerFragments& layerF
ragments, GraphicsContext* context, const LayerPaintingInfo& localPaintingInfo) |
| 4104 { | 4109 { |
| 4105 for (size_t i = 0; i < layerFragments.size(); ++i) { | 4110 for (size_t i = 0; i < layerFragments.size(); ++i) { |
| (...skipping 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5412 | 5417 |
| 5413 if (!layerBeingDestroyed) | 5418 if (!layerBeingDestroyed) |
| 5414 updateOrRemoveFilterEffectRenderer(); | 5419 updateOrRemoveFilterEffectRenderer(); |
| 5415 } | 5420 } |
| 5416 | 5421 |
| 5417 bool RenderLayer::hasCompositedMask() const | 5422 bool RenderLayer::hasCompositedMask() const |
| 5418 { | 5423 { |
| 5419 return m_backing && m_backing->hasMaskLayer(); | 5424 return m_backing && m_backing->hasMaskLayer(); |
| 5420 } | 5425 } |
| 5421 | 5426 |
| 5427 bool RenderLayer::hasCompositedBorderRadiusMask() const |
| 5428 { |
| 5429 return m_backing && m_backing->hasBorderRadiusLayer(); |
| 5430 } |
| 5431 |
| 5422 GraphicsLayer* RenderLayer::layerForScrolling() const | 5432 GraphicsLayer* RenderLayer::layerForScrolling() const |
| 5423 { | 5433 { |
| 5424 return m_backing ? m_backing->scrollingContentsLayer() : 0; | 5434 return m_backing ? m_backing->scrollingContentsLayer() : 0; |
| 5425 } | 5435 } |
| 5426 | 5436 |
| 5427 GraphicsLayer* RenderLayer::layerForHorizontalScrollbar() const | 5437 GraphicsLayer* RenderLayer::layerForHorizontalScrollbar() const |
| 5428 { | 5438 { |
| 5429 return m_backing ? m_backing->layerForHorizontalScrollbar() : 0; | 5439 return m_backing ? m_backing->layerForHorizontalScrollbar() : 0; |
| 5430 } | 5440 } |
| 5431 | 5441 |
| (...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6408 } | 6418 } |
| 6409 } | 6419 } |
| 6410 | 6420 |
| 6411 void showLayerTree(const WebCore::RenderObject* renderer) | 6421 void showLayerTree(const WebCore::RenderObject* renderer) |
| 6412 { | 6422 { |
| 6413 if (!renderer) | 6423 if (!renderer) |
| 6414 return; | 6424 return; |
| 6415 showLayerTree(renderer->enclosingLayer()); | 6425 showLayerTree(renderer->enclosingLayer()); |
| 6416 } | 6426 } |
| 6417 #endif | 6427 #endif |
| OLD | NEW |