OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> | 2 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> |
3 * Copyright (C) 2006, 2009 Apple Inc. All rights reserved. | 3 * Copyright (C) 2006, 2009 Apple Inc. All rights reserved. |
4 * Copyright (C) 2007 Rob Buis <buis@kde.org> | 4 * Copyright (C) 2007 Rob Buis <buis@kde.org> |
5 * Copyright (C) 2009 Google, Inc. | 5 * Copyright (C) 2009 Google, Inc. |
6 * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com> | 6 * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com> |
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 18 matching lines...) Expand all Loading... |
29 class SkPicture; | 29 class SkPicture; |
30 | 30 |
31 namespace blink { | 31 namespace blink { |
32 | 32 |
33 class LayoutImageResource; | 33 class LayoutImageResource; |
34 class SVGImageElement; | 34 class SVGImageElement; |
35 | 35 |
36 class LayoutSVGImage final : public LayoutSVGModelObject { | 36 class LayoutSVGImage final : public LayoutSVGModelObject { |
37 public: | 37 public: |
38 explicit LayoutSVGImage(SVGImageElement*); | 38 explicit LayoutSVGImage(SVGImageElement*); |
39 virtual ~LayoutSVGImage(); | 39 ~LayoutSVGImage() override; |
40 | 40 |
41 virtual void setNeedsBoundariesUpdate() override { m_needsBoundariesUpdate =
true; } | 41 void setNeedsBoundariesUpdate() override { m_needsBoundariesUpdate = true; } |
42 virtual void setNeedsTransformUpdate() override { m_needsTransformUpdate = t
rue; } | 42 void setNeedsTransformUpdate() override { m_needsTransformUpdate = true; } |
43 | 43 |
44 LayoutImageResource* imageResource() { return m_imageResource.get(); } | 44 LayoutImageResource* imageResource() { return m_imageResource.get(); } |
45 | 45 |
46 virtual const AffineTransform& localToParentTransform() const override { ret
urn m_localTransform; } | 46 const AffineTransform& localToParentTransform() const override { return m_lo
calTransform; } |
47 RefPtr<const SkPicture>& bufferedForeground() { return m_bufferedForeground;
} | 47 RefPtr<const SkPicture>& bufferedForeground() { return m_bufferedForeground;
} |
48 | 48 |
49 virtual FloatRect objectBoundingBox() const override { return m_objectBoundi
ngBox; } | 49 FloatRect objectBoundingBox() const override { return m_objectBoundingBox; } |
50 virtual bool isOfType(LayoutObjectType type) const override { return type ==
LayoutObjectSVGImage || LayoutSVGModelObject::isOfType(type); } | 50 bool isOfType(LayoutObjectType type) const override { return type == LayoutO
bjectSVGImage || LayoutSVGModelObject::isOfType(type); } |
51 | 51 |
52 virtual const char* name() const override { return "LayoutSVGImage"; } | 52 const char* name() const override { return "LayoutSVGImage"; } |
53 | 53 |
54 protected: | 54 protected: |
55 virtual void willBeDestroyed() override; | 55 void willBeDestroyed() override; |
56 | 56 |
57 private: | 57 private: |
58 virtual FloatRect strokeBoundingBox() const override { return m_objectBoundi
ngBox; } | 58 FloatRect strokeBoundingBox() const override { return m_objectBoundingBox; } |
59 | 59 |
60 virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint& addit
ionalOffset) const override; | 60 void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint& additionalOff
set) const override; |
61 | 61 |
62 virtual void imageChanged(WrappedImagePtr, const IntRect* = nullptr) overrid
e; | 62 void imageChanged(WrappedImagePtr, const IntRect* = nullptr) override; |
63 | 63 |
64 virtual void layout() override; | 64 void layout() override; |
65 virtual void paint(const PaintInfo&, const LayoutPoint&) override; | 65 void paint(const PaintInfo&, const LayoutPoint&) override; |
66 | 66 |
67 void updateBoundingBox(); | 67 void updateBoundingBox(); |
68 void updateImageContainerSize(); | 68 void updateImageContainerSize(); |
69 FloatSize computeImageViewportSize(ImageResource&) const; | 69 FloatSize computeImageViewportSize(ImageResource&) const; |
70 | 70 |
71 virtual bool nodeAtFloatPoint(HitTestResult&, const FloatPoint& pointInParen
t, HitTestAction) override; | 71 bool nodeAtFloatPoint(HitTestResult&, const FloatPoint& pointInParent, HitTe
stAction) override; |
72 | 72 |
73 virtual AffineTransform localTransform() const override { return m_localTran
sform; } | 73 AffineTransform localTransform() const override { return m_localTransform; } |
74 | 74 |
75 bool m_needsBoundariesUpdate : 1; | 75 bool m_needsBoundariesUpdate : 1; |
76 bool m_needsTransformUpdate : 1; | 76 bool m_needsTransformUpdate : 1; |
77 AffineTransform m_localTransform; | 77 AffineTransform m_localTransform; |
78 FloatRect m_objectBoundingBox; | 78 FloatRect m_objectBoundingBox; |
79 OwnPtr<LayoutImageResource> m_imageResource; | 79 OwnPtr<LayoutImageResource> m_imageResource; |
80 | 80 |
81 RefPtr<const SkPicture> m_bufferedForeground; | 81 RefPtr<const SkPicture> m_bufferedForeground; |
82 }; | 82 }; |
83 | 83 |
84 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutSVGImage, isSVGImage()); | 84 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutSVGImage, isSVGImage()); |
85 | 85 |
86 } // namespace blink | 86 } // namespace blink |
87 | 87 |
88 #endif // LayoutSVGImage_h | 88 #endif // LayoutSVGImage_h |
OLD | NEW |