Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(359)

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp

Issue 2641173008: [SPv2] Add CSS mask support (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "core/paint/PaintLayerPainter.h" 5 #include "core/paint/PaintLayerPainter.h"
6 6
7 #include "core/frame/LocalFrame.h" 7 #include "core/frame/LocalFrame.h"
8 #include "core/layout/LayoutView.h" 8 #include "core/layout/LayoutView.h"
9 #include "core/paint/ClipPathClipper.h" 9 #include "core/paint/ClipPathClipper.h"
10 #include "core/paint/FilterPainter.h" 10 #include "core/paint/FilterPainter.h"
(...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 1128
1129 void PaintLayerPainter::paintMaskForFragments( 1129 void PaintLayerPainter::paintMaskForFragments(
1130 const PaintLayerFragments& layerFragments, 1130 const PaintLayerFragments& layerFragments,
1131 GraphicsContext& context, 1131 GraphicsContext& context,
1132 const PaintLayerPaintingInfo& localPaintingInfo, 1132 const PaintLayerPaintingInfo& localPaintingInfo,
1133 PaintLayerFlags paintFlags) { 1133 PaintLayerFlags paintFlags) {
1134 Optional<DisplayItemCacheSkipper> cacheSkipper; 1134 Optional<DisplayItemCacheSkipper> cacheSkipper;
1135 if (layerFragments.size() > 1) 1135 if (layerFragments.size() > 1)
1136 cacheSkipper.emplace(context); 1136 cacheSkipper.emplace(context);
1137 1137
1138 Optional<ScopedPaintChunkProperties> scopedPaintChunkProperties;
1139 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
1140 const auto* objectPaintProperties =
1141 m_paintLayer.layoutObject()->paintProperties();
1142 DCHECK(objectPaintProperties && objectPaintProperties->maskContent());
1143 PaintChunkProperties properties(
1144 context.getPaintController().currentPaintChunkProperties());
1145 properties.propertyTreeState.setEffect(
1146 objectPaintProperties->maskContent());
1147 scopedPaintChunkProperties.emplace(context.getPaintController(),
1148 m_paintLayer, properties);
1149 }
1150
1138 for (auto& fragment : layerFragments) 1151 for (auto& fragment : layerFragments)
1139 paintFragmentWithPhase(PaintPhaseMask, fragment, context, 1152 paintFragmentWithPhase(PaintPhaseMask, fragment, context,
1140 fragment.backgroundRect, localPaintingInfo, 1153 fragment.backgroundRect, localPaintingInfo,
1141 paintFlags, HasNotClipped); 1154 paintFlags, HasNotClipped);
1142 } 1155 }
1143 1156
1144 void PaintLayerPainter::paintChildClippingMaskForFragments( 1157 void PaintLayerPainter::paintChildClippingMaskForFragments(
1145 const PaintLayerFragments& layerFragments, 1158 const PaintLayerFragments& layerFragments,
1146 GraphicsContext& context, 1159 GraphicsContext& context,
1147 const PaintLayerPaintingInfo& localPaintingInfo, 1160 const PaintLayerPaintingInfo& localPaintingInfo,
(...skipping 30 matching lines...) Expand all
1178 context, layoutObject, PaintPhaseClippingMask)) 1191 context, layoutObject, PaintPhaseClippingMask))
1179 return; 1192 return;
1180 1193
1181 IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect()); 1194 IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect());
1182 LayoutObjectDrawingRecorder drawingRecorder( 1195 LayoutObjectDrawingRecorder drawingRecorder(
1183 context, layoutObject, PaintPhaseClippingMask, snappedClipRect); 1196 context, layoutObject, PaintPhaseClippingMask, snappedClipRect);
1184 context.fillRect(snappedClipRect, Color::black); 1197 context.fillRect(snappedClipRect, Color::black);
1185 } 1198 }
1186 1199
1187 } // namespace blink 1200 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698