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, |