summaryrefslogtreecommitdiffstats
path: root/dom/canvas/WebGLContext.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
commit59203c63bb777a3bacec32fb8830fba33540e809 (patch)
tree58298e711c0ff0575818c30485b44a2f21bf28a0 /dom/canvas/WebGLContext.h
parentAdding upstream version 126.0.1. (diff)
downloadfirefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz
firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/canvas/WebGLContext.h')
-rw-r--r--dom/canvas/WebGLContext.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/dom/canvas/WebGLContext.h b/dom/canvas/WebGLContext.h
index d144584f4f..69cff4e7dd 100644
--- a/dom/canvas/WebGLContext.h
+++ b/dom/canvas/WebGLContext.h
@@ -10,6 +10,7 @@
#include <memory>
#include <stdarg.h>
+#include "Colorspaces.h"
#include "GLContextTypes.h"
#include "GLDefs.h"
#include "GLScreenBuffer.h"
@@ -96,6 +97,7 @@ namespace gl {
class GLScreenBuffer;
class MozFramebuffer;
class SharedSurface;
+class Sampler;
class Texture;
} // namespace gl
@@ -536,6 +538,12 @@ class WebGLContext : public VRefCounted, public SupportsWeakPtr {
Maybe<layers::SurfaceDescriptor> GetFrontBuffer(WebGLFramebuffer*,
const bool webvr);
+ std::optional<color::ColorProfileDesc> mDisplayProfile;
+
+ void SetDrawingBufferColorSpace(const dom::PredefinedColorSpace val) {
+ mOptions.colorSpace = val;
+ }
+
void ClearVRSwapChain();
void RunContextLossTimer();
@@ -1156,6 +1164,10 @@ class WebGLContext : public VRefCounted, public SupportsWeakPtr {
nsTArray<RefPtr<WebGLTexture>> mBound2DArrayTextures;
nsTArray<RefPtr<WebGLSampler>> mBoundSamplers;
+ mutable std::unique_ptr<gl::Sampler> mSamplerLinear;
+
+ GLuint SamplerLinear() const;
+
void ResolveTexturesForDraw() const;
RefPtr<WebGLProgram> mCurrentProgram;
@@ -1265,6 +1277,10 @@ class WebGLContext : public VRefCounted, public SupportsWeakPtr {
mutable bool mDefaultFB_IsInvalid = false;
mutable UniquePtr<gl::MozFramebuffer> mResolvedDefaultFB;
+ mutable std::unordered_map<std::tuple<gfx::ColorSpace2, gfx::ColorSpace2>,
+ std::shared_ptr<gl::Texture>>
+ mLutTexByColorMapping;
+
gl::SwapChain mSwapChain;
gl::SwapChain mWebVRSwapChain;
@@ -1303,6 +1319,15 @@ class WebGLContext : public VRefCounted, public SupportsWeakPtr {
WebGLFramebuffer* const srcAsWebglFb = nullptr,
const gl::MozFramebuffer* const srcAsMozFb = nullptr,
bool srcIsBGRA = false) const;
+
+ struct GetDefaultFBForReadDesc {
+ bool endOfFrame = false;
+ };
+ const gl::MozFramebuffer* GetDefaultFBForRead(const GetDefaultFBForReadDesc&);
+ const gl::MozFramebuffer* GetDefaultFBForRead() {
+ return GetDefaultFBForRead({});
+ }
+
bool BindDefaultFBForRead();
// --