From 2e2a262cd59b978255ef50d877e0be0cafe37a6a Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 19 Sep 2014 01:15:07 +0200 Subject: GLContextImpl.setRendererQuirks(..): Use GLRendererQuirks.addQuirk(int), dropping usage of .addQuirks(int[] quirks, offset, len) Directly adding a quirk allows dropping usage of erroneous fixed-sized int[] array for accumulated quirks. --- .../classes/com/jogamp/opengl/GLRendererQuirks.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/jogl/classes/com') diff --git a/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java b/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java index 83fceeb2f..f6e671c88 100644 --- a/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java +++ b/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java @@ -357,6 +357,17 @@ public class GLRendererQuirks { return device1.getUniqueID() == device2.getUniqueID(); // uses .intern()! } + /** + * {@link #addQuirk(int) Adding given quirk} of sticky {@link AbstractGraphicsDevice}'s {@link GLRendererQuirks}. + *

+ * Not thread safe. + *

+ * @see #getStickyDeviceQuirks(AbstractGraphicsDevice) + */ + public static void addStickyDeviceQuirk(final AbstractGraphicsDevice device, final int quirk) throws IllegalArgumentException { + final GLRendererQuirks sq = getStickyDeviceQuirks(device); + sq.addQuirk(quirk); + } /** * {@link #addQuirks(int[], int, int) Adding given quirks} of sticky {@link AbstractGraphicsDevice}'s {@link GLRendererQuirks}. *

@@ -418,6 +429,15 @@ public class GLRendererQuirks { addQuirks(quirks, offset, len); } + /** + * @param quirk valid quirk to be added + * @throws IllegalArgumentException if the quirk is out of range + */ + public final void addQuirk(final int quirk) throws IllegalArgumentException { + validateQuirk(quirk); + _bitmask |= 1 << quirk; + } + /** * @param quirks an array of valid quirks to be added * @param offset offset in quirks array to start reading -- cgit v1.2.3