mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-29 10:26:36 +01:00
Mirror of git://xwords.git.sourceforge.net/gitroot/xwords/xwords
7a1965aeaf
Starting with the release of Nougat there have been cases where the board would not correctly redraw. It's been most evident when using the hit feature many times in a row, with something going wrong every fifth time or so (but not that consistently.) It's as if modifications of the bitmap backing BoardCanvas were being done asynchronously and not necessarily all completed when I blit the canvas to the screen via canvas.drawBitmap(). (As evidence of this I confirmed that a tap on a tile in the tray after a bad draw would cause the screen to correct itself even though the only additional rendering was to the tray. So by the time that second drawBitmap() call happened the bitmap data was correct: all draws that hadn't completed earlier had done so by now.) The fix is to call Bitmap.createBitmap(bitmap) and to use the copy as the source of the canvas.drawBitmap() blit operation. I suspect that createBitmap() waits for any pending draws into its source to complete before making the copy. Regardless, if this hasn't fixed the problem it's made it so rare that I'm not seeing it, and since I'm only doing the copy on Nougat there's little risk in the change. And I can't detect any problems coming from the considerable additional memory being used and immediately marked available for gc. |
||
---|---|---|
xwords4 | ||
.gitignore | ||
.projectile |