         bmd.draw(src, m, null, null, null, true);
         return bmd;
     }
+
+    protected static function getBitmapDrawableBounds (src :IBitmapDrawable) :Rectangle {
+        if (src is BitmapData) {
+            return new Rectangle(0, 0, BitmapData(src).width, BitmapData(src).height);
+        } else if (src is DisplayObject) {
+            return DisplayObject(src).getBounds(DisplayObject(src));
+        } else {
+            throw new ArgumentError("src must be a a BitmapData or a DisplayObject");
+        }
+    }
 }
 }
            src = renderToBitmapData(src, Math.ceil(targetW), Math.ceil(targetH), multipassScaleThreshold);
            targetScale /= multipassScaleThreshold;
        }
        bounds = srcBounds();

        var bmd :BitmapData = new BitmapData(w, h, true, 0x00);
        var m :Matrix = new Matrix();

import flash.display.DisplayObject;
import flash.display.IBitmapDrawable;
import flash.geom.Matrix;
import flash.geom.Point;
import flash.geom.Rectangle;
import flash.utils.ByteArray;

