       validate:   (v) -> !v || isPlainArray v
 
   _loadBitmapFromSource: (source) ->
+    @_releaseCachedBitmap()
+    @_previousCacheSource = source
     sourceToBitmapCache.get source
     .then (bitmap) =>
       @onNextReady => @queueEvent "load", => bitmap:bitmap

    super
    @_bitmapToElementMatrix = new Matrix

  _unregister: ->
    sourceToBitmapCache.release @getSource()
    super

  @getter


    loaded: (url) -> @_loaded[url]

    @getter
      memoryUsage: ->
        bytes = 0
        for k, v of @_loaded
          bytes += v.byteSize
        bytes

    temporaryPut: (duration, url, bitmap) ->
      @get url, Promise.resolve bitmap
      # log temporaryPut: {bitmap, duration, url}
