| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "core/paint/DeprecatedPaintLayerPainter.h" | 6 #include "core/paint/DeprecatedPaintLayerPainter.h" |
| 7 | 7 |
| 8 #include "core/frame/Settings.h" | 8 #include "core/frame/Settings.h" |
| 9 #include "core/layout/ClipPathOperation.h" | 9 #include "core/layout/ClipPathOperation.h" |
| 10 #include "core/layout/LayoutBlock.h" | 10 #include "core/layout/LayoutBlock.h" |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 ClipPathHelper clipPathHelper(context, m_paintLayer, paintingInfo, rootRelat
iveBounds, rootRelativeBoundsComputed, offsetFromRoot, paintFlags); | 198 ClipPathHelper clipPathHelper(context, m_paintLayer, paintingInfo, rootRelat
iveBounds, rootRelativeBoundsComputed, offsetFromRoot, paintFlags); |
| 199 | 199 |
| 200 Optional<LayerClipRecorder> clipRecorder; | 200 Optional<LayerClipRecorder> clipRecorder; |
| 201 Optional<CompositingRecorder> compositingRecorder; | 201 Optional<CompositingRecorder> compositingRecorder; |
| 202 // Blending operations must be performed only with the nearest ancestor stac
king context. | 202 // Blending operations must be performed only with the nearest ancestor stac
king context. |
| 203 // Note that there is no need to composite if we're painting the root. | 203 // Note that there is no need to composite if we're painting the root. |
| 204 // FIXME: this should be unified further into DeprecatedPaintLayer::paintsWi
thTransparency(). | 204 // FIXME: this should be unified further into DeprecatedPaintLayer::paintsWi
thTransparency(). |
| 205 bool shouldCompositeForBlendMode = (!m_paintLayer.layoutObject()->isDocument
Element() || m_paintLayer.layoutObject()->isSVGRoot()) && m_paintLayer.stackingN
ode()->isStackingContext() && m_paintLayer.hasNonIsolatedDescendantWithBlendMode
(); | 205 bool shouldCompositeForBlendMode = (!m_paintLayer.layoutObject()->isDocument
Element() || m_paintLayer.layoutObject()->isSVGRoot()) && m_paintLayer.stackingN
ode()->isStackingContext() && m_paintLayer.hasNonIsolatedDescendantWithBlendMode
(); |
| 206 if (shouldCompositeForBlendMode || m_paintLayer.paintsWithTransparency(paint
ingInfo.globalPaintFlags())) { | 206 if (shouldCompositeForBlendMode || m_paintLayer.paintsWithTransparency(paint
ingInfo.globalPaintFlags())) { |
| 207 clipRecorder.emplace(*context, *m_paintLayer.layoutObject(), DisplayItem
::TransparencyClip, | 207 clipRecorder.emplace(*context, *m_paintLayer.layoutObject(), DisplayItem
::TransparencyClip, |
| 208 m_paintLayer.paintingExtent(paintingInfo.rootLayer, paintingInfo.pai
ntDirtyRect, paintingInfo.subPixelAccumulation, paintingInfo.globalPaintFlags())
, | 208 m_paintLayer.paintingExtent(paintingInfo.rootLayer, paintingInfo.pai
ntDirtyRect, paintingInfo.globalPaintFlags()), |
| 209 &paintingInfo, LayoutPoint(), paintFlags); | 209 &paintingInfo, LayoutPoint(), paintFlags); |
| 210 | 210 |
| 211 compositingRecorder.emplace(*context, *m_paintLayer.layoutObject(), | 211 compositingRecorder.emplace(*context, *m_paintLayer.layoutObject(), |
| 212 WebCoreCompositeToSkiaComposite(CompositeSourceOver, m_paintLayer.la
youtObject()->style()->blendMode()), | 212 WebCoreCompositeToSkiaComposite(CompositeSourceOver, m_paintLayer.la
youtObject()->style()->blendMode()), |
| 213 m_paintLayer.layoutObject()->opacity()); | 213 m_paintLayer.layoutObject()->opacity()); |
| 214 } | 214 } |
| 215 | 215 |
| 216 DeprecatedPaintLayerPaintingInfo localPaintingInfo(paintingInfo); | 216 DeprecatedPaintLayerPaintingInfo localPaintingInfo(paintingInfo); |
| 217 | 217 |
| 218 DeprecatedPaintLayerFragments layerFragments; | 218 DeprecatedPaintLayerFragments layerFragments; |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 DeprecatedPaintLayer* paginationLayer = m_paintLayer.enclosingPaginationLaye
r(); | 330 DeprecatedPaintLayer* paginationLayer = m_paintLayer.enclosingPaginationLaye
r(); |
| 331 DeprecatedPaintLayerFragments fragments; | 331 DeprecatedPaintLayerFragments fragments; |
| 332 if (paginationLayer) { | 332 if (paginationLayer) { |
| 333 // FIXME: This is a mess. Look closely at this code and the code in Laye
r and fix any | 333 // FIXME: This is a mess. Look closely at this code and the code in Laye
r and fix any |
| 334 // issues in it & refactor to make it obvious from code structure what i
t does and that it's | 334 // issues in it & refactor to make it obvious from code structure what i
t does and that it's |
| 335 // correct. | 335 // correct. |
| 336 ClipRectsCacheSlot cacheSlot = (paintFlags & PaintLayerUncachedClipRects
) ? UncachedClipRects : PaintingClipRects; | 336 ClipRectsCacheSlot cacheSlot = (paintFlags & PaintLayerUncachedClipRects
) ? UncachedClipRects : PaintingClipRects; |
| 337 ShouldRespectOverflowClip respectOverflowClip = shouldRespectOverflowCli
p(paintFlags, m_paintLayer.layoutObject()); | 337 ShouldRespectOverflowClip respectOverflowClip = shouldRespectOverflowCli
p(paintFlags, m_paintLayer.layoutObject()); |
| 338 // Calculate the transformed bounding box in the current coordinate spac
e, to figure out | 338 // Calculate the transformed bounding box in the current coordinate spac
e, to figure out |
| 339 // which fragmentainers (e.g. columns) we need to visit. | 339 // which fragmentainers (e.g. columns) we need to visit. |
| 340 LayoutRect transformedExtent = DeprecatedPaintLayer::transparencyClipBox
(&m_paintLayer, paginationLayer, DeprecatedPaintLayer::PaintingTransparencyClipB
ox, DeprecatedPaintLayer::RootOfTransparencyClipBox, paintingInfo.subPixelAccumu
lation, paintingInfo.globalPaintFlags()); | 340 LayoutRect transformedExtent = DeprecatedPaintLayer::transparencyClipBox
(&m_paintLayer, paginationLayer, DeprecatedPaintLayer::PaintingTransparencyClipB
ox, DeprecatedPaintLayer::RootOfTransparencyClipBox, paintingInfo.globalPaintFla
gs()); |
| 341 // FIXME: we don't check if paginationLayer is within paintingInfo.rootL
ayer here. | 341 // FIXME: we don't check if paginationLayer is within paintingInfo.rootL
ayer here. |
| 342 paginationLayer->collectFragments(fragments, paintingInfo.rootLayer, pai
ntingInfo.paintDirtyRect, cacheSlot, IgnoreOverlayScrollbarSize, respectOverflow
Clip, 0, paintingInfo.subPixelAccumulation, &transformedExtent); | 342 paginationLayer->collectFragments(fragments, paintingInfo.rootLayer, pai
ntingInfo.paintDirtyRect, cacheSlot, IgnoreOverlayScrollbarSize, respectOverflow
Clip, 0, paintingInfo.subPixelAccumulation, &transformedExtent); |
| 343 } else { | 343 } else { |
| 344 // We don't need to collect any fragments in the regular way here. We ha
ve already | 344 // We don't need to collect any fragments in the regular way here. We ha
ve already |
| 345 // calculated a clip rectangle for the ancestry if it was needed, and cl
ipping this | 345 // calculated a clip rectangle for the ancestry if it was needed, and cl
ipping this |
| 346 // layer is something that can be done further down the path, when the t
ransform has | 346 // layer is something that can be done further down the path, when the t
ransform has |
| 347 // been applied. | 347 // been applied. |
| 348 DeprecatedPaintLayerFragment fragment; | 348 DeprecatedPaintLayerFragment fragment; |
| 349 fragment.backgroundRect = paintingInfo.paintDirtyRect; | 349 fragment.backgroundRect = paintingInfo.paintDirtyRect; |
| 350 fragments.append(fragment); | 350 fragments.append(fragment); |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 if (!m_paintLayer.containsDirtyOverlayScrollbars()) | 588 if (!m_paintLayer.containsDirtyOverlayScrollbars()) |
| 589 return; | 589 return; |
| 590 | 590 |
| 591 DeprecatedPaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(encl
osingIntRect(damageRect)), paintFlags, LayoutSize(), paintingRoot); | 591 DeprecatedPaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(encl
osingIntRect(damageRect)), paintFlags, LayoutSize(), paintingRoot); |
| 592 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); | 592 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); |
| 593 | 593 |
| 594 m_paintLayer.setContainsDirtyOverlayScrollbars(false); | 594 m_paintLayer.setContainsDirtyOverlayScrollbars(false); |
| 595 } | 595 } |
| 596 | 596 |
| 597 } // namespace blink | 597 } // namespace blink |
| OLD | NEW |