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

Unified Diff: third_party/WebKit/Source/core/html/HTMLCanvasElement.h

Issue 1467103003: Basic use implementation for MediaStream from Canvas: captureStream() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 1 month 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/HTMLCanvasElement.h
diff --git a/third_party/WebKit/Source/core/html/HTMLCanvasElement.h b/third_party/WebKit/Source/core/html/HTMLCanvasElement.h
index a8fdc1741b6ca79c51d50ab82c3b04d7dea1aca2..fcc09a3bf16d6f4aac4332fabed7c4a639382c51 100644
--- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.h
+++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.h
@@ -36,6 +36,7 @@
#include "core/dom/DocumentVisibilityObserver.h"
#include "core/fileapi/FileCallback.h"
#include "core/html/HTMLElement.h"
+#include "core/html/canvas/CanvasDrawListener.h"
#include "core/html/canvas/CanvasImageSource.h"
#include "platform/geometry/FloatRect.h"
#include "platform/geometry/IntSize.h"
@@ -60,7 +61,7 @@ class ImageBufferSurface;
class ImageData;
class IntSize;
-class CORE_EXPORT HTMLCanvasElement final : public HTMLElement, public DocumentVisibilityObserver, public CanvasImageSource, public ImageBufferClient {
+class CORE_EXPORT HTMLCanvasElement : public HTMLElement, public DocumentVisibilityObserver, public CanvasImageSource, public ImageBufferClient {
DEFINE_WRAPPERTYPEINFO();
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLCanvasElement);
public:
@@ -101,6 +102,10 @@ public:
void toBlob(FileCallback*, const String& mimeType, const ScriptValue& qualityArgument, ExceptionState&);
void toBlob(FileCallback* callback, const String& mimeType, ExceptionState& exceptionState) { return toBlob(callback, mimeType, ScriptValue(), exceptionState); }
+ // Used for canvas capture.
+ void addListener(CanvasDrawListener*);
+ void removeListener(CanvasDrawListener*);
+
// Used for rendering
void didDraw(const FloatRect&);
@@ -193,9 +198,13 @@ private:
bool paintsIntoCanvasBuffer() const;
+ void notifyListenersCanvasChanged();
+
ImageData* toImageData(SourceDrawingBuffer) const;
String toDataURLInternal(const String& mimeType, const double& quality, SourceDrawingBuffer) const;
+ PersistentHeapHashSetWillBeHeapHashSet<WeakMember<CanvasDrawListener>> m_listeners;
+
IntSize m_size;
OwnPtrWillBeMember<CanvasRenderingContext> m_context;

Powered by Google App Engine
This is Rietveld 408576698