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

Unified Diff: third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvas.cpp

Issue 1775153002: Make OffscreenCanvasRenderingContext2D renderable on a worker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix non-oilpan build Created 4 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/modules/offscreencanvas/OffscreenCanvas.cpp
diff --git a/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvas.cpp b/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvas.cpp
index 1a00c5b7d8fd715632282ad437351edcc7c04d80..b0815f3a61e713990bdc69e7396c30b73513120a 100644
--- a/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvas.cpp
+++ b/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvas.cpp
@@ -4,6 +4,9 @@
#include "modules/offscreencanvas/OffscreenCanvas.h"
+#if !ENABLE(OILPAN)
+#include "core/frame/ImageBitmap.h" // So ~RefPtr can call unref()
+#endif
#include "core/html/canvas/CanvasContextCreationAttributes.h"
#include "modules/offscreencanvas/OffscreenCanvasRenderingContext.h"
#include "modules/offscreencanvas/OffscreenCanvasRenderingContextFactory.h"
@@ -12,6 +15,13 @@
namespace blink {
+OffscreenCanvas::OffscreenCanvas(const IntSize& size)
+ : m_size(size)
+{ }
+
+OffscreenCanvas::~OffscreenCanvas()
+{ }
+
OffscreenCanvas* OffscreenCanvas::create(unsigned width, unsigned height)
{
return new OffscreenCanvas(IntSize(clampTo<int>(width), clampTo<int>(height)));
@@ -27,11 +37,6 @@ void OffscreenCanvas::setHeight(unsigned height)
m_size.setHeight(clampTo<int>(height));
}
-OffscreenCanvas::OffscreenCanvas(const IntSize& size)
- : m_size(size)
-{
-}
-
OffscreenCanvasRenderingContext2D* OffscreenCanvas::getContext(const String& id, const CanvasContextCreationAttributes& attributes)
{
OffscreenCanvasRenderingContext::ContextType contextType = OffscreenCanvasRenderingContext::contextTypeFromId(id);
@@ -59,6 +64,11 @@ OffscreenCanvasRenderingContext2D* OffscreenCanvas::getContext(const String& id,
return static_cast<OffscreenCanvasRenderingContext2D*>(m_context.get());
}
+PassRefPtrWillBeRawPtr<ImageBitmap> OffscreenCanvas::transferToImageBitmap(ExceptionState& exceptionState)
+{
+ return m_context->transferToImageBitmap(exceptionState);
+}
+
OffscreenCanvasRenderingContext2D* OffscreenCanvas::renderingContext() const
{
// TODO: When there're more than one context type implemented in the future,

Powered by Google App Engine
This is Rietveld 408576698