summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordavve <davve@opera.com>2015-11-08 07:33:48 -0800
committerCommit bot <commit-bot@chromium.org>2015-11-08 15:34:37 +0000
commit20fa2832b2650a8654bfd8226561046760ebbfc9 (patch)
tree0e25b82e78d633ab6d85edda65340f6f48e9fb7c
parent56d4322188c7d4fd55d081a861c04d6165b0650b (diff)
downloadchromium_src-20fa2832b2650a8654bfd8226561046760ebbfc9.zip
chromium_src-20fa2832b2650a8654bfd8226561046760ebbfc9.tar.gz
chromium_src-20fa2832b2650a8654bfd8226561046760ebbfc9.tar.bz2
Revert of Make LayoutImageResource::image() parameter explicit (patchset #2 id:20001 of https://codereview.chromium.org/1411693006/ )
Reason for revert: Seems to have caused 553045 Original issue's description: > Make LayoutImageResource::image() parameter explicit > > It makes the code more explicit and easier to read. No functional > change expected. > > BUG=551419 > > Committed: https://crrev.com/3059b983258e55aeacef6e0b04bdd35a72436d3b > Cr-Commit-Position: refs/heads/master@{#358287} TBR=fs@opera.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=551419 Review URL: https://codereview.chromium.org/1431973002 Cr-Commit-Position: refs/heads/master@{#358551}
-rw-r--r--third_party/WebKit/Source/core/layout/LayoutImage.cpp2
-rw-r--r--third_party/WebKit/Source/core/layout/LayoutImageResource.cpp8
-rw-r--r--third_party/WebKit/Source/core/layout/LayoutImageResource.h3
-rw-r--r--third_party/WebKit/Source/core/layout/LayoutImageResourceStyleImage.cpp4
-rw-r--r--third_party/WebKit/Source/core/layout/LayoutImageResourceStyleImage.h2
-rw-r--r--third_party/WebKit/Source/core/paint/ImagePainter.cpp2
-rw-r--r--third_party/WebKit/Source/core/paint/SVGImagePainter.cpp2
7 files changed, 8 insertions, 15 deletions
diff --git a/third_party/WebKit/Source/core/layout/LayoutImage.cpp b/third_party/WebKit/Source/core/layout/LayoutImage.cpp
index 8e8ecfc..8181015 100644
--- a/third_party/WebKit/Source/core/layout/LayoutImage.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutImage.cpp
@@ -185,7 +185,7 @@ void LayoutImage::invalidatePaintAndMarkForLayoutIfNeeded()
updateInnerContentRect();
}
- if (imageResource() && imageResource()->maybeAnimated())
+ if (imageResource() && imageResource()->image() && imageResource()->image()->maybeAnimated())
setShouldDoFullPaintInvalidation(PaintInvalidationDelayedFull);
else
setShouldDoFullPaintInvalidation(PaintInvalidationFull);
diff --git a/third_party/WebKit/Source/core/layout/LayoutImageResource.cpp b/third_party/WebKit/Source/core/layout/LayoutImageResource.cpp
index 4c4ceb9..85e24d6 100644
--- a/third_party/WebKit/Source/core/layout/LayoutImageResource.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutImageResource.cpp
@@ -83,7 +83,7 @@ void LayoutImageResource::resetAnimation()
if (!m_cachedImage)
return;
- m_cachedImage->image()->resetAnimation();
+ image()->resetAnimation();
m_layoutObject->setShouldDoFullPaintInvalidation();
}
@@ -105,10 +105,4 @@ LayoutSize LayoutImageResource::getImageSize(float multiplier, ImageResource::Si
return size;
}
-bool LayoutImageResource::maybeAnimated() const
-{
- Image* image = m_cachedImage ? m_cachedImage->image() : Image::nullImage();
- return image->maybeAnimated();
-}
-
} // namespace blink
diff --git a/third_party/WebKit/Source/core/layout/LayoutImageResource.h b/third_party/WebKit/Source/core/layout/LayoutImageResource.h
index 788e794..a4d99ba 100644
--- a/third_party/WebKit/Source/core/layout/LayoutImageResource.h
+++ b/third_party/WebKit/Source/core/layout/LayoutImageResource.h
@@ -53,9 +53,8 @@ public:
virtual bool hasImage() const { return m_cachedImage; }
void resetAnimation();
- bool maybeAnimated() const;
- virtual PassRefPtr<Image> image(const IntSize&) const
+ virtual PassRefPtr<Image> image(int /* width */ = 0, int /* height */ = 0) const
{
return m_cachedImage ? m_cachedImage->imageForLayoutObject(m_layoutObject) : Image::nullImage();
}
diff --git a/third_party/WebKit/Source/core/layout/LayoutImageResourceStyleImage.cpp b/third_party/WebKit/Source/core/layout/LayoutImageResourceStyleImage.cpp
index 12c68f3..aff05ff 100644
--- a/third_party/WebKit/Source/core/layout/LayoutImageResourceStyleImage.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutImageResourceStyleImage.cpp
@@ -61,12 +61,12 @@ void LayoutImageResourceStyleImage::shutdown()
m_cachedImage = 0;
}
-PassRefPtr<Image> LayoutImageResourceStyleImage::image(const IntSize& size) const
+PassRefPtr<Image> LayoutImageResourceStyleImage::image(int width, int height) const
{
// Generated content may trigger calls to image() while we're still pending, don't assert but gracefully exit.
if (m_styleImage->isPendingImage())
return nullptr;
- return m_styleImage->image(m_layoutObject, size);
+ return m_styleImage->image(m_layoutObject, IntSize(width, height));
}
void LayoutImageResourceStyleImage::setContainerSizeForLayoutObject(const IntSize& size)
diff --git a/third_party/WebKit/Source/core/layout/LayoutImageResourceStyleImage.h b/third_party/WebKit/Source/core/layout/LayoutImageResourceStyleImage.h
index 3ed1625..0dd704d 100644
--- a/third_party/WebKit/Source/core/layout/LayoutImageResourceStyleImage.h
+++ b/third_party/WebKit/Source/core/layout/LayoutImageResourceStyleImage.h
@@ -46,7 +46,7 @@ public:
void shutdown() override;
bool hasImage() const override { return true; }
- PassRefPtr<Image> image(const IntSize&) const override;
+ PassRefPtr<Image> image(int width = 0, int height = 0) const override;
bool errorOccurred() const override { return m_styleImage->errorOccurred(); }
void setContainerSizeForLayoutObject(const IntSize&) override;
diff --git a/third_party/WebKit/Source/core/paint/ImagePainter.cpp b/third_party/WebKit/Source/core/paint/ImagePainter.cpp
index fc4d51c..8a94b3c 100644
--- a/third_party/WebKit/Source/core/paint/ImagePainter.cpp
+++ b/third_party/WebKit/Source/core/paint/ImagePainter.cpp
@@ -128,7 +128,7 @@ void ImagePainter::paintIntoRect(GraphicsContext* context, const LayoutRect& rec
if (alignedRect.width() <= 0 || alignedRect.height() <= 0)
return;
- RefPtr<Image> image = m_layoutImage.imageResource()->image(alignedRect.size());
+ RefPtr<Image> image = m_layoutImage.imageResource()->image(alignedRect.width(), alignedRect.height());
if (!image || image->isNull())
return;
diff --git a/third_party/WebKit/Source/core/paint/SVGImagePainter.cpp b/third_party/WebKit/Source/core/paint/SVGImagePainter.cpp
index 1f1be38..f6da1bc 100644
--- a/third_party/WebKit/Source/core/paint/SVGImagePainter.cpp
+++ b/third_party/WebKit/Source/core/paint/SVGImagePainter.cpp
@@ -51,7 +51,7 @@ void SVGImagePainter::paint(const PaintInfo& paintInfo)
void SVGImagePainter::paintForeground(const PaintInfo& paintInfo)
{
- RefPtr<Image> image = m_layoutSVGImage.imageResource()->image(IntSize());
+ RefPtr<Image> image = m_layoutSVGImage.imageResource()->image();
FloatRect destRect = m_layoutSVGImage.objectBoundingBox();
FloatRect srcRect(0, 0, image->width(), image->height());