Open Bug 745868 Opened 12 years ago Updated 2 years ago

GfxInfo API should have a simpler, less bug-prone way to query a feature's safeness

Categories

(Core :: Graphics, defect)

defect

Tracking

()

People

(Reporter: bjacob, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

One of the key ingredients in bug 711656 / bug 715401 was that the GfxInfo API is bug-prone to use. To know if a feature is safe to use, you have to call GetFeatureStatus and correctly interprete the resulting status code.

This patch introduces a better, simpler API: IsFeatureSafe returning bool.

The old GetFeatureStatus stays, is still useful in aboutSupport.js, but is discouraged for most use cases.

Try:
https://tbpl.mozilla.org/?tree=Try&rev=d8ae3f8a802b
Attachment #615410 - Flags: review?(joe)
Comment on attachment 615410 [details] [diff] [review]
new API: bool IsFeatureSafe(feature)

Review of attachment 615410 [details] [diff] [review]:
-----------------------------------------------------------------

::: content/canvas/src/WebGLContext.cpp
@@ +435,3 @@
>      if (mOptions.antialias &&
> +            (forceMSAA ||
> +                (gfxInfo && gfxInfo->IsFeatureSafe(nsIGfxInfo::FEATURE_WEBGL_MSAA))))

boo for big indentation

::: widget/nsIGfxInfo.idl
@@ +146,5 @@
> + /**
> +  * Quick, easy and fool-proof way to check if a feature is safe to use.
> +  * Blacklist checks should use this instead of getFeatureStatus.
> +  */
> + boolean isFeatureSafe(in long aFeature);

You could add a notxpcom version that returns boolean too; that way you wouldn't need all the casts to GfxInfoBase.
Attachment #615410 - Flags: review?(joe) → review+
Oh, and you need to rev nsIGfxInfo's iid.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: