mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 779535 - defaultNoAlpha preference is not used in case if nsIPropertyBag argument is 0. r=vlad
This commit is contained in:
parent
5c1ea56db9
commit
7a20b9b98b
@ -73,6 +73,15 @@ NS_NewCanvasRenderingContextWebGL(nsIDOMWebGLRenderingContext** aResult)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
WebGLContextOptions::WebGLContextOptions()
|
||||
: depth(true), stencil(false),
|
||||
premultipliedAlpha(true), antialias(true),
|
||||
preserveDrawingBuffer(false)
|
||||
{
|
||||
// Set default alpha state based on preference.
|
||||
alpha = Preferences::GetBool("webgl.default-no-alpha", false) ? 0 : 1;
|
||||
}
|
||||
|
||||
WebGLContext::WebGLContext()
|
||||
: gl(nullptr)
|
||||
{
|
||||
@ -289,9 +298,6 @@ WebGLContext::SetContextOptions(nsIPropertyBag *aOptions)
|
||||
if (!aOptions)
|
||||
return NS_OK;
|
||||
|
||||
bool defaultNoAlpha =
|
||||
Preferences::GetBool("webgl.default-no-alpha", false);
|
||||
|
||||
WebGLContextOptions newOpts;
|
||||
|
||||
GetBoolFromPropertyBag(aOptions, "stencil", &newOpts.stencil);
|
||||
@ -299,12 +305,7 @@ WebGLContext::SetContextOptions(nsIPropertyBag *aOptions)
|
||||
GetBoolFromPropertyBag(aOptions, "premultipliedAlpha", &newOpts.premultipliedAlpha);
|
||||
GetBoolFromPropertyBag(aOptions, "antialias", &newOpts.antialias);
|
||||
GetBoolFromPropertyBag(aOptions, "preserveDrawingBuffer", &newOpts.preserveDrawingBuffer);
|
||||
|
||||
// alpha defaults to true as per the spec, but we want to evaluate
|
||||
// what will happen if it were to default to false based on a pref
|
||||
if (!GetBoolFromPropertyBag(aOptions, "alpha", &newOpts.alpha) && defaultNoAlpha) {
|
||||
newOpts.alpha = false;
|
||||
}
|
||||
GetBoolFromPropertyBag(aOptions, "alpha", &newOpts.alpha);
|
||||
|
||||
// enforce that if stencil is specified, we also give back depth
|
||||
newOpts.depth |= newOpts.stencil;
|
||||
|
@ -424,11 +424,7 @@ protected:
|
||||
|
||||
struct WebGLContextOptions {
|
||||
// these are defaults
|
||||
WebGLContextOptions()
|
||||
: alpha(true), depth(true), stencil(false),
|
||||
premultipliedAlpha(true), antialias(true),
|
||||
preserveDrawingBuffer(false)
|
||||
{ }
|
||||
WebGLContextOptions();
|
||||
|
||||
bool operator==(const WebGLContextOptions& other) const {
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user