e</a> with
<a href="../../dart-ui/Canvas/saveLayer.html">saveLayer</a>.</li>
</ul>
    </section>
    
    <section class="summary source-code" id="source">
      <h2><span>Implementation</span></h2>
      <pre class="language-dart"><code class="language-dart">void saveLayer(Rect bounds, Paint paint) {
  assert(paint != null);
  if (bounds == null) {
    _saveLayerWithoutBounds(paint._objects, paint._data);
  } else {
    assert(_rectIsValid(bounds));
    _saveLayer(bounds.left, bounds.top, bounds.right, bo