OLD | NEW |
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) 2000 Dirk Mueller <mueller@kde.org> | 4 * Copyright (C) 2000 Dirk Mueller <mueller@kde.org> |
5 * Copyright (C) 2006 Allan Sandfeld Jensen <kde@carewolf.com> | 5 * Copyright (C) 2006 Allan Sandfeld Jensen <kde@carewolf.com> |
6 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> | 6 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> |
7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. All rights
reserved. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. |
| 8 * All rights reserved. |
8 * Copyright (C) 2010 Google Inc. All rights reserved. | 9 * Copyright (C) 2010 Google Inc. All rights reserved. |
9 * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com> | 10 * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com> |
10 * | 11 * |
11 * This library is free software; you can redistribute it and/or | 12 * This library is free software; you can redistribute it and/or |
12 * modify it under the terms of the GNU Library General Public | 13 * modify it under the terms of the GNU Library General Public |
13 * License as published by the Free Software Foundation; either | 14 * License as published by the Free Software Foundation; either |
14 * version 2 of the License, or (at your option) any later version. | 15 * version 2 of the License, or (at your option) any later version. |
15 * | 16 * |
16 * This library is distributed in the hope that it will be useful, | 17 * This library is distributed in the hope that it will be useful, |
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 18 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 } | 54 } |
54 | 55 |
55 void LayoutImageResourceStyleImage::shutdown() { | 56 void LayoutImageResourceStyleImage::shutdown() { |
56 ASSERT(m_layoutObject); | 57 ASSERT(m_layoutObject); |
57 m_styleImage->removeClient(m_layoutObject); | 58 m_styleImage->removeClient(m_layoutObject); |
58 m_cachedImage = nullptr; | 59 m_cachedImage = nullptr; |
59 } | 60 } |
60 | 61 |
61 PassRefPtr<Image> LayoutImageResourceStyleImage::image(const IntSize& size, | 62 PassRefPtr<Image> LayoutImageResourceStyleImage::image(const IntSize& size, |
62 float zoom) const { | 63 float zoom) const { |
63 // Generated content may trigger calls to image() while we're still pending, d
on't assert but gracefully exit. | 64 // Generated content may trigger calls to image() while we're still pending, |
| 65 // don't assert but gracefully exit. |
64 if (m_styleImage->isPendingImage()) | 66 if (m_styleImage->isPendingImage()) |
65 return nullptr; | 67 return nullptr; |
66 return m_styleImage->image(*m_layoutObject, size, zoom); | 68 return m_styleImage->image(*m_layoutObject, size, zoom); |
67 } | 69 } |
68 | 70 |
69 LayoutSize LayoutImageResourceStyleImage::imageSize(float multiplier) const { | 71 LayoutSize LayoutImageResourceStyleImage::imageSize(float multiplier) const { |
70 // TODO(davve): Find out the correct default object size in this context. | 72 // TODO(davve): Find out the correct default object size in this context. |
71 return m_styleImage->imageSize( | 73 return m_styleImage->imageSize( |
72 *m_layoutObject, multiplier, | 74 *m_layoutObject, multiplier, |
73 LayoutSize(LayoutReplaced::defaultWidth, LayoutReplaced::defaultHeight)); | 75 LayoutSize(LayoutReplaced::defaultWidth, LayoutReplaced::defaultHeight)); |
74 } | 76 } |
75 | 77 |
76 DEFINE_TRACE(LayoutImageResourceStyleImage) { | 78 DEFINE_TRACE(LayoutImageResourceStyleImage) { |
77 visitor->trace(m_styleImage); | 79 visitor->trace(m_styleImage); |
78 LayoutImageResource::trace(visitor); | 80 LayoutImageResource::trace(visitor); |
79 } | 81 } |
80 | 82 |
81 } // namespace blink | 83 } // namespace blink |
OLD | NEW |