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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 else | 204 else |
205 offsetFromRoot.move(paintingInfo.subPixelAccumulation); | 205 offsetFromRoot.move(paintingInfo.subPixelAccumulation); |
206 | 206 |
207 LayoutRect rootRelativeBounds; | 207 LayoutRect rootRelativeBounds; |
208 bool rootRelativeBoundsComputed = false; | 208 bool rootRelativeBoundsComputed = false; |
209 | 209 |
210 // These helpers output clip and compositing operations using a RAII pattern
. Stack-allocated-varibles are destructed in the reverse order of construction, | 210 // These helpers output clip and compositing operations using a RAII pattern
. Stack-allocated-varibles are destructed in the reverse order of construction, |
211 // so they are nested properly. | 211 // so they are nested properly. |
212 ClipPathHelper clipPathHelper(context, m_paintLayer, paintingInfo, rootRelat
iveBounds, rootRelativeBoundsComputed, offsetFromRoot, paintFlags); | 212 ClipPathHelper clipPathHelper(context, m_paintLayer, paintingInfo, rootRelat
iveBounds, rootRelativeBoundsComputed, offsetFromRoot, paintFlags); |
213 | 213 |
214 Optional<LayerClipRecorder> clipRecorder; | |
215 Optional<CompositingRecorder> compositingRecorder; | 214 Optional<CompositingRecorder> compositingRecorder; |
216 // Blending operations must be performed only with the nearest ancestor stac
king context. | 215 // Blending operations must be performed only with the nearest ancestor stac
king context. |
217 // Note that there is no need to composite if we're painting the root. | 216 // Note that there is no need to composite if we're painting the root. |
218 // FIXME: this should be unified further into DeprecatedPaintLayer::paintsWi
thTransparency(). | 217 // FIXME: this should be unified further into DeprecatedPaintLayer::paintsWi
thTransparency(). |
219 bool shouldCompositeForBlendMode = (!m_paintLayer.layoutObject()->isDocument
Element() || m_paintLayer.layoutObject()->isSVGRoot()) && m_paintLayer.stackingN
ode()->isStackingContext() && m_paintLayer.hasNonIsolatedDescendantWithBlendMode
(); | 218 bool shouldCompositeForBlendMode = (!m_paintLayer.layoutObject()->isDocument
Element() || m_paintLayer.layoutObject()->isSVGRoot()) && m_paintLayer.stackingN
ode()->isStackingContext() && m_paintLayer.hasNonIsolatedDescendantWithBlendMode
(); |
220 if (shouldCompositeForBlendMode || m_paintLayer.paintsWithTransparency(paint
ingInfo.globalPaintFlags())) { | 219 if (shouldCompositeForBlendMode || m_paintLayer.paintsWithTransparency(paint
ingInfo.globalPaintFlags())) { |
221 clipRecorder.emplace(*context, *m_paintLayer.layoutObject(), DisplayItem
::TransparencyClip, | 220 FloatRect compositingBounds = FloatRect(m_paintLayer.paintingExtent(pain
tingInfo.rootLayer, paintingInfo.paintDirtyRect, paintingInfo.globalPaintFlags()
)); |
222 m_paintLayer.paintingExtent(paintingInfo.rootLayer, paintingInfo.pai
ntDirtyRect, paintingInfo.globalPaintFlags()), | |
223 &paintingInfo, LayoutPoint(), paintFlags); | |
224 | |
225 compositingRecorder.emplace(*context, *m_paintLayer.layoutObject(), | 221 compositingRecorder.emplace(*context, *m_paintLayer.layoutObject(), |
226 WebCoreCompositeToSkiaComposite(CompositeSourceOver, m_paintLayer.la
youtObject()->style()->blendMode()), | 222 WebCoreCompositeToSkiaComposite(CompositeSourceOver, m_paintLayer.la
youtObject()->style()->blendMode()), |
227 m_paintLayer.layoutObject()->opacity()); | 223 m_paintLayer.layoutObject()->opacity(), &compositingBounds); |
228 } | 224 } |
229 | 225 |
230 DeprecatedPaintLayerPaintingInfo localPaintingInfo(paintingInfo); | 226 DeprecatedPaintLayerPaintingInfo localPaintingInfo(paintingInfo); |
231 if (m_paintLayer.compositingState() == PaintsIntoOwnBacking) | 227 if (m_paintLayer.compositingState() == PaintsIntoOwnBacking) |
232 localPaintingInfo.subPixelAccumulation = m_paintLayer.subpixelAccumulati
on(); | 228 localPaintingInfo.subPixelAccumulation = m_paintLayer.subpixelAccumulati
on(); |
233 | 229 |
234 DeprecatedPaintLayerFragments layerFragments; | 230 DeprecatedPaintLayerFragments layerFragments; |
235 if (shouldPaintContent || shouldPaintOutline || isPaintingOverlayScrollbars)
{ | 231 if (shouldPaintContent || shouldPaintOutline || isPaintingOverlayScrollbars)
{ |
236 // Collect the fragments. This will compute the clip rectangles and pain
t offsets for each layer fragment. | 232 // Collect the fragments. This will compute the clip rectangles and pain
t offsets for each layer fragment. |
237 ClipRectsCacheSlot cacheSlot = (paintFlags & PaintLayerUncachedClipRects
) ? UncachedClipRects : PaintingClipRects; | 233 ClipRectsCacheSlot cacheSlot = (paintFlags & PaintLayerUncachedClipRects
) ? UncachedClipRects : PaintingClipRects; |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 if (!m_paintLayer.containsDirtyOverlayScrollbars()) | 600 if (!m_paintLayer.containsDirtyOverlayScrollbars()) |
605 return; | 601 return; |
606 | 602 |
607 DeprecatedPaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(encl
osingIntRect(damageRect)), paintFlags, LayoutSize(), paintingRoot); | 603 DeprecatedPaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(encl
osingIntRect(damageRect)), paintFlags, LayoutSize(), paintingRoot); |
608 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); | 604 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); |
609 | 605 |
610 m_paintLayer.setContainsDirtyOverlayScrollbars(false); | 606 m_paintLayer.setContainsDirtyOverlayScrollbars(false); |
611 } | 607 } |
612 | 608 |
613 } // namespace blink | 609 } // namespace blink |
OLD | NEW |