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

Unified Diff: third_party/WebKit/Source/core/html/HTMLImageElement.h

Issue 2723093004: Adds SVGImageElement as a CanvasImageSource (Closed)
Patch Set: Refactored Canvas code out Created 3 years, 9 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/html/HTMLImageElement.h
diff --git a/third_party/WebKit/Source/core/html/HTMLImageElement.h b/third_party/WebKit/Source/core/html/HTMLImageElement.h
index 37bf7e4034697eb37bf8e706420fb3a765a5e852..db246ba658ff0f70cdb48781e0f37e34afab05fc 100644
--- a/third_party/WebKit/Source/core/html/HTMLImageElement.h
+++ b/third_party/WebKit/Source/core/html/HTMLImageElement.h
@@ -29,7 +29,7 @@
#include "core/html/FormAssociated.h"
#include "core/html/HTMLElement.h"
#include "core/html/HTMLImageLoader.h"
-#include "core/html/canvas/CanvasImageSource.h"
+#include "core/html/canvas/CanvasHTMLSVGImage.h"
#include "core/imagebitmap/ImageBitmapSource.h"
#include "platform/graphics/GraphicsTypes.h"
#include "platform/loader/fetch/FetchRequest.h"
@@ -44,7 +44,7 @@ class ImageBitmapOptions;
class CORE_EXPORT HTMLImageElement final
: public HTMLElement,
- public CanvasImageSource,
+ public CanvasHTMLSVGImage,
public ImageBitmapSource,
public ActiveScriptWrappable<HTMLImageElement>,
public FormAssociated {
@@ -81,7 +81,9 @@ class CORE_EXPORT HTMLImageElement final
String altText() const final;
- ImageResourceContent* cachedImage() const { return imageLoader().image(); }
+ ImageResourceContent* cachedImage() const override {
+ return imageLoader().image();
+ }
ImageResource* cachedImageResourceForImageDocument() const {
return imageLoader().imageResourceForImageDocument();
}
@@ -116,20 +118,10 @@ class CORE_EXPORT HTMLImageElement final
virtual void ensurePrimaryContent();
bool isCollapsed() const;
- // CanvasImageSource implementation
- PassRefPtr<Image> getSourceImageForCanvas(SourceImageStatus*,
- AccelerationHint,
- SnapshotReason,
- const FloatSize&) const override;
- bool isSVGSource() const override;
- bool wouldTaintOrigin(SecurityOrigin*) const override;
- FloatSize elementSize(const FloatSize&) const override;
+ // CanvasHTMLSVGImage interface implementation.
+ const Element* element() const override { return this; }
+ bool imageLoaded() const override { return complete(); }
FloatSize defaultDestinationSize(const FloatSize&) const override;
- const KURL& sourceURL() const override;
- bool isAccelerated() const override { return false; }
- bool isOpaque() const override;
- int sourceWidth() override;
- int sourceHeight() override;
// public so that HTMLPictureElement can call this as well.
void selectSourceURL(ImageLoader::UpdateFromElementBehavior);

Powered by Google App Engine
This is Rietveld 408576698