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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutImageResource.h

Issue 1427943002: Wrap SVGImage for container during paint (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 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 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll <knoll@kde.org> 2 * Copyright (C) 1999 Lars Knoll <knoll@kde.org>
3 * Copyright (C) 1999 Antti Koivisto <koivisto@kde.org> 3 * Copyright (C) 1999 Antti Koivisto <koivisto@kde.org>
4 * Copyright (C) 2006 Allan Sandfeld Jensen <kde@carewolf.com> 4 * Copyright (C) 2006 Allan Sandfeld Jensen <kde@carewolf.com>
5 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> 5 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com> 7 * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com>
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 virtual void initialize(LayoutObject*); 48 virtual void initialize(LayoutObject*);
49 virtual void shutdown(); 49 virtual void shutdown();
50 50
51 void setImageResource(ImageResource*); 51 void setImageResource(ImageResource*);
52 ImageResource* cachedImage() const { return m_cachedImage.get(); } 52 ImageResource* cachedImage() const { return m_cachedImage.get(); }
53 virtual bool hasImage() const { return m_cachedImage; } 53 virtual bool hasImage() const { return m_cachedImage; }
54 54
55 void resetAnimation(); 55 void resetAnimation();
56 bool maybeAnimated() const; 56 bool maybeAnimated() const;
57 57
58 virtual PassRefPtr<Image> image(const IntSize&) const 58 virtual PassRefPtr<Image> image(const IntSize&, float) const;
59 {
60 return m_cachedImage ? m_cachedImage->imageForLayoutObject(m_layoutObjec t) : Image::nullImage();
61 }
62 virtual bool errorOccurred() const { return m_cachedImage && m_cachedImage-> errorOccurred(); } 59 virtual bool errorOccurred() const { return m_cachedImage && m_cachedImage-> errorOccurred(); }
63 60
64 virtual void setContainerSizeForLayoutObject(const IntSize&);
65 virtual bool imageHasRelativeWidth() const { return m_cachedImage ? m_cached Image->imageHasRelativeWidth() : false; } 61 virtual bool imageHasRelativeWidth() const { return m_cachedImage ? m_cached Image->imageHasRelativeWidth() : false; }
66 virtual bool imageHasRelativeHeight() const { return m_cachedImage ? m_cache dImage->imageHasRelativeHeight() : false; } 62 virtual bool imageHasRelativeHeight() const { return m_cachedImage ? m_cache dImage->imageHasRelativeHeight() : false; }
67 63
68 virtual LayoutSize imageSize(float multiplier) const { return getImageSize(m ultiplier, ImageResource::NormalSize); } 64 virtual LayoutSize imageSize(float multiplier) const;
69 virtual LayoutSize intrinsicSize(float multiplier) const { return getImageSi ze(multiplier, ImageResource::IntrinsicSize); }
fs 2015/11/16 15:08:07 (I guess this choice of keeping imageSize over int
davve 2015/11/16 16:32:40 Yes, but I could go the other way too. imageSize s
70 65
71 virtual WrappedImagePtr imagePtr() const { return m_cachedImage.get(); } 66 virtual WrappedImagePtr imagePtr() const { return m_cachedImage.get(); }
72 67
73 DEFINE_INLINE_VIRTUAL_TRACE() { } 68 DEFINE_INLINE_VIRTUAL_TRACE() { }
74 69
75 protected: 70 protected:
76 LayoutImageResource(); 71 LayoutImageResource();
77 LayoutObject* m_layoutObject; 72 LayoutObject* m_layoutObject;
78 ResourcePtr<ImageResource> m_cachedImage; 73 ResourcePtr<ImageResource> m_cachedImage;
79
80 private:
81 LayoutSize getImageSize(float multiplier, ImageResource::SizeType) const;
82 }; 74 };
83 75
84 } // namespace blink 76 } // namespace blink
85 77
86 #endif // LayoutImage_h 78 #endif // LayoutImage_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698