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

Unified Diff: third_party/WebKit/Source/core/css/cssom/CSSStyleImageValue.cpp

Issue 2351363002: Make CSSStyleImageValue a member of CanvasImageSource. (Closed)
Patch Set: Created 4 years, 3 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/css/cssom/CSSStyleImageValue.cpp
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSStyleImageValue.cpp b/third_party/WebKit/Source/core/css/cssom/CSSStyleImageValue.cpp
index 3f6a5c0ba3b60ddc465ce67fd99193080fca459a..8fb112804c0a2abd7e6cab6bae5895852883463d 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSStyleImageValue.cpp
+++ b/third_party/WebKit/Source/core/css/cssom/CSSStyleImageValue.cpp
@@ -6,7 +6,7 @@
namespace blink {
-double CSSStyleImageValue::intrinsicWidth(bool& isNull)
+double CSSStyleImageValue::intrinsicWidth(bool& isNull) const
{
isNull = isCachePending();
if (isNull)
@@ -14,7 +14,7 @@ double CSSStyleImageValue::intrinsicWidth(bool& isNull)
return imageLayoutSize().width().toDouble();
}
-double CSSStyleImageValue::intrinsicHeight(bool& isNull)
+double CSSStyleImageValue::intrinsicHeight(bool& isNull) const
{
isNull = isCachePending();
if (isNull)
@@ -35,4 +35,30 @@ double CSSStyleImageValue::intrinsicRatio(bool& isNull)
return intrinsicWidth(isNull) / intrinsicHeight(isNull);
}
+FloatSize CSSStyleImageValue::elementSize(const FloatSize& defaultObjectSize) const
+{
+ bool notUsed;
+ return FloatSize(intrinsicWidth(notUsed), intrinsicHeight(notUsed));
+}
+
+int CSSStyleImageValue::sourceHeight()
+{
+ bool notUsed;
+ return intrinsicHeight(notUsed);
+}
+
+int CSSStyleImageValue::sourceWidth()
+{
+ bool notUsed;
+ return intrinsicWidth(notUsed);
+}
+
+PassRefPtr<Image> CSSStyleImageValue::getSourceImageForCanvas(SourceImageStatus* status, AccelerationHint, SnapshotReason,
ikilpatrick 2016/09/27 18:06:00 would it be better to change this method to accept
Gleb Lanbin 2016/09/27 19:37:18 probably, but this method is not defined here. It'
+ const FloatSize&) const
+{
+ if (isCachePending())
+ return nullptr;
+ return m_imageValue->cachedImage()->cachedImage()->getImage()->imageForDefaultFrame();
Justin Novosad 2016/09/28 15:41:58 Confident you don't need any nullptr checks anywhe
Gleb Lanbin 2016/09/28 16:58:22 Done.
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698