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

Unified Diff: third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.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/html/canvas/CanvasRenderingContext.h
diff --git a/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.h b/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.h
index ae6df2e2c766902e98be7b79233c49dfe2830676..72446e5325951888570882b4d3d75c172b9b0287 100644
--- a/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.h
+++ b/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.h
@@ -81,6 +81,7 @@ public:
WTF::String colorSpaceAsString() const;
sk_sp<SkColorSpace> skColorSpace() const;
+ virtual PassRefPtr<Image> getImage(SnapshotReason) const = 0;
virtual ContextType getContextType() const = 0;
virtual bool isAccelerated() const { return false; }
virtual bool shouldAntialias() const { return false; }
@@ -88,12 +89,11 @@ public:
virtual bool isContextLost() const { return true; }
virtual void setCanvasGetContextResult(RenderingContext&) { NOTREACHED(); };
virtual void setOffscreenCanvasGetContextResult(OffscreenRenderingContext&) { NOTREACHED(); }
+ virtual bool isPaintable() const = 0;
// Return true if the content is updated.
virtual bool paintRenderingResultsToCanvas(SourceDrawingBuffer) { return false; }
- // Note: this function is strictly for OffscreenCanvas only.
- virtual bool isPaintable() const = 0;
virtual WebLayer* platformLayer() const { return nullptr; }
@@ -137,15 +137,14 @@ public:
// ImageBitmap-specific interface
virtual bool paint(GraphicsContext&, const IntRect&) { return false; }
- virtual PassRefPtr<Image> getImage() const { return nullptr; }
-
- bool wouldTaintOrigin(CanvasImageSource*, SecurityOrigin* = nullptr);
- void didMoveToNewDocument(Document*);
// OffscreenCanvas-specific methods
OffscreenCanvas* getOffscreenCanvas() const { return m_offscreenCanvas; }
virtual ImageBitmap* transferToImageBitmap(ExceptionState&) { return nullptr; }
+ bool wouldTaintOrigin(CanvasImageSource*, SecurityOrigin* = nullptr);
+ void didMoveToNewDocument(Document*);
+
void detachCanvas() { m_canvas = nullptr; }
const CanvasContextCreationAttributes& creationAttributes() const { return m_creationAttributes; }

Powered by Google App Engine
This is Rietveld 408576698