invalidatePreviewForTest method
Test hook: dispose and clear renderedPreview. Tests call this before a second refreshPreviewForTest so the new render is a distinct image (and the old one's GPU bitmap is released).
Implementation
@visibleForTesting
void invalidatePreviewForTest() => _invalidatePreview();