Chromium Code Reviews| Index: third_party/WebKit/Source/core/svg/SVGImageElement.cpp |
| diff --git a/third_party/WebKit/Source/core/svg/SVGImageElement.cpp b/third_party/WebKit/Source/core/svg/SVGImageElement.cpp |
| index 99f083eae214dccc6296751d4afa06fb065655c7..3d8e11104862edc759b4922f1e8e7e44d7a3c401 100644 |
| --- a/third_party/WebKit/Source/core/svg/SVGImageElement.cpp |
| +++ b/third_party/WebKit/Source/core/svg/SVGImageElement.cpp |
| @@ -204,4 +204,53 @@ void SVGImageElement::didMoveToNewDocument(Document& oldDocument) { |
| SVGGraphicsElement::didMoveToNewDocument(oldDocument); |
| } |
| +PassRefPtr<Image> SVGImageElement::getSourceImageForCanvas( |
|
fs
2017/03/01 21:20:41
This (and other method implementations) appear to
fserb
2017/03/06 21:05:13
Done.
|
| + SourceImageStatus* status, |
| + AccelerationHint hint, |
| + SnapshotReason reason, |
| + const FloatSize& defaultObjectSize) const { |
| + if (!imageLoader().imageComplete() || !cachedImage()) { |
| + *status = IncompleteSourceImageStatus; |
| + return nullptr; |
| + } |
| + |
| + if (cachedImage()->errorOccurred()) { |
| + *status = UndecodableSourceImageStatus; |
| + return nullptr; |
| + } |
| + |
| + *status = NormalSourceImageStatus; |
| + return cachedImage()->getImage()->imageForDefaultFrame(); |
| +} |
| + |
| +bool SVGImageElement::wouldTaintOrigin( |
| + SecurityOrigin* destinationSecurityOrigin) const { |
| + if (!cachedImage()) |
| + return false; |
| + return !cachedImage()->isAccessAllowed(destinationSecurityOrigin); |
| +} |
| + |
| +FloatSize SVGImageElement::elementSize( |
| + const FloatSize& defaultObjectSize) const { |
| + if (!cachedImage()) |
| + return FloatSize(); |
| + return FloatSize(cachedImage()->getImage()->size()); |
| +} |
| + |
| +bool SVGImageElement::isAccelerated() const { |
| + return false; |
| +} |
| + |
| +int SVGImageElement::sourceWidth() { |
| + if (!cachedImage()) |
| + return 0; |
| + return cachedImage()->getImage()->width(); |
| +} |
| + |
| +int SVGImageElement::sourceHeight() { |
| + if (!cachedImage()) |
| + return 0; |
| + return cachedImage()->getImage()->height(); |
| +} |
| + |
| } // namespace blink |