Refactoring: separate the tile non-animated region optimization.

Now the optimization of drawing tiles is in a separate class. This will
allow to do more optimizations.