| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/SVGMaskPainter.h" | 6 #include "core/paint/SVGMaskPainter.h" |
| 7 | 7 |
| 8 #include "core/layout/svg/LayoutSVGResourceMasker.h" | 8 #include "core/layout/svg/LayoutSVGResourceMasker.h" |
| 9 #include "core/paint/CompositingRecorder.h" | 9 #include "core/paint/CompositingRecorder.h" |
| 10 #include "core/paint/LayoutObjectDrawingRecorder.h" | 10 #include "core/paint/LayoutObjectDrawingRecorder.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 } | 67 } |
| 68 | 68 |
| 69 void SVGMaskPainter::drawMaskForLayoutObject(GraphicsContext* context, const Lay
outObject& layoutObject, const FloatRect& targetBoundingBox) | 69 void SVGMaskPainter::drawMaskForLayoutObject(GraphicsContext* context, const Lay
outObject& layoutObject, const FloatRect& targetBoundingBox) |
| 70 { | 70 { |
| 71 ASSERT(context); | 71 ASSERT(context); |
| 72 | 72 |
| 73 AffineTransform contentTransformation; | 73 AffineTransform contentTransformation; |
| 74 RefPtr<const SkPicture> maskContentPicture = m_mask.createContentPicture(con
tentTransformation, targetBoundingBox); | 74 RefPtr<const SkPicture> maskContentPicture = m_mask.createContentPicture(con
tentTransformation, targetBoundingBox); |
| 75 | 75 |
| 76 TransformRecorder recorder(*context, layoutObject, contentTransformation); | 76 TransformRecorder recorder(*context, layoutObject, contentTransformation); |
| 77 | 77 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { |
| 78 LayoutObjectDrawingRecorder drawingRecorder(*context, layoutObject, DisplayI
tem::SVGMask, LayoutRect::infiniteIntRect()); | 78 ASSERT(context->displayItemList()); |
| 79 if (!drawingRecorder.canUseCachedDrawing()) | 79 if (context->displayItemList()->displayItemConstructionIsDisabled()) |
| 80 context->drawPicture(maskContentPicture.get()); | 80 return; |
| 81 context->displayItemList()->add(DrawingDisplayItem::create(layoutObject,
DisplayItem::SVGMask, maskContentPicture)); |
| 82 } else { |
| 83 DrawingDisplayItem maskPicture(layoutObject, DisplayItem::SVGClip, maskC
ontentPicture); |
| 84 maskPicture.replay(*context); |
| 85 } |
| 81 } | 86 } |
| 82 | 87 |
| 83 } | 88 } |
| OLD | NEW |