disposeCachedRenderObjects method

void disposeCachedRenderObjects([
  1. bool colorStopsChanged = true
])

Implementation

void disposeCachedRenderObjects([bool colorStopsChanged = true]) {
  if (_canvasCacheKey != null) {
    _canvasGradientCache.releaseObject(_canvasCacheKey!);
  }

  _canvasGradient = null;
  _canvasCacheKey = null;
  if (colorStopsChanged && _gradientTexture != null) {
    if (_textureCacheKey != null) {
      _gradientTextureCache.releaseObject(_textureCacheKey!);
    }
    _gradientTexture = null;
    _textureCacheKey = null;
  }
}