gl2: factor queryCommonState out of queryGraphicsState.