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)
Core
Graphics
Tracking
()
NEW
People
(Reporter: bjacob, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
19.08 KB,
patch
|
joe
:
review+
|
Details | Diff | Splinter Review |
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 1•12 years ago
|
||
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+
Comment 2•12 years ago
|
||
Oh, and you need to rev nsIGfxInfo's iid.
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•