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

Unified Diff: third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h

Issue 2294383002: Make OffscreenCanvas a member of CanvasImageSource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 4 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/offscreencanvas/OffscreenCanvas.h
diff --git a/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h b/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h
index 94d25bebdbcf7efb331743efa665e1a3902184ea..162b2b874905d3185100ee844a0c8b06c5cfb778 100644
--- a/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h
+++ b/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h
@@ -9,6 +9,7 @@
#include "bindings/core/v8/ScriptState.h"
#include "bindings/core/v8/ScriptWrappable.h"
#include "core/html/HTMLCanvasElement.h"
+#include "core/html/canvas/CanvasImageSource.h"
#include "platform/geometry/IntSize.h"
#include "platform/heap/Handle.h"
#include <memory>
@@ -20,7 +21,7 @@ class ImageBitmap;
class OffscreenCanvasRenderingContext2DOrWebGLRenderingContextOrWebGL2RenderingContext;
typedef OffscreenCanvasRenderingContext2DOrWebGLRenderingContextOrWebGL2RenderingContext OffscreenRenderingContext;
-class CORE_EXPORT OffscreenCanvas final : public GarbageCollected<OffscreenCanvas>, public ScriptWrappable {
+class CORE_EXPORT OffscreenCanvas final : public GarbageCollectedFinalized<OffscreenCanvas>, public ScriptWrappable, public CanvasImageSource {
DEFINE_WRAPPERTYPEINFO();
public:
static OffscreenCanvas* create(unsigned width, unsigned height);
@@ -59,6 +60,15 @@ public:
uint32_t localId() const { return m_localId; }
uint64_t nonce() const { return m_nonce; }
+ // CanvasImageSource implementation
+ PassRefPtr<Image> getSourceImageForCanvas(SourceImageStatus*, AccelerationHint, SnapshotReason, const FloatSize&) const final;
+ bool wouldTaintOrigin(SecurityOrigin*) const final { return !m_originClean; }
+ bool isOffscreenCanvas() const final { return true; }
+ FloatSize elementSize(const FloatSize& defaultObjectSize) const final { return FloatSize(width(), height()); }
+ bool isOpaque() const final;
+ int sourceWidth() final { return width(); }
+ int sourceHeight() final { return height(); }
+
DECLARE_VIRTUAL_TRACE();
private:

Powered by Google App Engine
This is Rietveld 408576698