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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutImageResourceStyleImage.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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll <knoll@kde.org> 2 * Copyright (C) 1999 Lars Knoll <knoll@kde.org>
3 * Copyright (C) 1999 Antti Koivisto <koivisto@kde.org> 3 * Copyright (C) 1999 Antti Koivisto <koivisto@kde.org>
4 * Copyright (C) 2000 Dirk Mueller <mueller@kde.org> 4 * Copyright (C) 2000 Dirk Mueller <mueller@kde.org>
5 * Copyright (C) 2006 Allan Sandfeld Jensen <kde@carewolf.com> 5 * Copyright (C) 2006 Allan Sandfeld Jensen <kde@carewolf.com>
6 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> 6 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc.
8 * All rights reserved. 8 * All rights reserved.
9 * Copyright (C) 2010 Google Inc. All rights reserved. 9 * Copyright (C) 2010 Google Inc. All rights reserved.
10 * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com> 10 * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com>
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 style_image_->RemoveClient(layout_object_); 57 style_image_->RemoveClient(layout_object_);
58 cached_image_ = nullptr; 58 cached_image_ = nullptr;
59 } 59 }
60 60
61 PassRefPtr<Image> LayoutImageResourceStyleImage::GetImage( 61 PassRefPtr<Image> LayoutImageResourceStyleImage::GetImage(
62 const IntSize& size) const { 62 const IntSize& size) const {
63 // Generated content may trigger calls to image() while we're still pending, 63 // Generated content may trigger calls to image() while we're still pending,
64 // don't assert but gracefully exit. 64 // don't assert but gracefully exit.
65 if (style_image_->IsPendingImage()) 65 if (style_image_->IsPendingImage())
66 return nullptr; 66 return nullptr;
67 return style_image_->GetImage(*layout_object_, size); 67 return style_image_->GetImage(*layout_object_, layout_object_->GetDocument(),
68 layout_object_->StyleRef(), size);
68 } 69 }
69 70
70 LayoutSize LayoutImageResourceStyleImage::ImageSize(float multiplier) const { 71 LayoutSize LayoutImageResourceStyleImage::ImageSize(float multiplier) const {
71 // TODO(davve): Find out the correct default object size in this context. 72 // TODO(davve): Find out the correct default object size in this context.
72 return style_image_->ImageSize(layout_object_->GetDocument(), multiplier, 73 return style_image_->ImageSize(layout_object_->GetDocument(), multiplier,
73 LayoutSize(LayoutReplaced::kDefaultWidth, 74 LayoutSize(LayoutReplaced::kDefaultWidth,
74 LayoutReplaced::kDefaultHeight)); 75 LayoutReplaced::kDefaultHeight));
75 } 76 }
76 77
77 DEFINE_TRACE(LayoutImageResourceStyleImage) { 78 DEFINE_TRACE(LayoutImageResourceStyleImage) {
78 visitor->Trace(style_image_); 79 visitor->Trace(style_image_);
79 LayoutImageResource::Trace(visitor); 80 LayoutImageResource::Trace(visitor);
80 } 81 }
81 82
82 } // namespace blink 83 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSPaintValue.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698