Fix rotation with viewport, better night mode with viewport

This fixes rotation with a viewport. It also implements bezel area (framebuffer outside viewport) cleaning with black in night mode.