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

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

Issue 2723093004: Adds SVGImageElement as a CanvasImageSource (Closed)
Patch Set: Moved from circle to rect, to avoid aliasing 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/canvas/CanvasImageElementSource.h
diff --git a/third_party/WebKit/Source/core/html/canvas/CanvasImageElementSource.h b/third_party/WebKit/Source/core/html/canvas/CanvasImageElementSource.h
new file mode 100644
index 0000000000000000000000000000000000000000..e17a34d1f1ef8bc55df6c56effc85b8bd7daabba
--- /dev/null
+++ b/third_party/WebKit/Source/core/html/canvas/CanvasImageElementSource.h
@@ -0,0 +1,52 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// 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
+
+#include "core/CoreExport.h"
+#include "core/html/canvas/CanvasImageSource.h"
+
+namespace blink {
+
+class Element;
+class ImageLoader;
+class ImageResourceContent;
+
+class CORE_EXPORT CanvasImageElementSource : public CanvasImageSource {
+ public:
+ virtual ImageLoader& imageLoader() const = 0;
+ virtual FloatSize sourceDefaultObjectSize() = 0;
+
+ PassRefPtr<Image> getSourceImageForCanvas(SourceImageStatus*,
+ AccelerationHint,
+ SnapshotReason,
+ const FloatSize&) const override;
+
+ bool wouldTaintOrigin(
+ SecurityOrigin* destinationSecurityOrigin) const override;
+
+ FloatSize elementSize(const FloatSize& defaultObjectSize) const override;
+ FloatSize defaultDestinationSize(
+ const FloatSize& defaultObjectSize) const override;
+
+ bool isAccelerated() const override;
+
+ int sourceWidth() override;
+ int sourceHeight() override;
+
+ bool isSVGSource() const override;
+
+ bool isOpaque() const override;
+
+ const KURL& sourceURL() const override;
+
+ private:
+ ImageResourceContent* cachedImage() const;
+ const Element& element() const;
+};
+
+} // namespace blink
+
+#endif // CanvasImageElementSource_h

Powered by Google App Engine
This is Rietveld 408576698