зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1885446 Part 1: Stub the WebGL unpackColorSpace attribute. r=jgilbert,webidl,smaug
This is a stub so webidl reviewers can review this without having to review the implementation. This is not attempting to do anything with unpackColorSpace other than ensure that it is get and set in the same ways that are used for drawingBufferColorSpace. Differential Revision: https://phabricator.services.mozilla.com/D214053
This commit is contained in:
Родитель
19f0a6cc52
Коммит
1e1002484d
|
@ -744,6 +744,12 @@ void ClientWebGLContext::SetDrawingBufferColorSpace(
|
|||
Run<RPROC(SetDrawingBufferColorSpace)>(*mDrawingBufferColorSpace);
|
||||
}
|
||||
|
||||
void ClientWebGLContext::SetUnpackColorSpace(
|
||||
const dom::PredefinedColorSpace val) {
|
||||
mUnpackColorSpace = val;
|
||||
Run<RPROC(SetUnpackColorSpace)>(*mUnpackColorSpace);
|
||||
}
|
||||
|
||||
void ClientWebGLContext::GetContextAttributes(
|
||||
dom::Nullable<dom::WebGLContextAttributes>& retval) {
|
||||
retval.SetNull();
|
||||
|
|
|
@ -1057,6 +1057,7 @@ class ClientWebGLContext final : public nsICanvasRenderingContextInternal,
|
|||
|
||||
private:
|
||||
std::optional<dom::PredefinedColorSpace> mDrawingBufferColorSpace;
|
||||
std::optional<dom::PredefinedColorSpace> mUnpackColorSpace;
|
||||
|
||||
public:
|
||||
auto DrawingBufferColorSpace() const {
|
||||
|
@ -1065,6 +1066,12 @@ class ClientWebGLContext final : public nsICanvasRenderingContextInternal,
|
|||
}
|
||||
void SetDrawingBufferColorSpace(dom::PredefinedColorSpace);
|
||||
|
||||
auto UnpackColorSpace() const {
|
||||
return mUnpackColorSpace ? *mUnpackColorSpace
|
||||
: dom::PredefinedColorSpace::Srgb;
|
||||
}
|
||||
void SetUnpackColorSpace(dom::PredefinedColorSpace);
|
||||
|
||||
// -
|
||||
|
||||
void GetContextAttributes(dom::Nullable<dom::WebGLContextAttributes>& retval);
|
||||
|
|
|
@ -204,6 +204,9 @@ class HostWebGLContext final : public SupportsWeakPtr {
|
|||
void SetDrawingBufferColorSpace(const dom::PredefinedColorSpace val) const {
|
||||
mContext->SetDrawingBufferColorSpace(val);
|
||||
}
|
||||
void SetUnpackColorSpace(const dom::PredefinedColorSpace val) const {
|
||||
mContext->SetUnpackColorSpace(val);
|
||||
}
|
||||
void Resize(const uvec2& size) { return mContext->Resize(size); }
|
||||
|
||||
uvec2 DrawingBufferSize() { return mContext->DrawingBufferSize(); }
|
||||
|
|
|
@ -549,12 +549,17 @@ class WebGLContext : public VRefCounted, public SupportsWeakPtr {
|
|||
const bool webvr);
|
||||
|
||||
std::optional<dom::PredefinedColorSpace> mDrawingBufferColorSpace;
|
||||
std::optional<dom::PredefinedColorSpace> mUnpackColorSpace;
|
||||
std::optional<color::ColorProfileDesc> mDisplayProfile;
|
||||
|
||||
void SetDrawingBufferColorSpace(const dom::PredefinedColorSpace val) {
|
||||
mDrawingBufferColorSpace = val;
|
||||
}
|
||||
|
||||
void SetUnpackColorSpace(const dom::PredefinedColorSpace val) {
|
||||
mUnpackColorSpace = val;
|
||||
}
|
||||
|
||||
void ClearVRSwapChain();
|
||||
|
||||
void RunContextLossTimer();
|
||||
|
|
|
@ -94,6 +94,7 @@ DEFINE_ASYNC(HostWebGLContext::Present)
|
|||
DEFINE_ASYNC(HostWebGLContext::SampleCoverage)
|
||||
DEFINE_ASYNC(HostWebGLContext::Scissor)
|
||||
DEFINE_ASYNC(HostWebGLContext::SetDrawingBufferColorSpace)
|
||||
DEFINE_ASYNC(HostWebGLContext::SetUnpackColorSpace)
|
||||
DEFINE_ASYNC(HostWebGLContext::ShaderSource)
|
||||
DEFINE_ASYNC(HostWebGLContext::StencilFuncSeparate)
|
||||
DEFINE_ASYNC(HostWebGLContext::StencilMaskSeparate)
|
||||
|
|
|
@ -539,7 +539,7 @@ interface mixin WebGLRenderingContextBase {
|
|||
default to the value "srgb". */
|
||||
[Pref="webgl.drawing_buffer_color_space"]
|
||||
attribute PredefinedColorSpace drawingBufferColorSpace;
|
||||
//attribute PredefinedColorSpace unpackColorSpace;
|
||||
attribute PredefinedColorSpace unpackColorSpace;
|
||||
|
||||
[WebGLHandlesContextLoss] WebGLContextAttributes? getContextAttributes();
|
||||
[WebGLHandlesContextLoss] boolean isContextLost();
|
||||
|
|
Загрузка…
Ссылка в новой задаче