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

Side by Side Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGImage.cpp

Issue 2469873002: [ImageResource 4] Split ImageResource into Resource and Image parts (Closed)
Patch Set: style Created 4 years 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 /* 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 const FloatSize& intrinsicRatio) { 61 const FloatSize& intrinsicRatio) {
62 return height * intrinsicRatio.width() / intrinsicRatio.height(); 62 return height * intrinsicRatio.width() / intrinsicRatio.height();
63 } 63 }
64 64
65 static float resolveHeightForRatio(float width, 65 static float resolveHeightForRatio(float width,
66 const FloatSize& intrinsicRatio) { 66 const FloatSize& intrinsicRatio) {
67 return width * intrinsicRatio.height() / intrinsicRatio.width(); 67 return width * intrinsicRatio.height() / intrinsicRatio.width();
68 } 68 }
69 69
70 FloatSize LayoutSVGImage::calculateObjectSize() const { 70 FloatSize LayoutSVGImage::calculateObjectSize() const {
71 ImageResource* cachedImage = m_imageResource->cachedImage(); 71 ImageResourceContent* cachedImage = m_imageResource->cachedImage();
72 if (!cachedImage || cachedImage->errorOccurred()) 72 if (!cachedImage || cachedImage->errorOccurred())
73 return m_objectBoundingBox.size(); 73 return m_objectBoundingBox.size();
74 74
75 FloatSize intrinsicSize = FloatSize(cachedImage->getImage()->size()); 75 FloatSize intrinsicSize = FloatSize(cachedImage->getImage()->size());
76 if (styleRef().width().isAuto() && styleRef().height().isAuto()) 76 if (styleRef().width().isAuto() && styleRef().height().isAuto())
77 return intrinsicSize; 77 return intrinsicSize;
78 78
79 if (styleRef().height().isAuto()) 79 if (styleRef().height().isAuto())
80 return FloatSize( 80 return FloatSize(
81 m_objectBoundingBox.width(), 81 m_objectBoundingBox.width(),
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 202
203 void LayoutSVGImage::addOutlineRects(Vector<LayoutRect>& rects, 203 void LayoutSVGImage::addOutlineRects(Vector<LayoutRect>& rects,
204 const LayoutPoint&, 204 const LayoutPoint&,
205 IncludeBlockVisualOverflowOrNot) const { 205 IncludeBlockVisualOverflowOrNot) const {
206 // this is called from paint() after the localTransform has already been 206 // this is called from paint() after the localTransform has already been
207 // applied 207 // applied
208 rects.append(LayoutRect(visualRectInLocalSVGCoordinates())); 208 rects.append(LayoutRect(visualRectInLocalSVGCoordinates()));
209 } 209 }
210 210
211 } // namespace blink 211 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/shapes/ShapeOutsideInfo.cpp ('k') | third_party/WebKit/Source/core/loader/ImageLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698