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

Unified Diff: third_party/WebKit/Source/core/frame/ImageBitmap.cpp

Issue 1732563007: [NOT FOR COMMIT] Pass defaultObjectSize to get image size (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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/frame/ImageBitmap.cpp
diff --git a/third_party/WebKit/Source/core/frame/ImageBitmap.cpp b/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
index d6791c0627d75337688d4d215956dba7f38eb15b..a7ec86f276094ba2f31be91f848a704929d275e5 100644
--- a/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
+++ b/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
@@ -90,7 +90,7 @@ static PassRefPtr<StaticBitmapImage> cropImage(Image* image, const IntRect& crop
{
ASSERT(image);
- IntRect imgRect(IntPoint(), IntSize(image->width(), image->height()));
+ IntRect imgRect(IntPoint(), IntSize(image->defaultConcreteObjectSizeWidth(), image->defaultConcreteObjectSizeHeight()));
const IntRect srcRect = intersection(imgRect, cropRect);
RefPtr<SkImage> skiaImage = image->imageForCurrentFrame();
@@ -316,24 +316,24 @@ unsigned long ImageBitmap::width() const
{
if (!m_image)
return 0;
- ASSERT(m_image->width() > 0);
- return m_image->width();
+ ASSERT(m_image->defaultConcreteObjectSizeWidth() > 0);
+ return m_image->defaultConcreteObjectSizeWidth();
}
unsigned long ImageBitmap::height() const
{
if (!m_image)
return 0;
- ASSERT(m_image->height() > 0);
- return m_image->height();
+ ASSERT(m_image->defaultConcreteObjectSizeHeight() > 0);
+ return m_image->defaultConcreteObjectSizeHeight();
}
IntSize ImageBitmap::size() const
{
if (!m_image)
return IntSize();
- ASSERT(m_image->width() > 0 && m_image->height() > 0);
- return IntSize(m_image->width(), m_image->height());
+ ASSERT(m_image->defaultConcreteObjectSizeWidth() > 0 && m_image->defaultConcreteObjectSizeHeight() > 0);
+ return IntSize(m_image->defaultConcreteObjectSizeWidth(), m_image->defaultConcreteObjectSizeHeight());
}
ScriptPromise ImageBitmap::createImageBitmap(ScriptState* scriptState, EventTarget& eventTarget, int sx, int sy, int sw, int sh, const ImageBitmapOptions& options, ExceptionState& exceptionState)
@@ -359,7 +359,7 @@ void ImageBitmap::adjustDrawRects(FloatRect* srcRect, FloatRect* dstRect) const
{
}
-FloatSize ImageBitmap::elementSize() const
+FloatSize ImageBitmap::elementSize(const FloatSize&) const
{
return FloatSize(width(), height());
}
« no previous file with comments | « third_party/WebKit/Source/core/frame/ImageBitmap.h ('k') | third_party/WebKit/Source/core/html/HTMLCanvasElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698