Bug 18488

Summary: BitmapData.fillRect not implemented
Product: swfdec Reporter: MenTaLguY <mental>
Component: libraryAssignee: swfdec ml <swfdec>
Status: RESOLVED FIXED QA Contact: swfdec ml <swfdec>
Severity: enhancement    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: A screenshot comparing the rendering in Adobe Flash and swfdec
A .swf compiled from the above example code

Description MenTaLguY 2008-11-11 13:28:53 UTC
BitmapData.fillRect is apparently not implemented.  The following haxe program demonstrates the issue:

 import flash.MovieClip;
 import flash.display.BitmapData;
 import flash.geom.Rectangle;

 class Main {
     public static inline var RECT_SIZE : Int = 25;

     public static function main() {
         var root : MovieClip = flash.Lib.current;
         var mc1 : MovieClip = root.createEmptyMovieClip("mc1", root.getNextHighestDepth());
         var b1 : BitmapData = new BitmapData(RECT_SIZE, RECT_SIZE, false, 0xffff0000);
         var mc2 : MovieClip = root.createEmptyMovieClip("mc2", root.getNextHighestDepth());
         var b2 : BitmapData = new BitmapData(RECT_SIZE, RECT_SIZE, true, 0xffff0000);
         b1.fillRect(b1.rectangle, 0x80000000);
         b2.fillRect(b2.rectangle, 0x80000000);
         mc1.attachBitmap(b1, 1);
         mc2.attachBitmap(b2, 1);
         mc1._x = 0;
         mc1._y = 0;
         mc2._x = RECT_SIZE;
         mc2._y = RECT_SIZE;
     }
 }

Expected result:

 The movie should show a solid black square in the upper left corner, and diagonally down from it a 50% transparent black square.

Actual result:

 The movie shows two solid red squares.

I've attached a screenshot showing the rendered results in Adobe Flash (on the left), and in swfdec (on the right).
Comment 1 MenTaLguY 2008-11-11 13:29:30 UTC
Created attachment 20227 [details]
A screenshot comparing the rendering in Adobe Flash and swfdec
Comment 2 MenTaLguY 2008-11-11 13:32:49 UTC
Created attachment 20228 [details]
A .swf compiled from the above example code
Comment 3 MenTaLguY 2008-11-14 14:37:15 UTC
Can this please be given a higher priority?  It is a very trivial patch, and I have a project which is blocked on this being implemented.

(I'd give you a patch myself, except that I'm not sure what the project's stance is WRT the Flash player EULA at this point.)
Comment 4 Riccardo Magliocchetti 2008-11-21 06:41:25 UTC
mental, this should be fixed in latest git.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.