BitmapData.applyFilter doesn't work in HTML5

Hello!
BitmapData.applyFilter function doesn’t work in OpenFL at all, because the important input parameter “sourceBitmapData:BitmapData” just never used in this function.
I change

var lastBitmap = filter.__applyFilter (bitmapData2, this, sourceRect, destPoint);

to

var lastBitmap = filter.__applyFilter (bitmapData2, sourceBitmapData, sourceRect, destPoint);

and now it works fine for some filters which i used, but I’m not sure that this is absolutely correct fix (for all types of filters), so need your opinion…

Doesn’t anyone use the applyFilter? :thinking: I use this cheap (if apply once while preparing the scene) method all the time, both in 2D and in 3D (once before loading into a texture, in order to use the same image for different situations and environments). And method works fine with just correcting one typo :slight_smile:

What filter are you using?

ColorMatrixFilter, BlurFilter, for example…

I found one more problem with BitmapData.applyFilter

If source rect is only part of image it use wrong coordinates.
This code work fine

bd.applyFilter(bd, new Rectangle(part_x, part_y, part_x + part_width, part_y + part_height), new Point(part_x, part_y), filter);

and this code is NOT work,
bd.applyFilter(bd, new Rectangle(part_x, part_y, part_width, part_height), new Point(part_x, part_y), filter);

but must be vice versa because Rectangle constructor paramerts are x,y,width,height