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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 if (context->displayItemList()->lastDisplayItemIsNoopBegin()) | 105 if (context->displayItemList()->lastDisplayItemIsNoopBegin()) |
106 context->displayItemList()->removeLastDisplayItem(); | 106 context->displayItemList()->removeLastDisplayItem(); |
107 else | 107 else |
108 context->displayItemList()->add(EndClipPathDisplayItem::crea
te(target)); | 108 context->displayItemList()->createAndAppend<EndClipPathDispl
ayItem>(target); |
109 } | 109 } |
110 } else { | 110 } else { |
111 EndClipPathDisplayItem endClipPathDisplayItem(target); | 111 EndClipPathDisplayItem endClipPathDisplayItem(target); |
112 endClipPathDisplayItem.replay(*context); | 112 endClipPathDisplayItem.replay(*context); |
113 } | 113 } |
114 break; | 114 break; |
115 case ClipperAppliedMask: | 115 case ClipperAppliedMask: |
116 // Transfer content -> clip mask (SrcIn) | 116 // Transfer content -> clip mask (SrcIn) |
117 CompositingRecorder::endCompositing(*context, target); | 117 CompositingRecorder::endCompositing(*context, target); |
118 | 118 |
(...skipping 16 matching lines...) Expand all Loading... |
135 if (drawingRecorder.canUseCachedDrawing()) | 135 if (drawingRecorder.canUseCachedDrawing()) |
136 return; | 136 return; |
137 | 137 |
138 context->save(); | 138 context->save(); |
139 context->concatCTM(contentTransformation); | 139 context->concatCTM(contentTransformation); |
140 context->drawPicture(clipContentPicture.get()); | 140 context->drawPicture(clipContentPicture.get()); |
141 context->restore(); | 141 context->restore(); |
142 } | 142 } |
143 | 143 |
144 } | 144 } |
OLD | NEW |