| 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 |
| 11 * version 2 of the License, or (at your option) any later version. | 11 * version 2 of the License, or (at your option) any later version. |
| 12 * | 12 * |
| 13 * This library is distributed in the hope that it will be useful, | 13 * This library is distributed in the hope that it will be useful, |
| 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 16 * Library General Public License for more details. | 16 * Library General Public License for more details. |
| 17 * | 17 * |
| 18 * You should have received a copy of the GNU Library General Public License | 18 * You should have received a copy of the GNU Library General Public License |
| 19 * along with this library; see the file COPYING.LIB. If not, write to | 19 * along with this library; see the file COPYING.LIB. If not, write to |
| 20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 21 * Boston, MA 02110-1301, USA. | 21 * Boston, MA 02110-1301, USA. |
| 22 */ | 22 */ |
| 23 | 23 |
| 24 #ifndef LayoutSVGImage_h | 24 #ifndef LayoutSVGImage_h |
| 25 #define LayoutSVGImage_h | 25 #define LayoutSVGImage_h |
| 26 | 26 |
| 27 #include "core/rendering/svg/RenderSVGModelObject.h" | 27 #include "core/layout/svg/LayoutSVGModelObject.h" |
| 28 | 28 |
| 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 RenderSVGModelObject { | 36 class LayoutSVGImage final : public LayoutSVGModelObject { |
| 37 public: | 37 public: |
| 38 explicit LayoutSVGImage(SVGImageElement*); | 38 explicit LayoutSVGImage(SVGImageElement*); |
| 39 virtual ~LayoutSVGImage(); | 39 virtual ~LayoutSVGImage(); |
| 40 virtual void destroy() override; | 40 virtual void destroy() override; |
| 41 | 41 |
| 42 bool updateImageViewport(); | 42 bool updateImageViewport(); |
| 43 virtual void setNeedsBoundariesUpdate() override { m_needsBoundariesUpdate =
true; } | 43 virtual void setNeedsBoundariesUpdate() override { m_needsBoundariesUpdate =
true; } |
| 44 virtual void setNeedsTransformUpdate() override { m_needsTransformUpdate = t
rue; } | 44 virtual void setNeedsTransformUpdate() override { m_needsTransformUpdate = t
rue; } |
| 45 | 45 |
| 46 LayoutImageResource* imageResource() { return m_imageResource.get(); } | 46 LayoutImageResource* imageResource() { return m_imageResource.get(); } |
| 47 | 47 |
| 48 virtual const AffineTransform& localToParentTransform() const override { ret
urn m_localTransform; } | 48 virtual const AffineTransform& localToParentTransform() const override { ret
urn m_localTransform; } |
| 49 RefPtr<const SkPicture>& bufferedForeground() { return m_bufferedForeground;
} | 49 RefPtr<const SkPicture>& bufferedForeground() { return m_bufferedForeground;
} |
| 50 | 50 |
| 51 virtual FloatRect objectBoundingBox() const override { return m_objectBoundi
ngBox; } | 51 virtual FloatRect objectBoundingBox() const override { return m_objectBoundi
ngBox; } |
| 52 virtual bool isOfType(LayoutObjectType type) const override { return type ==
LayoutObjectSVGImage || RenderSVGModelObject::isOfType(type); } | 52 virtual bool isOfType(LayoutObjectType type) const override { return type ==
LayoutObjectSVGImage || LayoutSVGModelObject::isOfType(type); } |
| 53 | 53 |
| 54 private: | 54 private: |
| 55 virtual const char* renderName() const override { return "LayoutSVGImage"; } | 55 virtual const char* renderName() const override { return "LayoutSVGImage"; } |
| 56 | 56 |
| 57 virtual FloatRect strokeBoundingBox() const override { return m_objectBoundi
ngBox; } | 57 virtual FloatRect strokeBoundingBox() const override { return m_objectBoundi
ngBox; } |
| 58 | 58 |
| 59 virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint& addit
ionalOffset) const override; | 59 virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint& addit
ionalOffset) const override; |
| 60 | 60 |
| 61 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0) override; | 61 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0) override; |
| 62 | 62 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 76 OwnPtr<LayoutImageResource> m_imageResource; | 76 OwnPtr<LayoutImageResource> m_imageResource; |
| 77 | 77 |
| 78 RefPtr<const SkPicture> m_bufferedForeground; | 78 RefPtr<const SkPicture> m_bufferedForeground; |
| 79 }; | 79 }; |
| 80 | 80 |
| 81 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutSVGImage, isSVGImage()); | 81 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutSVGImage, isSVGImage()); |
| 82 | 82 |
| 83 } // namespace blink | 83 } // namespace blink |
| 84 | 84 |
| 85 #endif // LayoutSVGImage_h | 85 #endif // LayoutSVGImage_h |
| OLD | NEW |