   }
 
   public func flush() {
-    NSLog("\(#function)")
+    if self.rectsMarkedForRender.isEmpty {
+      return
+    }
+
+    DispatchUtils.gui {
+      self.rectsMarkedForRender.forEach(self.setNeedsDisplay)
+      self.rectsMarkedForRender.removeAll()
+    }
   }
 
   public func updateForeground(_ fg: Int32) {
     DispatchUtils.gui {
-      NSLog("\(#function)")
       self.grid.foreground = UInt32(bitPattern: fg)
 //      NSLog("\(ColorUtils.colorIgnoringAlpha(UInt32(fg)))")
     }

  }

  public func updateSpecial(_ sp: Int32) {
    DispatchUtils.gui {
      self.grid.special = UInt32(bitPattern: sp)
    }

  }

  fileprivate func markForRenderWholeView() {
    self.rectsMarkedForRender.append(self.bounds)
  }

  fileprivate func markForRender(region: Region) {
    self.rectsMarkedForRender.append(self.regionRectFor(region: region))
  }

  fileprivate func markForRender(row: Int, column: Int) {
    self.rectsMarkedForRender.append(self.cellRectFor(row: row, column: column))
  }
}
