Commit 0f53027c authored by David Quiroz Marin's avatar David Quiroz Marin Committed by Commit Bot

Add IsImageElement support for CanvasImageSource.

Currently there is no way to know if a CanvasImageSource comes from
an HTML Image Element, so this CL adds another function to the base
class to differentiate SVGs from Image Elements.

Change-Id: I3978171ba199f372ec685d446215bdfdc83eaa9f
Reviewed-on: https://chromium-review.googlesource.com/c/1301967Reviewed-by: default avatarFernando Serboncini <fserb@chromium.org>
Commit-Queue: David Quiroz Marin <davidqu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#603162}
parent 4ca7192d
......@@ -62,6 +62,7 @@ class CORE_EXPORT CanvasImageSource {
const SecurityOrigin* destination_security_origin) const = 0;
virtual bool IsCSSImageValue() const { return false; }
virtual bool IsImageElement() const { return false; }
virtual bool IsVideoElement() const { return false; }
virtual bool IsCanvasElement() const { return false; }
virtual bool IsSVGSource() const { return false; }
......
......@@ -40,6 +40,10 @@ bool ImageElementBase::IsSVGSource() const {
return CachedImage() && CachedImage()->GetImage()->IsSVGImage();
}
bool ImageElementBase::IsImageElement() const {
return CachedImage() && !CachedImage()->GetImage()->IsSVGImage();
}
scoped_refptr<Image> ImageElementBase::GetSourceImageForCanvas(
SourceImageStatus* status,
AccelerationHint,
......
......@@ -47,6 +47,8 @@ class CORE_EXPORT ImageElementBase : public CanvasImageSource,
bool IsSVGSource() const override;
bool IsImageElement() const override;
bool IsOpaque() const override;
const KURL& SourceURL() const override;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment