private static void reconcileHints(GC gc, int applied, int hints) {
		int changes = hints ^ applied;

		if ((changes & XOR_MASK) != 0) {
			gc.setXORMode((hints & XOR_MASK) != 0);
		}

		// Check to see if there is anything remaining
		changes &= ~XOR_MASK;
		if (changes != 0) {
			if ((changes & INTERPOLATION_MASK) != 0) {
				gc.setInterpolation(((hints & INTERPOLATION_MASK) >> INTERPOLATION_SHIFT)
						- INTERPOLATION_WHOLE_NUMBER);
			}

			if ((changes & FILL_RULE_MASK) != 0) {
				gc.setFillRule(((hints & FILL_RULE_MASK) >> FILL_RULE_SHIFT)
						- FILL_RULE_WHOLE_NUMBER);
			}

			if ((changes & AA_MASK) != 0) {
				gc.setAntialias(((hints & AA_MASK) >> AA_SHIFT)
						- AA_WHOLE_NUMBER);
			}

			if ((changes & TEXT_AA_MASK) != 0) {
				gc.setTextAntialias(((hints & TEXT_AA_MASK) >> TEXT_AA_SHIFT)
						- AA_WHOLE_NUMBER);
			}

			// If advanced was flagged, but none of the conditions which trigger
			// advanced
			// actually got applied, force advanced graphics on.
			if ((changes & ADVANCED_GRAPHICS_MASK) != 0) {
				if ((hints & ADVANCED_GRAPHICS_MASK) != 0 && !gc.getAdvanced()) {
					gc.setAdvanced(true);
				}
			}
		}
	}