| 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 } | 108 } |
| 109 | 109 |
| 110 void StyleFetchedImageSet::AddClient(LayoutObject* layout_object) { | 110 void StyleFetchedImageSet::AddClient(LayoutObject* layout_object) { |
| 111 best_fit_image_->AddObserver(layout_object); | 111 best_fit_image_->AddObserver(layout_object); |
| 112 } | 112 } |
| 113 | 113 |
| 114 void StyleFetchedImageSet::RemoveClient(LayoutObject* layout_object) { | 114 void StyleFetchedImageSet::RemoveClient(LayoutObject* layout_object) { |
| 115 best_fit_image_->RemoveObserver(layout_object); | 115 best_fit_image_->RemoveObserver(layout_object); |
| 116 } | 116 } |
| 117 | 117 |
| 118 PassRefPtr<Image> StyleFetchedImageSet::GetImage(const LayoutObject&, | 118 PassRefPtr<Image> StyleFetchedImageSet::GetImage( |
| 119 const IntSize& container_size, | 119 const LayoutObject& obj, |
| 120 float zoom) const { | 120 const IntSize& container_size) const { |
| 121 if (!best_fit_image_->GetImage()->IsSVGImage()) | 121 if (!best_fit_image_->GetImage()->IsSVGImage()) |
| 122 return best_fit_image_->GetImage(); | 122 return best_fit_image_->GetImage(); |
| 123 | 123 |
| 124 return SVGImageForContainer::Create(ToSVGImage(best_fit_image_->GetImage()), | 124 return SVGImageForContainer::Create(ToSVGImage(best_fit_image_->GetImage()), |
| 125 container_size, zoom, url_); | 125 container_size, |
| 126 obj.StyleRef().EffectiveZoom(), url_); |
| 126 } | 127 } |
| 127 | 128 |
| 128 bool StyleFetchedImageSet::KnownToBeOpaque( | 129 bool StyleFetchedImageSet::KnownToBeOpaque( |
| 129 const LayoutObject& layout_object) const { | 130 const LayoutObject& layout_object) const { |
| 130 TRACE_EVENT1( | 131 TRACE_EVENT1( |
| 131 TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintImage", "data", | 132 TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintImage", "data", |
| 132 InspectorPaintImageEvent::Data(&layout_object, *best_fit_image_.Get())); | 133 InspectorPaintImageEvent::Data(&layout_object, *best_fit_image_.Get())); |
| 133 return best_fit_image_->GetImage()->CurrentFrameKnownToBeOpaque( | 134 return best_fit_image_->GetImage()->CurrentFrameKnownToBeOpaque( |
| 134 Image::kPreCacheMetadata); | 135 Image::kPreCacheMetadata); |
| 135 } | 136 } |
| 136 | 137 |
| 137 DEFINE_TRACE(StyleFetchedImageSet) { | 138 DEFINE_TRACE(StyleFetchedImageSet) { |
| 138 visitor->Trace(best_fit_image_); | 139 visitor->Trace(best_fit_image_); |
| 139 visitor->Trace(image_set_value_); | 140 visitor->Trace(image_set_value_); |
| 140 StyleImage::Trace(visitor); | 141 StyleImage::Trace(visitor); |
| 141 } | 142 } |
| 142 | 143 |
| 143 } // namespace blink | 144 } // namespace blink |
| OLD | NEW |