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

Unified Diff: third_party/WebKit/Source/core/css/CSSCrossfadeValue.cpp

Issue 2941533002: Break StyleImage dependency on LayoutObject (Closed)
Patch Set: Rebase w/HEAD 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/css/CSSCrossfadeValue.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSCrossfadeValue.cpp b/third_party/WebKit/Source/core/css/CSSCrossfadeValue.cpp
index 81e6a82df4bc18a1bd3e4d65b91d3a4409d06a14..adce4fbd8d94cfedf844f6dc2a84e0e9b06b72ab 100644
--- a/third_party/WebKit/Source/core/css/CSSCrossfadeValue.cpp
+++ b/third_party/WebKit/Source/core/css/CSSCrossfadeValue.cpp
@@ -219,12 +219,14 @@ void CSSCrossfadeValue::LoadSubimages(const Document& document) {
crossfade_subimage_observer_.SetReady(true);
}
-PassRefPtr<Image> CSSCrossfadeValue::GetImage(const LayoutObject& layout_object,
- const IntSize& size) {
+PassRefPtr<Image> CSSCrossfadeValue::GetImage(
+ const ImageResourceObserver& client,
+ const Document& document,
+ const ComputedStyle&,
+ const IntSize& size) {
if (size.IsEmpty())
return nullptr;
- const Document& document = layout_object.GetDocument();
Image* from_image = RenderableImageForCSSValue(from_value_.Get(), document);
Image* to_image = RenderableImageForCSSValue(to_value_.Get(), document);
@@ -249,14 +251,15 @@ PassRefPtr<Image> CSSCrossfadeValue::GetImage(const LayoutObject& layout_object,
void CSSCrossfadeValue::CrossfadeChanged(const IntRect&) {
for (const auto& curr : Clients()) {
- LayoutObject* client = const_cast<LayoutObject*>(curr.key);
+ ImageResourceObserver* client =
+ const_cast<ImageResourceObserver*>(curr.key);
client->ImageChanged(static_cast<WrappedImagePtr>(this));
}
}
bool CSSCrossfadeValue::WillRenderImage() const {
for (const auto& curr : Clients()) {
- if (const_cast<LayoutObject*>(curr.key)->WillRenderImage())
+ if (const_cast<ImageResourceObserver*>(curr.key)->WillRenderImage())
return true;
}
return false;

Powered by Google App Engine
This is Rietveld 408576698