Bug 1841840 Comment 4 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

The preferred behavior we settled on for webgl is that:
* request low-power => low-power
* request high-power => high-power
* no preference => low-power (but this was high-power originally)

And also there's a pref for users to override this: `webgl.power-preference-override`: (for if a user wants the browser to 'always' or 'never' use the high-power option)

Here is where we choose if we ask for HIGH_POWER for creating our GLContext:
https://searchfox.org/mozilla-central/rev/2bf90dc51ce7e8274ce208fbb9d68b3ff535185e/dom/canvas/WebGLContext.cpp#332-341
```
    const auto overrideVal = StaticPrefs::webgl_power_preference_override();
    if (overrideVal > 0) {
      powerPref = dom::WebGLPowerPreference::High_performance;
    } else if (overrideVal < 0) {
      powerPref = dom::WebGLPowerPreference::Low_power;
    }

    if (powerPref == dom::WebGLPowerPreference::High_performance) {
      flags |= gl::CreateContextFlags::HIGH_POWER;
    }
```
The preferred behavior we settled on for **WebGL** is that:
* request low-power => low-power
* request high-power => high-power
* no preference => low-power (but this was high-power originally)

And also there's a pref for users to override this: `webgl.power-preference-override`: (for if a user wants the browser to 'always' or 'never' use the high-power option)

Here is where we choose if we ask for HIGH_POWER for creating our GLContext:
https://searchfox.org/mozilla-central/rev/2bf90dc51ce7e8274ce208fbb9d68b3ff535185e/dom/canvas/WebGLContext.cpp#332-341
```
    const auto overrideVal = StaticPrefs::webgl_power_preference_override();
    if (overrideVal > 0) {
      powerPref = dom::WebGLPowerPreference::High_performance;
    } else if (overrideVal < 0) {
      powerPref = dom::WebGLPowerPreference::Low_power;
    }

    if (powerPref == dom::WebGLPowerPreference::High_performance) {
      flags |= gl::CreateContextFlags::HIGH_POWER;
    }
```

Back to Bug 1841840 Comment 4