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

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

Issue 463883003: Rename repaint to paintInvalidation in core/rendering/svg. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 | « Source/core/rendering/svg/RenderSVGImage.h ('k') | Source/core/rendering/svg/RenderSVGInline.h » ('j') | 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 98
99 updateImageViewport(); 99 updateImageViewport();
100 100
101 bool transformOrBoundariesUpdate = m_needsTransformUpdate || m_needsBoundari esUpdate; 101 bool transformOrBoundariesUpdate = m_needsTransformUpdate || m_needsBoundari esUpdate;
102 if (m_needsTransformUpdate) { 102 if (m_needsTransformUpdate) {
103 m_localTransform = toSVGImageElement(element())->animatedLocalTransform( ); 103 m_localTransform = toSVGImageElement(element())->animatedLocalTransform( );
104 m_needsTransformUpdate = false; 104 m_needsTransformUpdate = false;
105 } 105 }
106 106
107 if (m_needsBoundariesUpdate) { 107 if (m_needsBoundariesUpdate) {
108 m_repaintBoundingBox = m_objectBoundingBox; 108 m_paintInvalidationBoundingBox = m_objectBoundingBox;
109 SVGRenderSupport::intersectRepaintRectWithResources(this, m_repaintBound ingBox); 109 SVGRenderSupport::intersectPaintInvalidationRectWithResources(this, m_pa intInvalidationBoundingBox);
110 110
111 m_needsBoundariesUpdate = false; 111 m_needsBoundariesUpdate = false;
112 } 112 }
113 113
114 // Invalidate all resources of this client if our layout changed. 114 // Invalidate all resources of this client if our layout changed.
115 if (everHadLayout() && selfNeedsLayout()) 115 if (everHadLayout() && selfNeedsLayout())
116 SVGResourcesCache::clientLayoutChanged(this); 116 SVGResourcesCache::clientLayoutChanged(this);
117 117
118 // If our bounds changed, notify the parents. 118 // If our bounds changed, notify the parents.
119 if (transformOrBoundariesUpdate) 119 if (transformOrBoundariesUpdate)
120 RenderSVGModelObject::setNeedsBoundariesUpdate(); 120 RenderSVGModelObject::setNeedsBoundariesUpdate();
121 121
122 clearNeedsLayout(); 122 clearNeedsLayout();
123 } 123 }
124 124
125 void RenderSVGImage::paint(PaintInfo& paintInfo, const LayoutPoint&) 125 void RenderSVGImage::paint(PaintInfo& paintInfo, const LayoutPoint&)
126 { 126 {
127 ANNOTATE_GRAPHICS_CONTEXT(paintInfo, this); 127 ANNOTATE_GRAPHICS_CONTEXT(paintInfo, this);
128 128
129 if (paintInfo.phase != PaintPhaseForeground 129 if (paintInfo.phase != PaintPhaseForeground
130 || style()->visibility() == HIDDEN 130 || style()->visibility() == HIDDEN
131 || !m_imageResource->hasImage()) 131 || !m_imageResource->hasImage())
132 return; 132 return;
133 133
134 FloatRect boundingBox = paintInvalidationRectInLocalCoordinates(); 134 FloatRect boundingBox = paintInvalidationRectInLocalCoordinates();
135 if (!SVGRenderSupport::paintInfoIntersectsRepaintRect(boundingBox, m_localTr ansform, paintInfo)) 135 if (!SVGRenderSupport::paintInfoIntersectsPaintInvalidationRect(boundingBox, m_localTransform, paintInfo))
136 return; 136 return;
137 137
138 PaintInfo childPaintInfo(paintInfo); 138 PaintInfo childPaintInfo(paintInfo);
139 GraphicsContextStateSaver stateSaver(*childPaintInfo.context, false); 139 GraphicsContextStateSaver stateSaver(*childPaintInfo.context, false);
140 140
141 if (!m_localTransform.isIdentity()) { 141 if (!m_localTransform.isIdentity()) {
142 stateSaver.save(); 142 stateSaver.save();
143 childPaintInfo.applyTransform(m_localTransform, false); 143 childPaintInfo.applyTransform(m_localTransform, false);
144 } 144 }
145 if (!m_objectBoundingBox.isEmpty()) { 145 if (!m_objectBoundingBox.isEmpty()) {
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 229
230 void RenderSVGImage::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint &, const RenderLayerModelObject*) const 230 void RenderSVGImage::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint &, const RenderLayerModelObject*) const
231 { 231 {
232 // this is called from paint() after the localTransform has already been app lied 232 // this is called from paint() after the localTransform has already been app lied
233 IntRect contentRect = enclosingIntRect(paintInvalidationRectInLocalCoordinat es()); 233 IntRect contentRect = enclosingIntRect(paintInvalidationRectInLocalCoordinat es());
234 if (!contentRect.isEmpty()) 234 if (!contentRect.isEmpty())
235 rects.append(contentRect); 235 rects.append(contentRect);
236 } 236 }
237 237
238 } // namespace blink 238 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/RenderSVGImage.h ('k') | Source/core/rendering/svg/RenderSVGInline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698