mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1247327. Fix WebGL acceptance rates in telemetry. r=milan
We were not checking for failure after initialization.
This commit is contained in:
parent
3f6d62e48e
commit
fa04c0c56c
@ -139,11 +139,8 @@ CanvasRenderingContextHelper::CreateContext(CanvasContextType aContextType)
|
||||
Telemetry::Accumulate(Telemetry::CANVAS_WEBGL_USED, 1);
|
||||
|
||||
ret = WebGL1Context::Create();
|
||||
if (!ret) {
|
||||
Telemetry::Accumulate(Telemetry::CANVAS_WEBGL_SUCCESS, 0);
|
||||
if (!ret)
|
||||
return nullptr;
|
||||
}
|
||||
Telemetry::Accumulate(Telemetry::CANVAS_WEBGL_SUCCESS, 1);
|
||||
|
||||
break;
|
||||
|
||||
@ -151,11 +148,8 @@ CanvasRenderingContextHelper::CreateContext(CanvasContextType aContextType)
|
||||
Telemetry::Accumulate(Telemetry::CANVAS_WEBGL_USED, 1);
|
||||
|
||||
ret = WebGL2Context::Create();
|
||||
if (!ret) {
|
||||
Telemetry::Accumulate(Telemetry::CANVAS_WEBGL2_SUCCESS, 0);
|
||||
if (!ret)
|
||||
return nullptr;
|
||||
}
|
||||
Telemetry::Accumulate(Telemetry::CANVAS_WEBGL2_SUCCESS, 1);
|
||||
|
||||
break;
|
||||
|
||||
@ -204,8 +198,16 @@ CanvasRenderingContextHelper::GetContext(JSContext* aCx,
|
||||
// See bug 645792 and bug 1215072.
|
||||
// We want to throw only if dictionary initialization fails,
|
||||
// so only in case aRv has been set to some error value.
|
||||
if (contextType == CanvasContextType::WebGL1)
|
||||
Telemetry::Accumulate(Telemetry::CANVAS_WEBGL_SUCCESS, 0);
|
||||
else if (contextType == CanvasContextType::WebGL2)
|
||||
Telemetry::Accumulate(Telemetry::CANVAS_WEBGL2_SUCCESS, 0);
|
||||
return nullptr;
|
||||
}
|
||||
if (contextType == CanvasContextType::WebGL1)
|
||||
Telemetry::Accumulate(Telemetry::CANVAS_WEBGL_SUCCESS, 1);
|
||||
else if (contextType == CanvasContextType::WebGL2)
|
||||
Telemetry::Accumulate(Telemetry::CANVAS_WEBGL2_SUCCESS, 1);
|
||||
} else {
|
||||
// We already have a context of some type.
|
||||
if (contextType != mCurrentContextType)
|
||||
|
Loading…
Reference in New Issue
Block a user