Bug 1384

Summary: Allow GLRendererQuirks to be overridden by user properties
Product: [JogAmp] Jogl Reporter: Sven Gothel <sgothel>
Component: openglAssignee: Sven Gothel <sgothel>
Status: RESOLVED FIXED    
Severity: enhancement    
Priority: P2    
Version: 2.4.0   
Hardware: All   
OS: all   
Type: FEATURE SCM Refs:
209bb2f0dc3418d168dc6887802bf4368b6d6f4e 2c4114b50f4023843073acf6d4cea223fb491e7e
Workaround: ---
Bug Depends on:    
Bug Blocks: 1383    

Description Sven Gothel 2019-08-21 02:13:27 CEST
Allow GLRendererQuirks to be overridden by user properties,
allowing to either force (inject) a quirk by a user property 
or to ignore a quirk by a user property.

This helps:
- debugging certain quirk behavior (See Bug 1383)
- allowing a user to customize the quirk setting

Proposal:
    /**
     * Allow overriding any quirk settings
     * via the two properties:
     * <ul>
     *   <li>jogl.quirks.force</li>
     *   <li>jogl.quirks.ignore</li>
     * </ul>
     * Both contain a list of capital sensitive quirk names separated by comma.
     * Example:
     * <pre>
     * java -Djogl.quirks.force=GL3CompatNonCompliant,NoFullFBOSupport -cp my_classpath some.main.Class
     * </pre>
     * <p>
     * Naturally, one quirk can only be listed in one override list.
     * Hence the two override sets force and ignore are unique.
     * </p>
     */
    public static enum Override {
        /**
         * No override.
         */
        NONE,
        /**
         * Enforce the quirk, i.e. allowing the code path to be injected w/o actual cause.
         */
        FORCE,
        /**
         * Ignore the quirk, i.e. don't set the quirk if otherwise caused.
         */
        IGNORE
    }
Comment 1 Sven Gothel 2019-08-21 02:20:43 CEST
commit 209bb2f0dc3418d168dc6887802bf4368b6d6f4e
adds this feature plus:

    +++
    
    This patch also refines the quirk: GLNonCompliant -> GL3CompatNonCompliant,
    i.e. constraints its semantics to GL3 compatible context.
    
    +++
    
    This patch also removed useless code of GLRendererQuirk,
    i.e. the 'int[] quirk' array arguments which are nonsense
    or wasteful, as we operate with bitmasks.
Comment 2 Sven Gothel 2019-08-23 07:31:52 CEST
commit 2c4114b50f4023843073acf6d4cea223fb491e7e
Move remaining 'lose' property quirks into GLRendererQuirks.Override