draw() : 4 ms
setPixels() : 63 ms
setVector() : 112 ms
source:
private function runTest():void { var sampleBitmap:Bitmap = new BitmapTest(); var bmd:BitmapData = new BitmapData(sampleBitmap.width, sampleBitmap.height, false, 0x0); var copyCat:Bitmap = new Bitmap(bmd); addChild(copyCat); var timer:uint = getTimer(); var bits:Vector.= sampleBitmap.bitmapData.getVector(sampleBitmap.bitmapData.rect); bmd.setVector(bmd.rect,bits); trace("setVector: " + (timer-getTimer()) + " ms"); timer = getTimer(); bmd.draw(sampleBitmap); trace("draw: " + (timer-getTimer()) + " ms"); timer = getTimer(); var bytes:ByteArray = sampleBitmap.bitmapData.getPixels(sampleBitmap.bitmapData.rect); bytes.position = 0; bmd.setPixels(bmd.rect,bytes); trace("setPixels: " + (timer-getTimer()) + " ms"); }
0 yorum:
Yorum Gönder