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

Unified Diff: third_party/WebKit/Source/core/fetch/ImageResource.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/core/fetch/ImageResource.h
diff --git a/third_party/WebKit/Source/core/fetch/ImageResource.h b/third_party/WebKit/Source/core/fetch/ImageResource.h
index aeb64c3b1789c7d6fe96861b7b86a972bfe00f3c..c65fc23407a2cbf8c726113ee0247b0d0f9f27a7 100644
--- a/third_party/WebKit/Source/core/fetch/ImageResource.h
+++ b/third_party/WebKit/Source/core/fetch/ImageResource.h
@@ -72,7 +72,7 @@ public:
bool willPaintBrokenImage() const;
// Assumes that image rotation or scale doesn't effect the image size being empty or not.
- bool canRender() { return !errorOccurred() && !imageSize(DoNotRespectImageOrientation, 1).isEmpty(); }
+ bool canRender() { return !errorOccurred() && !defaultConcreteObjectSize(DoNotRespectImageOrientation, 1).isEmpty(); }
bool usesImageContainerSize() const;
bool imageHasRelativeSize() const;
@@ -85,7 +85,11 @@ public:
IntrinsicCorrectedToDPR, // Report the intrinsic size corrected to account for image density.
};
// This method takes a zoom multiplier that can be used to increase the natural size of the image by the zoom.
- LayoutSize imageSize(RespectImageOrientationEnum shouldRespectImageOrientation, float multiplier, SizeType = IntrinsicSize);
+ LayoutSize concreteObjectSize(const FloatSize& defaultObjectSize, RespectImageOrientationEnum shouldRespectImageOrientation, float multiplier, SizeType = IntrinsicSize);
+ LayoutSize defaultConcreteObjectSize(RespectImageOrientationEnum shouldRespectImageOrientation, float multiplier, SizeType sizeType = IntrinsicSize)
+ {
+ return concreteObjectSize(FloatSize(300, 150), shouldRespectImageOrientation, multiplier, sizeType);
+ }
void computeIntrinsicDimensions(FloatSize& intrinsicSize, FloatSize& intrinsicRatio);
bool isAccessAllowed(SecurityOrigin*);
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSCrossfadeValue.cpp ('k') | third_party/WebKit/Source/core/fetch/ImageResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698