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

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

Issue 2375043002: Fix up that no render SVG shape when change clip-path to visible after hidden. (Closed)
Patch Set: Issue 590153 Created 4 years, 1 month 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/SVGShapePainter.h" 5 #include "core/paint/SVGShapePainter.h"
6 6
7 #include "core/layout/svg/LayoutSVGResourceMarker.h" 7 #include "core/layout/svg/LayoutSVGResourceMarker.h"
8 #include "core/layout/svg/LayoutSVGShape.h" 8 #include "core/layout/svg/LayoutSVGShape.h"
9 #include "core/layout/svg/SVGLayoutSupport.h" 9 #include "core/layout/svg/SVGLayoutSupport.h"
10 #include "core/layout/svg/SVGMarkerData.h" 10 #include "core/layout/svg/SVGMarkerData.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 } 44 }
45 45
46 void SVGShapePainter::paint(const PaintInfo& paintInfo) { 46 void SVGShapePainter::paint(const PaintInfo& paintInfo) {
47 if (paintInfo.phase != PaintPhaseForeground || 47 if (paintInfo.phase != PaintPhaseForeground ||
48 m_layoutSVGShape.style()->visibility() != EVisibility::Visible || 48 m_layoutSVGShape.style()->visibility() != EVisibility::Visible ||
49 m_layoutSVGShape.isShapeEmpty()) 49 m_layoutSVGShape.isShapeEmpty())
50 return; 50 return;
51 51
52 FloatRect boundingBox = 52 FloatRect boundingBox =
53 m_layoutSVGShape.paintInvalidationRectInLocalSVGCoordinates(); 53 m_layoutSVGShape.paintInvalidationRectInLocalSVGCoordinates();
54 if (!paintInfo.cullRect().intersectsCullRect(
55 m_layoutSVGShape.localSVGTransform(), boundingBox))
56 return;
57 54
58 PaintInfo paintInfoBeforeFiltering(paintInfo); 55 PaintInfo paintInfoBeforeFiltering(paintInfo);
59 // Shapes cannot have children so do not call updateCullRect. 56 // Shapes cannot have children so do not call updateCullRect.
60 SVGTransformContext transformContext(paintInfoBeforeFiltering.context, 57 SVGTransformContext transformContext(paintInfoBeforeFiltering.context,
61 m_layoutSVGShape, 58 m_layoutSVGShape,
62 m_layoutSVGShape.localSVGTransform()); 59 m_layoutSVGShape.localSVGTransform());
63 { 60 {
64 SVGPaintContext paintContext(m_layoutSVGShape, paintInfoBeforeFiltering); 61 SVGPaintContext paintContext(m_layoutSVGShape, paintInfoBeforeFiltering);
65 if (paintContext.applyClipMaskAndFilterIfNecessary() && 62 if (paintContext.applyClipMaskAndFilterIfNecessary() &&
66 !LayoutObjectDrawingRecorder::useCachedDrawingIfPossible( 63 !LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 paintMarkers(paintContext.paintInfo(), boundingBox); 124 paintMarkers(paintContext.paintInfo(), boundingBox);
128 break; 125 break;
129 default: 126 default:
130 ASSERT_NOT_REACHED(); 127 ASSERT_NOT_REACHED();
131 break; 128 break;
132 } 129 }
133 } 130 }
134 } 131 }
135 } 132 }
136 133
134 if (!paintInfo.cullRect().intersectsCullRect(
fs 2016/10/31 09:59:22 This does not look like the right fix. Here you're
hyunjunekim2 2016/10/31 13:18:30 I will check it for the right fix.
135 m_layoutSVGShape.localSVGTransform(), boundingBox))
136 return;
137
137 if (m_layoutSVGShape.style()->outlineWidth()) { 138 if (m_layoutSVGShape.style()->outlineWidth()) {
138 PaintInfo outlinePaintInfo(paintInfoBeforeFiltering); 139 PaintInfo outlinePaintInfo(paintInfoBeforeFiltering);
139 outlinePaintInfo.phase = PaintPhaseSelfOutlineOnly; 140 outlinePaintInfo.phase = PaintPhaseSelfOutlineOnly;
140 ObjectPainter(m_layoutSVGShape) 141 ObjectPainter(m_layoutSVGShape)
141 .paintOutline(outlinePaintInfo, LayoutPoint(boundingBox.location())); 142 .paintOutline(outlinePaintInfo, LayoutPoint(boundingBox.location()));
142 } 143 }
143 } 144 }
144 145
145 class PathWithTemporaryWindingRule { 146 class PathWithTemporaryWindingRule {
146 public: 147 public:
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 marker.markerTransformation(position.origin, position.angle, 248 marker.markerTransformation(position.origin, position.angle,
248 strokeWidth)); 249 strokeWidth));
249 Optional<FloatClipRecorder> clipRecorder; 250 Optional<FloatClipRecorder> clipRecorder;
250 if (SVGLayoutSupport::isOverflowHidden(&marker)) 251 if (SVGLayoutSupport::isOverflowHidden(&marker))
251 clipRecorder.emplace(paintInfo.context, marker, paintInfo.phase, 252 clipRecorder.emplace(paintInfo.context, marker, paintInfo.phase,
252 marker.viewport()); 253 marker.viewport());
253 SVGContainerPainter(marker).paint(paintInfo); 254 SVGContainerPainter(marker).paint(paintInfo);
254 } 255 }
255 256
256 } // namespace blink 257 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698