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

Unified Diff: third_party/WebKit/Source/core/html/canvas/HTMLAndSVGImageElementSource.h

Issue 2802813002: Adds SVGImageElement as a ImageBitmapSource (Closed)
Patch Set: tests Created 3 years, 8 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/canvas/HTMLAndSVGImageElementSource.h
diff --git a/third_party/WebKit/Source/core/html/canvas/CanvasImageElementSource.h b/third_party/WebKit/Source/core/html/canvas/HTMLAndSVGImageElementSource.h
similarity index 66%
rename from third_party/WebKit/Source/core/html/canvas/CanvasImageElementSource.h
rename to third_party/WebKit/Source/core/html/canvas/HTMLAndSVGImageElementSource.h
index e17a34d1f1ef8bc55df6c56effc85b8bd7daabba..f891751c57deb72cea343d82728de98b26ba350f 100644
--- a/third_party/WebKit/Source/core/html/canvas/CanvasImageElementSource.h
+++ b/third_party/WebKit/Source/core/html/canvas/HTMLAndSVGImageElementSource.h
@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CanvasImageElementSource_h
-#define CanvasImageElementSource_h
+#ifndef HTMLAndSVGImageElementSource_h
+#define HTMLAndSVGImageElementSource_h
#include "core/CoreExport.h"
#include "core/html/canvas/CanvasImageSource.h"
+#include "core/imagebitmap/ImageBitmapSource.h"
namespace blink {
@@ -14,11 +15,19 @@ class Element;
class ImageLoader;
class ImageResourceContent;
-class CORE_EXPORT CanvasImageElementSource : public CanvasImageSource {
+class CORE_EXPORT HTMLAndSVGImageElementSource : public CanvasImageSource,
+ public ImageBitmapSource {
public:
virtual ImageLoader& imageLoader() const = 0;
virtual FloatSize sourceDefaultObjectSize() = 0;
+ IntSize bitmapSourceSize() const override;
+ ScriptPromise createImageBitmap(ScriptState*,
+ EventTarget&,
+ Optional<IntRect> cropRect,
+ const ImageBitmapOptions&,
+ ExceptionState&) override;
+
PassRefPtr<Image> getSourceImageForCanvas(SourceImageStatus*,
AccelerationHint,
SnapshotReason,
@@ -42,11 +51,12 @@ class CORE_EXPORT CanvasImageElementSource : public CanvasImageSource {
const KURL& sourceURL() const override;
- private:
ImageResourceContent* cachedImage() const;
+
+ private:
const Element& element() const;
};
} // namespace blink
-#endif // CanvasImageElementSource_h
+#endif // HTMLAndSVGImageElementSource_h

Powered by Google App Engine
This is Rietveld 408576698