Change record status: 
Project: 
Introduced in branch: 
8.0.x
Description: 

The theme initialization code was moved into its service.

Code in Drupal 7:

drupal_theme_initialize();

Code in Drupal 8:

There should be no reason that you have to ensure that the theme system is initialized, as everything is done lazily. In case you really need
the best would be

\Drupal::theme()->getActiveTheme();

because it will take care about figuring out the current active theme using the ThemeNegotiators. If you want to initialize your own theme, do something like:

$theme_init = \Drupal::service('theme.initialization');
$active_theme = $theme_init->initTheme('my_theme');

\Drupal::theme()->setActiveTheme($active_theme);
Impacts: 
Module developers
Themers