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

Side by Side Diff: Source/core/rendering/svg/RenderSVGImage.cpp

Issue 140783011: Merge 164536 "Avoid drawing SVG image content when the image is ..." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/1700/
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « LayoutTests/svg/as-image/zero-size-buffered-image-nopaint-expected.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> 2 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org>
3 * Copyright (C) 2006 Apple Computer, Inc. 3 * Copyright (C) 2006 Apple Computer, Inc.
4 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> 4 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
5 * Copyright (C) 2007, 2008, 2009 Rob Buis <buis@kde.org> 5 * Copyright (C) 2007, 2008, 2009 Rob Buis <buis@kde.org>
6 * Copyright (C) 2009 Google, Inc. 6 * Copyright (C) 2009 Google, Inc.
7 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 7 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
8 * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com> 8 * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com>
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 FloatRect boundingBox = repaintRectInLocalCoordinates(); 130 FloatRect boundingBox = repaintRectInLocalCoordinates();
131 if (!SVGRenderSupport::paintInfoIntersectsRepaintRect(boundingBox, m_localTr ansform, paintInfo)) 131 if (!SVGRenderSupport::paintInfoIntersectsRepaintRect(boundingBox, m_localTr ansform, paintInfo))
132 return; 132 return;
133 133
134 PaintInfo childPaintInfo(paintInfo); 134 PaintInfo childPaintInfo(paintInfo);
135 bool drawsOutline = style()->outlineWidth() && (childPaintInfo.phase == Pain tPhaseOutline || childPaintInfo.phase == PaintPhaseSelfOutline); 135 bool drawsOutline = style()->outlineWidth() && (childPaintInfo.phase == Pain tPhaseOutline || childPaintInfo.phase == PaintPhaseSelfOutline);
136 if (drawsOutline || childPaintInfo.phase == PaintPhaseForeground) { 136 if (drawsOutline || childPaintInfo.phase == PaintPhaseForeground) {
137 GraphicsContextStateSaver stateSaver(*childPaintInfo.context); 137 GraphicsContextStateSaver stateSaver(*childPaintInfo.context);
138 childPaintInfo.applyTransform(m_localTransform); 138 childPaintInfo.applyTransform(m_localTransform);
139 139
140 if (childPaintInfo.phase == PaintPhaseForeground) { 140 if (childPaintInfo.phase == PaintPhaseForeground && !m_objectBoundingBox .isEmpty()) {
141 SVGRenderingContext renderingContext(this, childPaintInfo); 141 SVGRenderingContext renderingContext(this, childPaintInfo);
142 142
143 if (renderingContext.isRenderingPrepared()) { 143 if (renderingContext.isRenderingPrepared()) {
144 if (style()->svgStyle()->bufferedRendering() == BR_STATIC && re nderingContext.bufferForeground(m_bufferedForeground)) 144 if (style()->svgStyle()->bufferedRendering() == BR_STATIC && ren deringContext.bufferForeground(m_bufferedForeground))
145 return; 145 return;
146 146
147 paintForeground(childPaintInfo); 147 paintForeground(childPaintInfo);
148 } 148 }
149 } 149 }
150 150
151 if (drawsOutline) 151 if (drawsOutline)
152 paintOutline(childPaintInfo, IntRect(boundingBox)); 152 paintOutline(childPaintInfo, IntRect(boundingBox));
153 } 153 }
154 } 154 }
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 221
222 void RenderSVGImage::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint &, const RenderLayerModelObject*) 222 void RenderSVGImage::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint &, const RenderLayerModelObject*)
223 { 223 {
224 // this is called from paint() after the localTransform has already been app lied 224 // this is called from paint() after the localTransform has already been app lied
225 IntRect contentRect = enclosingIntRect(repaintRectInLocalCoordinates()); 225 IntRect contentRect = enclosingIntRect(repaintRectInLocalCoordinates());
226 if (!contentRect.isEmpty()) 226 if (!contentRect.isEmpty())
227 rects.append(contentRect); 227 rects.append(contentRect);
228 } 228 }
229 229
230 } // namespace WebCore 230 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/svg/as-image/zero-size-buffered-image-nopaint-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698