Merge changes from topic "nullable-timestats"

* changes:
  CE: Make TimeStats nullable
  RE: move useProtectedContext calls to drawLayers