code: private boolean  pushLayer()
     {
        if (!requiresCompositing())
           return false;
  
        // Custom version of statePush() that also saves the layer
        canvas.saveLayerAlpha(null, clamp255(state.style.opacity), Canvas.ALL_SAVE_FLAG);
  
        // Save style state
        stateStack.push(state);
        state = new RendererState(state);
  
        if (state.style.mask != null) {
           SVG.SvgObject  ref = document.resolveIRI(state.style.mask);
           // Check the we are referencing a mask element
           if (ref == null || !(ref instanceof SVG.Mask)) {
              // This is an invalid mask reference - disable this object's mask
              error("Mask reference '%s' not found", state.style.mask);
              state.style.mask = null;
              return true;
           }
  
           // After this method completes, the caller will draw the masked object to it's own layer.
           // That will later be composited together with our mask layer (in popLayer())
        }
  
        return true;
     }
docs: ==============================================================================