| 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 0aedca56e420feed6780983a749a355e6a8f3cd2..3ffe09ea9a7cde9acfce5fddc13d9aeb6afdb141 100644
|
| --- a/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvas.cpp
|
| +++ b/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvas.cpp
|
| @@ -35,31 +35,31 @@ void OffscreenCanvas::setHeight(unsigned height)
|
| m_size.setHeight(clampTo<int>(height));
|
| }
|
|
|
| -OffscreenCanvasRenderingContext2D* OffscreenCanvas::getContext(const String& id, const CanvasContextCreationAttributes& attributes)
|
| +void OffscreenCanvas::getContext(ScriptState* scriptState, const String& id, const CanvasContextCreationAttributes& attributes, OffscreenRenderingContext& result)
|
| {
|
| OffscreenCanvasRenderingContext::ContextType contextType = OffscreenCanvasRenderingContext::contextTypeFromId(id);
|
|
|
| // Unknown type.
|
| if (contextType == OffscreenCanvasRenderingContext::ContextTypeCount)
|
| - return nullptr;
|
| + return;
|
|
|
| OffscreenCanvasRenderingContextFactory* factory = getRenderingContextFactory(contextType);
|
| if (!factory)
|
| - return nullptr;
|
| + return;
|
|
|
| if (m_context) {
|
| - if (m_context->getContextType() != contextType) {
|
| + if (m_context->getOffscreenCanvasRenderingContextType() != contextType) {
|
| factory->onError(this, "OffscreenCanvas has an existing context of a different type");
|
| - return nullptr;
|
| + return;
|
| }
|
| } else {
|
| - m_context = factory->create(this, attributes);
|
| + m_context = factory->create(scriptState, this, attributes);
|
| }
|
|
|
| // TODO: When there're more than one context type implemented in the future,
|
| // the return type here should be changed to base class of all Offscreen
|
| // context types.
|
| - return static_cast<OffscreenCanvasRenderingContext2D*>(m_context.get());
|
| + m_context->setOffscreenCanvasGetContextResult(result);
|
| }
|
|
|
| ImageBitmap* OffscreenCanvas::transferToImageBitmap(ExceptionState& exceptionState)
|
| @@ -76,12 +76,12 @@ ImageBitmap* OffscreenCanvas::transferToImageBitmap(ExceptionState& exceptionSta
|
| return image;
|
| }
|
|
|
| -OffscreenCanvasRenderingContext2D* OffscreenCanvas::renderingContext() const
|
| +OffscreenCanvasRenderingContext* OffscreenCanvas::renderingContext() const
|
| {
|
| // TODO: When there're more than one context type implemented in the future,
|
| // the return type here should be changed to base class of all Offscreen
|
| // context types.
|
| - return static_cast<OffscreenCanvasRenderingContext2D*>(m_context.get());
|
| + return m_context.get();
|
| }
|
|
|
| OffscreenCanvas::ContextFactoryVector& OffscreenCanvas::renderingContextFactories()
|
|
|