Reduce memory usage of ScreenshotTestRule when creating expected Bitmap

This was done due to OOM Exceptions occuring in tests.
It also simplifies the code.

The original code had undocumented behaviour of creating a 3px thick line on the top and bottom and 2px on the sides if they coincide with the edges of the image. The new code always draws rects of thickness 2.

Bug: 299062874
Test: Manual check of generated images. This cannot be unit tested as it is an implementation detail (private fun) of ScreenshotTestRule.
Change-Id: I5061999c89f445fcb915d5dfb7c0c91905abf35d
1 file changed