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

Unified Diff: third_party/WebKit/Source/core/html/canvas/CanvasHTMLSVGImage.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/canvas/CanvasHTMLSVGImage.h
diff --git a/third_party/WebKit/Source/core/html/canvas/CanvasHTMLSVGImage.h b/third_party/WebKit/Source/core/html/canvas/CanvasHTMLSVGImage.h
new file mode 100644
index 0000000000000000000000000000000000000000..2f0f291fbb4a8a77dab24f4b5b38182b96a91b5c
--- /dev/null
+++ b/third_party/WebKit/Source/core/html/canvas/CanvasHTMLSVGImage.h
@@ -0,0 +1,66 @@
+/*
+ *
+ * Copyright (C) 2017 Google Inc. All rights reserved.
fs 2017/03/06 22:46:15 Use short copyright. (https://chromium.googlesourc
fserb 2017/03/07 20:44:02 done.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef CanvasHTMLSVGImage_h
+#define CanvasHTMLSVGImage_h
+
+#include "bindings/core/v8/ScriptWrappable.h"
fs 2017/03/06 22:46:15 What's ScriptWrappable here
fserb 2017/03/07 20:44:02 sry, my setup used to lint about those and it does
+#include "core/CoreExport.h"
+#include "core/html/canvas/CanvasImageSource.h"
+#include "core/loader/ImageLoader.h"
+#include "platform/heap/Visitor.h"
fs 2017/03/06 22:46:15 Not used? (In general it seems very little besides
fserb 2017/03/07 20:44:02 done.
+
+namespace blink {
+
+class CORE_EXPORT CanvasHTMLSVGImage : public CanvasImageSource {
fs 2017/03/06 22:46:15 The ...HTMLSVGImage suffix feels a bit weird. Mayb
fserb 2017/03/07 20:44:02 done.
+ public:
+ virtual ImageResourceContent* cachedImage() const = 0;
fs 2017/03/06 22:46:15 It's a bit unfortunate that this ended up as virtu
fserb 2017/03/07 20:44:02 The ImageLoader is a great idea. I moved that to b
fs 2017/03/07 22:01:24 Yeah, let's hope so. (Feel free to verify that it
+ virtual bool imageLoaded() const = 0;
+ virtual const Element* element() const = 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:
fs 2017/03/06 22:46:15 Drop?
fserb 2017/03/07 20:44:02 used now.
+};
+
+} // namespace blink
+
+#endif // CanvasHTMLSVGImage_h

Powered by Google App Engine
This is Rietveld 408576698