aboutsummaryrefslogtreecommitdiff
path: root/src/javascript/jsc/bindings/webcore/OffscreenCanvas.cpp
blob: 9bdde8205d0ea782d6b92a7f795465ec81008d5c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

#include "root.h"

#include "OffscreenCanvas.h"
#include "OffscreenCanvasRenderingContext2D.h"

namespace WebCore {

OffscreenCanvas::OffscreenCanvas(ScriptExecutionContext& scriptExecutionContext, unsigned width, unsigned height)
    : ContextDestructionObserver(&scriptExecutionContext)
{
    m_width = width;
    m_height = height;
}

Ref<OffscreenCanvas> OffscreenCanvas::create(ScriptExecutionContext& scriptExecutionContext, unsigned width, unsigned height)
{
    return adoptRef(*new OffscreenCanvas(scriptExecutionContext, width, height));
}

ExceptionOr<std::optional<OffscreenCanvas::OffscreenRenderingContext>> getContext(JSC::JSGlobalObject&, OffscreenCanvas::RenderingContextType)
{
    return Exception { TypeError, "Not implemented yet"_s };
}

}