Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Unified Diff: third_party/WebKit/Source/core/style/StyleFetchedImage.cpp

Issue 2941533002: Break StyleImage dependency on LayoutObject (Closed)
Patch Set: Address reviewer comments Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/style/StyleFetchedImage.cpp
diff --git a/third_party/WebKit/Source/core/style/StyleFetchedImage.cpp b/third_party/WebKit/Source/core/style/StyleFetchedImage.cpp
index 8cb09855dbd9313e91e2a8cd3f64ecb817033510..52e52977130d8a9e20a7daaf673422314152b51d 100644
--- a/third_party/WebKit/Source/core/style/StyleFetchedImage.cpp
+++ b/third_party/WebKit/Source/core/style/StyleFetchedImage.cpp
@@ -101,12 +101,12 @@ bool StyleFetchedImage::UsesImageContainerSize() const {
return image_->UsesImageContainerSize();
}
-void StyleFetchedImage::AddClient(LayoutObject* layout_object) {
- image_->AddObserver(layout_object);
+void StyleFetchedImage::AddClient(ImageResourceObserver* observer) {
+ image_->AddObserver(observer);
}
-void StyleFetchedImage::RemoveClient(LayoutObject* layout_object) {
- image_->RemoveObserver(layout_object);
+void StyleFetchedImage::RemoveClient(ImageResourceObserver* observer) {
+ image_->RemoveObserver(observer);
}
void StyleFetchedImage::ImageNotifyFinished(ImageResourceContent*) {
@@ -118,14 +118,16 @@ void StyleFetchedImage::ImageNotifyFinished(ImageResourceContent*) {
}
PassRefPtr<Image> StyleFetchedImage::GetImage(
- const LayoutObject& obj,
+ const ImageResourceObserver&,
+ const Document&,
+ const ComputedStyle& style,
const IntSize& container_size) const {
if (!image_->GetImage()->IsSVGImage())
return image_->GetImage();
return SVGImageForContainer::Create(ToSVGImage(image_->GetImage()),
- container_size,
- obj.StyleRef().EffectiveZoom(), url_);
+ container_size, style.EffectiveZoom(),
+ url_);
}
bool StyleFetchedImage::KnownToBeOpaque(const Document&,
« no previous file with comments | « third_party/WebKit/Source/core/style/StyleFetchedImage.h ('k') | third_party/WebKit/Source/core/style/StyleFetchedImageSet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698