summaryrefslogtreecommitdiffstats
path: root/dom/canvas/WebGLContext.h
diff options
context:
space:
mode:
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();
// --