Skip to content

Commit

Permalink
Backed out changeset b14b975aa6d7 (bug 1785925) for causing build bus…
Browse files Browse the repository at this point in the history
…tages on GLBlitHelper.cpp CLOSED TREE
  • Loading branch information
Cristian Tuns committed Sep 3, 2022
1 parent 699486f commit d0b127e
Show file tree
Hide file tree
Showing 39 changed files with 322 additions and 2,669 deletions.
6 changes: 4 additions & 2 deletions dom/canvas/ClientWebGLContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -896,11 +896,13 @@ ClientWebGLContext::SetContextOptions(JSContext* cx,
if (attributes.mAntialias.WasPassed()) {
newOpts.antialias = attributes.mAntialias.Value();
}
newOpts.ignoreColorSpace = true;

if (attributes.mColorSpace.WasPassed()) {
newOpts.ignoreColorSpace = false;
newOpts.colorSpace = attributes.mColorSpace.Value();
}
if (StaticPrefs::gfx_color_management_native_srgb()) {
newOpts.ignoreColorSpace = false;
}

// Don't do antialiasing if we've disabled MSAA.
if (!StaticPrefs::webgl_msaa_samples()) {
Expand Down
10 changes: 3 additions & 7 deletions dom/canvas/WebGLContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -898,14 +898,10 @@ constexpr auto MakeArray(Args... args) -> std::array<T, sizeof...(Args)> {
}

inline gfx::ColorSpace2 ToColorSpace2(const WebGLContextOptions& options) {
auto ret = gfx::ColorSpace2::UNKNOWN;
if (StaticPrefs::gfx_color_management_native_srgb()) {
ret = gfx::ColorSpace2::SRGB;
if (options.ignoreColorSpace) {
return gfx::ColorSpace2::UNKNOWN;
}
if (!options.ignoreColorSpace) {
ret = gfx::ToColorSpace2(options.colorSpace);
}
return ret;
return gfx::ToColorSpace2(options.colorSpace);
}

// -
Expand Down
5 changes: 1 addition & 4 deletions dom/canvas/WebGLIpdl.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,7 @@ struct ParamTraits<mozilla::WebGLContextOptions> final
using T = mozilla::WebGLContextOptions;

static bool Validate(const T& val) {
bool ok = true;
ok &= ValidateParam(val.powerPreference);
ok &= ValidateParam(val.colorSpace);
return ok;
return ValidateParam(val.powerPreference) && ValidateParam(val.colorSpace);
}
};

Expand Down
6 changes: 2 additions & 4 deletions dom/canvas/WebGLTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ struct FloatOrInt final // For TexParameter[fi] and friends.

// -

struct WebGLContextOptions final {
struct WebGLContextOptions {
bool alpha = true;
bool depth = true;
bool stencil = false;
Expand All @@ -372,8 +372,8 @@ struct WebGLContextOptions final {

dom::WebGLPowerPreference powerPreference =
dom::WebGLPowerPreference::Default;
bool ignoreColorSpace = true;
dom::PredefinedColorSpace colorSpace = dom::PredefinedColorSpace::Srgb;
bool ignoreColorSpace = true; // Our legacy behavior.
bool shouldResistFingerprinting = true;

bool enableDebugRendererInfo = false;
Expand All @@ -400,8 +400,6 @@ struct WebGLContextOptions final {
// clang-format on
}

// -

WebGLContextOptions();
WebGLContextOptions(const WebGLContextOptions&) = default;

Expand Down
324 changes: 0 additions & 324 deletions dom/canvas/test/reftest/color_quads.html

This file was deleted.

Loading

0 comments on commit d0b127e

Please sign in to comment.