1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef WEBGLTEXTUREUPLOAD_H_
7 #define WEBGLTEXTUREUPLOAD_H_
9 #include "WebGLTypes.h"
12 struct SurfaceFromElementResult
;
16 class OffscreenCanvas
;
21 Maybe
<TexUnpackBlobDesc
> FromImageBitmap(GLenum target
, Maybe
<uvec3
> size
,
22 const dom::ImageBitmap
& imageBitmap
,
23 ErrorResult
* const out_rv
);
25 Maybe
<TexUnpackBlobDesc
> FromOffscreenCanvas(const ClientWebGLContext
& webgl
,
26 GLenum target
, Maybe
<uvec3
> size
,
27 const dom::OffscreenCanvas
& canvas
,
28 ErrorResult
* const out_error
);
30 Maybe
<TexUnpackBlobDesc
> FromVideoFrame(const ClientWebGLContext
& webgl
,
31 GLenum target
, Maybe
<uvec3
> size
,
32 const dom::VideoFrame
& videoFrame
,
33 ErrorResult
* const out_error
);
35 Maybe
<TexUnpackBlobDesc
> FromDomElem(const ClientWebGLContext
& webgl
,
36 GLenum target
, Maybe
<uvec3
> size
,
37 const dom::Element
& elem
,
38 ErrorResult
* const out_error
);
40 Maybe
<TexUnpackBlobDesc
> FromSurfaceFromElementResult(
41 const ClientWebGLContext
& webgl
, GLenum target
, Maybe
<uvec3
> size
,
42 SurfaceFromElementResult
& sfer
, ErrorResult
* const out_error
);
45 } // namespace mozilla