| 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/SVGClipPainter.h" | 6 #include "core/paint/SVGClipPainter.h" |
| 7 | 7 |
| 8 #include "core/dom/ElementTraversal.h" | 8 #include "core/dom/ElementTraversal.h" |
| 9 #include "core/layout/svg/LayoutSVGResourceClipper.h" | 9 #include "core/layout/svg/LayoutSVGResourceClipper.h" |
| 10 #include "core/layout/svg/SVGResources.h" | 10 #include "core/layout/svg/SVGResources.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 94 |
| 95 return true; | 95 return true; |
| 96 } | 96 } |
| 97 | 97 |
| 98 void SVGClipPainter::postApplyStatefulResource(const LayoutObject& target, Graph
icsContext* context, ClipperState& clipperState) | 98 void SVGClipPainter::postApplyStatefulResource(const LayoutObject& target, Graph
icsContext* context, ClipperState& clipperState) |
| 99 { | 99 { |
| 100 switch (clipperState) { | 100 switch (clipperState) { |
| 101 case ClipperAppliedPath: | 101 case ClipperAppliedPath: |
| 102 // Path-only clipping, no layers to restore but we need to emit an end t
o the clip path display item. | 102 // Path-only clipping, no layers to restore but we need to emit an end t
o the clip path display item. |
| 103 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { | 103 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { |
| 104 if (context->displayItemList()->displayItemConstructionIsDisabled()) | 104 if (!context->displayItemList()->displayItemConstructionIsDisabled()
) |
| 105 return; | 105 context->displayItemList()->createAndAppendIfNeeded<EndClipPathD
isplayItem>(target); |
| 106 context->displayItemList()->add(EndClipPathDisplayItem::create(targe
t)); | |
| 107 } else { | 106 } else { |
| 108 EndClipPathDisplayItem endClipPathDisplayItem(target); | 107 EndClipPathDisplayItem endClipPathDisplayItem(target); |
| 109 endClipPathDisplayItem.replay(*context); | 108 endClipPathDisplayItem.replay(*context); |
| 110 } | 109 } |
| 111 break; | 110 break; |
| 112 case ClipperAppliedMask: | 111 case ClipperAppliedMask: |
| 113 // Transfer content -> clip mask (SrcIn) | 112 // Transfer content -> clip mask (SrcIn) |
| 114 CompositingRecorder::endCompositing(*context, target); | 113 CompositingRecorder::endCompositing(*context, target); |
| 115 | 114 |
| 116 // Transfer clip mask -> bg (SrcOver) | 115 // Transfer clip mask -> bg (SrcOver) |
| (...skipping 15 matching lines...) Expand all Loading... |
| 132 if (drawingRecorder.canUseCachedDrawing()) | 131 if (drawingRecorder.canUseCachedDrawing()) |
| 133 return; | 132 return; |
| 134 | 133 |
| 135 context->save(); | 134 context->save(); |
| 136 context->concatCTM(contentTransformation); | 135 context->concatCTM(contentTransformation); |
| 137 context->drawPicture(clipContentPicture.get()); | 136 context->drawPicture(clipContentPicture.get()); |
| 138 context->restore(); | 137 context->restore(); |
| 139 } | 138 } |
| 140 | 139 |
| 141 } | 140 } |
| OLD | NEW |