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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 return m_bestFitImage->imageHasRelativeSize(); | 113 return m_bestFitImage->imageHasRelativeSize(); |
114 } | 114 } |
115 | 115 |
116 bool StyleFetchedImageSet::usesImageContainerSize() const | 116 bool StyleFetchedImageSet::usesImageContainerSize() const |
117 { | 117 { |
118 return m_bestFitImage->usesImageContainerSize(); | 118 return m_bestFitImage->usesImageContainerSize(); |
119 } | 119 } |
120 | 120 |
121 void StyleFetchedImageSet::addClient(LayoutObject* layoutObject) | 121 void StyleFetchedImageSet::addClient(LayoutObject* layoutObject) |
122 { | 122 { |
123 m_bestFitImage->addClient(layoutObject); | 123 m_bestFitImage->addObserver(layoutObject); |
124 } | 124 } |
125 | 125 |
126 void StyleFetchedImageSet::removeClient(LayoutObject* layoutObject) | 126 void StyleFetchedImageSet::removeClient(LayoutObject* layoutObject) |
127 { | 127 { |
128 m_bestFitImage->removeClient(layoutObject); | 128 m_bestFitImage->removeObserver(layoutObject); |
129 } | 129 } |
130 | 130 |
131 PassRefPtr<Image> StyleFetchedImageSet::image(const LayoutObject&, const IntSize
& containerSize, float zoom) const | 131 PassRefPtr<Image> StyleFetchedImageSet::image(const LayoutObject&, const IntSize
& containerSize, float zoom) const |
132 { | 132 { |
133 if (!m_bestFitImage->getImage()->isSVGImage()) | 133 if (!m_bestFitImage->getImage()->isSVGImage()) |
134 return m_bestFitImage->getImage(); | 134 return m_bestFitImage->getImage(); |
135 | 135 |
136 return SVGImageForContainer::create(toSVGImage(m_bestFitImage->getImage()),
containerSize, zoom, m_url); | 136 return SVGImageForContainer::create(toSVGImage(m_bestFitImage->getImage()),
containerSize, zoom, m_url); |
137 } | 137 } |
138 | 138 |
139 bool StyleFetchedImageSet::knownToBeOpaque(const LayoutObject& layoutObject) con
st | 139 bool StyleFetchedImageSet::knownToBeOpaque(const LayoutObject& layoutObject) con
st |
140 { | 140 { |
141 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintImage", "
data", InspectorPaintImageEvent::data(&layoutObject, *m_bestFitImage.get())); | 141 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintImage", "
data", InspectorPaintImageEvent::data(&layoutObject, *m_bestFitImage.get())); |
142 return m_bestFitImage->getImage()->currentFrameKnownToBeOpaque(Image::PreCac
heMetadata); | 142 return m_bestFitImage->getImage()->currentFrameKnownToBeOpaque(Image::PreCac
heMetadata); |
143 } | 143 } |
144 | 144 |
145 DEFINE_TRACE(StyleFetchedImageSet) | 145 DEFINE_TRACE(StyleFetchedImageSet) |
146 { | 146 { |
147 visitor->trace(m_bestFitImage); | 147 visitor->trace(m_bestFitImage); |
148 visitor->trace(m_imageSetValue); | 148 visitor->trace(m_imageSetValue); |
149 StyleImage::trace(visitor); | 149 StyleImage::trace(visitor); |
150 } | 150 } |
151 | 151 |
152 } // namespace blink | 152 } // namespace blink |
OLD | NEW |