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