New issue
Advanced search Search tips
Starred by 5 users
Status: Accepted
Owner:
Cc:
Area: ImageFilter
Priority: Medium
Type: Defect



Sign in to add a comment
resizeimagefilter and imageresizetiled draw cropped when drawn from a picture using a bounding box hierarchy
Project Member Reported by mtkl...@google.com, Jul 9 2014 Back to list
What steps will reproduce the problem?
0. Patch 377373003 if it hasn't yet landed.
1. Remove onGetFlags() from resizeimagefilter and/or imageresizetiled
2. Run dm --match resize -w /tmp/dm
3. Have a look at the differences between /tmp/dm/8888 and /tmp/dm/rtree/8888 (or quadtree or tilegrid).

The parts of the GM drawn appear to have the wrong bounds, and are skipped in tiles they're actually supposed to be in.

Robert and I suspect this has something to do with not adjusting for the paint in SkBBoxHierarchyRecord::willSaveLayer.
 
Project Member Comment 1 by senorblanco@chromium.org, Jul 9 2014
Could also be a bug in SkMatrixImageFilter::onFilterBounds(). This is the function that's supposed to adjust bounds for the resize filter.

I would expect to see more bugs of this type with other filters, if it's a general case of the recording not adjusting for the growth of filter bounds. (This is supposed to happen in the call to imageFilter->filterBounds() in SkCanvas::clipRectBounds(), if that helps).
Project Member Comment 2 by bugdroid1@chromium.org, Jul 11 2014
The following revision refers to this bug:
  https://skia.googlesource.com/skia.git/+/6ca0b6a46cbe9bef3e2b9b9db813ec864efd62de

commit 6ca0b6a46cbe9bef3e2b9b9db813ec864efd62de
Author: senorblanco <senorblanco@chromium.org>
Date: Fri Jul 11 09:56:03 2014 -0700

Fix for saveLayer() with filters vs. the BBox Hierarchy.

When building acceleration structures for SkPicture, we must transform
the primitive's bounds not only by its own SkPaint, but by the paints of
any saveLayer()s currently active above it.

We do this by pushing the SkPaint onto a stack on
saveLayer(), and popping them on restore(). We also push
a NULL paint in save(), so that the pushes and pops are
balanced.

BUG=skia:2734
R=mtklein@google.com, reed@google.com

Author: senorblanco@chromium.org

Review URL: https://codereview.chromium.org/380373003


Project Member Comment 3 by bugdroid1@chromium.org, Jul 14 2014
The following revision refers to this bug:
  https://skia.googlesource.com/skia.git/+/837f5321a409228a27fc710eb71c87866b820cfb

commit 837f5321a409228a27fc710eb71c87866b820cfb
Author: senorblanco <senorblanco@chromium.org>
Date: Mon Jul 14 10:19:54 2014 -0700

Fix for saveLayer() with filters vs. the BBox Hierarchy.

When building acceleration structures for SkPicture, we must transform
the primitive's bounds not only by its own SkPaint, but by the paints of
any saveLayer()s currently active above it.

We do this by pushing the SkPaint onto a stack on
saveLayer(), and popping them on restore(). We also push
a NULL paint in save(), so that the pushes and pops are
balanced.

BUG=skia:2734
R=mtklein@google.com, reed@google.com, robertphillips@google.com

Committed: https://skia.googlesource.com/skia/+/6ca0b6a46cbe9bef3e2b9b9db813ec864efd62de

Author: senorblanco@chromium.org

Review URL: https://codereview.chromium.org/380373003


Project Member Comment 4 by senorblanco@chromium.org, Sep 8 2014
Patch 377373003 was landed, and change 837f5321a409228a27fc710eb71c87866b820cfb seems 
to have fixed the resizeimagefilter GM, but imageresizetiled remains problematic (or
at least, the flag is still there -- II haven't actually tried removing it).
Project Member Comment 5 by hcm@google.com, Dec 7 2015
Labels: Hotlist-Fixit
Project Member Comment 6 by senorblanco@chromium.org, Dec 15 2015
Labels: Area-ImageFilter
Sign in to add a comment