| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 m_bestFitImage->addClient(layoutObject); | 116 m_bestFitImage->addClient(layoutObject); |
| 117 } | 117 } |
| 118 | 118 |
| 119 void StyleFetchedImageSet::removeClient(LayoutObject* layoutObject) | 119 void StyleFetchedImageSet::removeClient(LayoutObject* layoutObject) |
| 120 { | 120 { |
| 121 m_bestFitImage->removeClient(layoutObject); | 121 m_bestFitImage->removeClient(layoutObject); |
| 122 } | 122 } |
| 123 | 123 |
| 124 PassRefPtr<Image> StyleFetchedImageSet::image(const LayoutObject*, const IntSize
& containerSize, float zoom) const | 124 PassRefPtr<Image> StyleFetchedImageSet::image(const LayoutObject*, const IntSize
& containerSize, float zoom) const |
| 125 { | 125 { |
| 126 RefPtr<Image> image = m_bestFitImage->image(); | 126 if (!m_bestFitImage->image()->isSVGImage()) |
| 127 if (image && image->isSVGImage()) | 127 return m_bestFitImage->image(); |
| 128 return SVGImageForContainer::create(toSVGImage(image.get()), containerSi
ze, zoom, m_url); | 128 |
| 129 return image; | 129 return SVGImageForContainer::create(toSVGImage(m_bestFitImage->image()), con
tainerSize, zoom, m_url); |
| 130 } | 130 } |
| 131 | 131 |
| 132 bool StyleFetchedImageSet::knownToBeOpaque(const LayoutObject* layoutObject) con
st | 132 bool StyleFetchedImageSet::knownToBeOpaque(const LayoutObject* layoutObject) con
st |
| 133 { | 133 { |
| 134 return m_bestFitImage->currentFrameKnownToBeOpaque(layoutObject); | 134 return m_bestFitImage->currentFrameKnownToBeOpaque(layoutObject); |
| 135 } | 135 } |
| 136 | 136 |
| 137 DEFINE_TRACE(StyleFetchedImageSet) | 137 DEFINE_TRACE(StyleFetchedImageSet) |
| 138 { | 138 { |
| 139 visitor->trace(m_imageSetValue); | 139 visitor->trace(m_imageSetValue); |
| 140 StyleImage::trace(visitor); | 140 StyleImage::trace(visitor); |
| 141 } | 141 } |
| 142 | 142 |
| 143 } // namespace blink | 143 } // namespace blink |
| OLD | NEW |