public void setRawClip(ui.geom.Shape clip)
 {
     removeClip();
     if (clip == null)
     {
         return;
     }
     com.codename1.ui.geom.Rectangle bounds = clip.getBounds();
     if (bounds.getWidth() <= 0 || bounds.getHeight() <= 0)
     {
         layer = graphics.CreateLayer(1f, new Rect(
                                          bounds.getX(),
                                          bounds.getY(),
                                          1,
                                          1
                                          ));
         return;
     }
     if (clip.isRectangle())
     {
         layer = graphics.CreateLayer(1f, new Rect(
                                          bounds.getX(),
                                          bounds.getY(),
                                          bounds.getWidth(),
                                          bounds.getHeight()
                                          ));
         return;
     }
     layer = graphics.CreateLayer(1f, CanvasGeometry.CreatePath(SilverlightImplementation.instance.cn1ShapeToAndroidPath(clip)));
 }
 internal virtual void setClip(Rectangle clip)
 {
     if (clip == null)
     {
         return;
     }
     if (clip.getWidth() <= 0)
     {
         System.Diagnostics.Debug.WriteLine("aaaaaaaaaaaaaaaaaaaa width");
         clip.setWidth(1);
     }
     if (clip.getHeight() <= 0)
     {
         System.Diagnostics.Debug.WriteLine("aaaaaaaaaaaaaaaaaaaa height");
         clip.setHeight(1);
     }
     layer = graphics.CreateLayer(1, new Rect(
         clip.getX(),
         clip.getY(),
         clip.getWidth(),
         clip.getHeight()
     ));
 }
        internal virtual void setClipShape(ui.geom.Shape clip)
        {
            removeClip();
            if (clip == null)
            {
                return;
            }
            com.codename1.ui.geom.Rectangle bounds = clip.getBounds();
            if (bounds.getWidth() <= 0 || bounds.getHeight() <= 0)
            {
                setClip(bounds);
                return;
            }

            CanvasPathBuilder nativeShape = SilverlightImplementation.instance.cn1ShapeToAndroidPath(clip);

            layer = graphics.CreateLayer(1f, CanvasGeometry.CreatePath(nativeShape));
        }