mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1172796 - Part 3: Implement OffscreenCanvas constructor. r=roc r=smaug
This commit is contained in:
parent
f7128495a2
commit
fa7da0ed58
@ -70,6 +70,18 @@ OffscreenCanvas::WrapObject(JSContext* aCx,
|
||||
return OffscreenCanvasBinding::Wrap(aCx, this, aGivenProto);
|
||||
}
|
||||
|
||||
/* static */ already_AddRefed<OffscreenCanvas>
|
||||
OffscreenCanvas::Constructor(const GlobalObject& aGlobal,
|
||||
uint32_t aWidth,
|
||||
uint32_t aHeight,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
RefPtr<OffscreenCanvas> offscreenCanvas =
|
||||
new OffscreenCanvas(aWidth, aHeight,
|
||||
layers::LayersBackend::LAYERS_NONE, nullptr);
|
||||
return offscreenCanvas.forget();
|
||||
}
|
||||
|
||||
void
|
||||
OffscreenCanvas::ClearResources()
|
||||
{
|
||||
@ -167,6 +179,12 @@ OffscreenCanvas::CreateContext(CanvasContextType aContextType)
|
||||
void
|
||||
OffscreenCanvas::CommitFrameToCompositor()
|
||||
{
|
||||
if (!mCanvasRenderer) {
|
||||
// This offscreen canvas doesn't associate to any HTML canvas element.
|
||||
// So, just bail out.
|
||||
return;
|
||||
}
|
||||
|
||||
// The attributes has changed, we have to notify main
|
||||
// thread to change canvas size.
|
||||
if (mAttrDirty) {
|
||||
|
@ -63,6 +63,12 @@ public:
|
||||
virtual JSObject* WrapObject(JSContext* aCx,
|
||||
JS::Handle<JSObject*> aGivenProto) override;
|
||||
|
||||
static already_AddRefed<OffscreenCanvas>
|
||||
Constructor(const GlobalObject& aGlobal,
|
||||
uint32_t aWidth,
|
||||
uint32_t aHeight,
|
||||
ErrorResult& aRv);
|
||||
|
||||
void ClearResources();
|
||||
|
||||
uint32_t Width() const
|
||||
|
@ -5,14 +5,10 @@
|
||||
*
|
||||
* For more information on this interface, please see
|
||||
* https://wiki.whatwg.org/wiki/OffscreenCanvas
|
||||
*
|
||||
* Current implementation focus on transfer canvas from main thread to worker.
|
||||
* So there are some spec doesn't implement, such as [Constructor], toBlob() and
|
||||
* transferToImageBitmap in OffscreenCanvas. Bug 1172796 will implement
|
||||
* remaining spec.
|
||||
*/
|
||||
|
||||
[Exposed=(Window,Worker),
|
||||
[Constructor(unsigned long width, unsigned long height),
|
||||
Exposed=(Window,Worker),
|
||||
Func="mozilla::dom::OffscreenCanvas::PrefEnabled"]
|
||||
interface OffscreenCanvas : EventTarget {
|
||||
[Pure, SetterThrows]
|
||||
|
Loading…
Reference in New Issue
Block a user