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

Side by Side Diff: Source/core/svg/graphics/filters/SVGFEImage.cpp

Issue 1127773003: This CL clean up patch in SVGElements. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « Source/core/svg/graphics/SVGImage.cpp ('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) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
4 * Copyright (C) 2005 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2010 Dirk Schulze <krit@webkit.org> 5 * Copyright (C) 2010 Dirk Schulze <krit@webkit.org>
6 * Copyright (C) 2013 Google Inc. All rights reserved. 6 * Copyright (C) 2013 Google Inc. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 } 125 }
126 126
127 destRect.intersect(requestedRect); 127 destRect.intersect(requestedRect);
128 addAbsolutePaintRect(destRect); 128 addAbsolutePaintRect(destRect);
129 return destRect; 129 return destRect;
130 } 130 }
131 131
132 LayoutObject* FEImage::referencedLayoutObject() const 132 LayoutObject* FEImage::referencedLayoutObject() const
133 { 133 {
134 if (!m_treeScope) 134 if (!m_treeScope)
135 return 0; 135 return nullptr;
136 Element* hrefElement = SVGURIReference::targetElementFromIRIString(m_href, * m_treeScope); 136 Element* hrefElement = SVGURIReference::targetElementFromIRIString(m_href, * m_treeScope);
137 if (!hrefElement || !hrefElement->isSVGElement()) 137 if (!hrefElement || !hrefElement->isSVGElement())
138 return 0; 138 return nullptr;
139 return hrefElement->layoutObject(); 139 return hrefElement->layoutObject();
140 } 140 }
141 141
142 TextStream& FEImage::externalRepresentation(TextStream& ts, int indent) const 142 TextStream& FEImage::externalRepresentation(TextStream& ts, int indent) const
143 { 143 {
144 IntSize imageSize; 144 IntSize imageSize;
145 if (m_image) 145 if (m_image)
146 imageSize = m_image->size(); 146 imageSize = m_image->size();
147 else if (LayoutObject* layoutObject = referencedLayoutObject()) 147 else if (LayoutObject* layoutObject = referencedLayoutObject())
148 imageSize = enclosingIntRect(getLayoutObjectRepaintRect(layoutObject)).s ize(); 148 imageSize = enclosingIntRect(getLayoutObjectRepaintRect(layoutObject)).s ize();
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 m_preserveAspectRatio->transformRect(dstRect, srcRect); 204 m_preserveAspectRatio->transformRect(dstRect, srcRect);
205 205
206 SkBitmap bitmap; 206 SkBitmap bitmap;
207 if (!m_image->bitmapForCurrentFrame(&bitmap)) 207 if (!m_image->bitmapForCurrentFrame(&bitmap))
208 return adoptRef(SkBitmapSource::Create(SkBitmap())); 208 return adoptRef(SkBitmapSource::Create(SkBitmap()));
209 209
210 return adoptRef(SkBitmapSource::Create(bitmap, srcRect, dstRect)); 210 return adoptRef(SkBitmapSource::Create(bitmap, srcRect, dstRect));
211 } 211 }
212 212
213 } // namespace blink 213 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/svg/graphics/SVGImage.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698