Skip to content

Commit

Permalink
Fixed recreation of skSurface after surfaceDestroy
Browse files Browse the repository at this point in the history
When the surface is invalidated (view is not visible) and the surface is available again, the skia surface needs to be recreated. Added a test to check for null _skSurface when surface is available.
  • Loading branch information
chrfalch committed Dec 24, 2021
1 parent 52aaa07 commit b104467
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion package/android/cpp/jni/JniSkiaDrawView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,9 @@ namespace RNSkia
return false;
}

if (!_skRenderTarget.isValid() || _prevWidth != _width ||
if (_skSurface == nullptr ||
!_skRenderTarget.isValid() ||
_prevWidth != _width ||
_prevHeight != _height)
{
RNSkMeasureTime measure =
Expand Down

0 comments on commit b104467

Please sign in to comment.