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

Unified Diff: third_party/WebKit/Source/platform/graphics/Image.h

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/platform/graphics/Image.h
diff --git a/third_party/WebKit/Source/platform/graphics/Image.h b/third_party/WebKit/Source/platform/graphics/Image.h
index 089832c197e5a14e75ae4d74942c02ab48900297..728cdcdc5772da537059d00f3b85c608c2fc4791 100644
--- a/third_party/WebKit/Source/platform/graphics/Image.h
+++ b/third_party/WebKit/Source/platform/graphics/Image.h
@@ -88,7 +88,7 @@ public:
virtual bool currentFrameHasSingleSecurityOrigin() const { return false; }
static Image* nullImage();
- bool isNull() const { return size().isEmpty(); }
+ bool isNull() const { return defaultConcreteObjectSize().isEmpty(); }
virtual bool usesContainerSize() const { return false; }
virtual bool hasRelativeSize() const { return false; }
@@ -98,10 +98,11 @@ public:
// images it can be the dimensions defined by the 'viewBox'.)
virtual void computeIntrinsicDimensions(FloatSize& intrinsicSize, FloatSize& intrinsicRatio);
- virtual IntSize size() const = 0;
- IntRect rect() const { return IntRect(IntPoint(), size()); }
- int width() const { return size().width(); }
- int height() const { return size().height(); }
+ virtual IntSize concreteObjectSize(const FloatSize& defaultObjectSize) const = 0;
+ IntSize defaultConcreteObjectSize() const { return concreteObjectSize(FloatSize(300, 150)); }
+ IntRect defaultConcreteObjectSizeRect() const { return IntRect(IntPoint(), defaultConcreteObjectSize()); }
+ int defaultConcreteObjectSizeWidth() const { return defaultConcreteObjectSize().width(); }
+ int defaultConcreteObjectSizeHeight() const { return defaultConcreteObjectSize().height(); }
virtual bool getHotSpot(IntPoint&) const { return false; }
bool setData(PassRefPtr<SharedBuffer> data, bool allDataReceived);
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp ('k') | third_party/WebKit/Source/platform/graphics/Image.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698