Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(383)

Issue 262363007: Fix for empty saveLayer() with a filter which affects transparent black. (Closed)

Created:
6 years, 7 months ago by Stephen White
Modified:
6 years, 7 months ago
CC:
skia-review_googlegroups.com, robertphillips
Visibility:
Public.

Description

Fix for empty saveLayer() with a filter which affects transparent black. If an saveLayer()/restore() is recorded, tilegrid/rtree will cull them out and not draw anything. This is correct for most cases, but if the paint in the saveLayer() is one that affects transparent black (e.g., it contains a color filter or image filter which affects transparent black), this is incorrect: the filter should be applied. Fixed by adding a no-op between the saveLayer() and restore(), and adding a bbox node pointing at that node with the saveLayer()'s bounds. This exposed a bug in SkPictureRecord.cpp's match(), where it would assert if the NOOP was the last op seen. Fixed with an early-out before calling peek_op_and_size(). BUG=skia:2254 Committed: https://code.google.com/p/skia/source/detail?r=14604

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+89 lines, -6 lines) Patch
M src/core/SkBBoxHierarchyRecord.cpp View 1 chunk +22 lines, -1 line 0 comments Download
M src/core/SkPictureRecord.h View 1 chunk +3 lines, -0 lines 0 comments Download
M src/core/SkPictureRecord.cpp View 2 chunks +9 lines, -5 lines 0 comments Download
M tests/ImageFilterTest.cpp View 1 chunk +55 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
Stephen White
sugoi@: PTAL. This is a variant of your patch, using a no-op node to fix ...
6 years, 7 months ago (2014-05-06 22:31:02 UTC) #1
Justin Novosad
On 2014/05/06 22:31:02, Stephen White wrote: > sugoi@: PTAL. This is a variant of your ...
6 years, 7 months ago (2014-05-06 22:38:02 UTC) #2
Stephen White
Committed patchset #1 manually as r14604 (presubmit successful).
6 years, 7 months ago (2014-05-06 22:52:59 UTC) #3
reed2
6 years, 7 months ago (2014-05-07 03:54:18 UTC) #4
mtklein
Crazy. I don't anticipate any analogous problems in SkRecord. We may skip over SaveLayer/Restore blocks ...
6 years, 7 months ago (2014-05-07 15:14:51 UTC) #5
Stephen White
On 2014/05/07 15:14:51, mtklein wrote: > Crazy. > > I don't anticipate any analogous problems ...
6 years, 7 months ago (2014-05-07 15:36:39 UTC) #6
mtklein
> I've written a few that run in both CPU and GPU modes; maybe we ...
6 years, 7 months ago (2014-05-07 15:39:54 UTC) #7
Stephen White
6 years, 7 months ago (2014-05-07 15:49:28 UTC) #8
Message was sent while issue was closed.
On 2014/05/07 15:39:54, mtklein wrote:
> > I've written a few that run in both CPU and GPU modes; maybe we could come
up
> > with
> > a generalized way of writing a unit test and automatically running it with
> > different
> > SkCanvases?
> 
> Isn't a unit test that automatically runs with different canvases a GM?  The
> only common way we have to check all canvases is to flush, read the pixels and
> inspect them.  I guess what's missing is the ability to pack the expected
bitmap
> as part of the code rather than as a separate file?

I'm mostly talking about regression tests such as this, where the unit test can 
often be arbitrarily small (e.g., 10x10 or even 1x1) as long as it passes with 
the fix, and fails without it. No need for an expected bitmap if you only need
to test a single pixel. If you made that a GM, it'd be easy to rebaseline by 
accident, or misinterpret the results visually.

Powered by Google App Engine
This is Rietveld 408576698