Blur Filter giving wrong out put on Few Samsung devices on passing crop rect

28 views
Skip to first unread message

ahujab...@gmail.com

unread,
Jul 22, 2022, 6:26:58 AMJul 22
to skia-discuss
Hi,

I am noticing SkImageFilters::blur giving blank output passing crop rect on M101. Previously I was on M83 and it was working fine. Btw if I don't pass crop rect it works fine. In this case, I am passing crop rect larger than source image

Have we seen a similar failure?

The output image and skpicture files are copied here.


static sk_sp< SkImageFilter > CreateCropEffect( sk_sp< SkImageFilter >&& pInput, const SkIRect& cropRect )
{
      sk_sp< SkImageFilter > pCropInputFilter = std::move( pInput );
      return SkImageFilters::Merge( &pCropInputFilter, 1, &cropRect );
}

      sk_sp< SkImageFilter > pOutput = SkImageFilters::Blur( ConvertRadiusToSigma( radius_x ), ConvertRadiusToSigma( radius_y ), std::move( pInput ), &blurCropRect );
      pOutput = CreateCropEffect( std::move( pOutput ), blurCropRect ); this doesn't work

      sk_sp< SkImageFilter > pOutput = SkImageFilters::Blur( ConvertRadiusToSigma( radius_x ), ConvertRadiusToSigma( radius_y ), std::move( pInput ) );
      pOutput = CreateCropEffect( std::move( pOutput ), blurCropRect ); ( this works )

Input -> image17_seq04_d01_EffectBlur_src.png
Output ->image17_seq04_d01_EffectBlur_dest.png


Thanks
Bharat



ahujab...@gmail.com

unread,
Jul 25, 2022, 1:45:54 AMJul 25
to skia-discuss
Bumping this up:  This is only happening if I supply a crop rect larger than the actual input size. If I trim crop rect with input bounds, things seem to be working fine. Seems like a new bug in the M101 version.
        blurCropRect  = Intersect(  blurCropRect , m_inBounds );   
  sk_sp< SkImageFilter > pOutput = SkImageFilters::Blur( ConvertRadiusToSigma( radius_x ), ConvertRadiusToSigma( radius_y ), std::move( pInput,  & blurCropRect  ) );     //   this works fine too 

John Stiles

unread,
Aug 1, 2022, 2:52:46 PMAug 1
to skia-discuss
Are you able to reproduce the issue with a fiddle? 
That makes it a lot easier for us to debug on our side.

ahujab...@gmail.com

unread,
Aug 1, 2022, 3:16:14 PMAug 1
to skia-discuss
Hi John,

This scenario is a little complex and involves chaining multiple image filters and run time shaders. I have added .skp files, I was able to serialize from SkPicture.  This .skp file can be deserialized as SkPicture to repro the bug.

I ''ll try to repro on fiddle and see if I can get a more accessible repro and will get back to you guys.

Thanks
Bharat
Reply all
Reply to author
Forward
0 new messages