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

Issue 220723007: Fix SkXfermodeImageFilter when an input is cropped out. (Closed)

Created:
6 years, 8 months ago by Stephen White
Modified:
6 years, 8 months ago
Reviewers:
sugoi1, bsalomon, sugoi
CC:
skia-review_googlegroups.com
Visibility:
Public.

Description

Fix SkXfermodeImageFilter when an input is cropped out. If one of inputs to SkXfermodeImageFilter draws nothing, either due to it being cropped out upstream, or within the filter itself, the filter should still draw the other input, since otherwise the result will be incorrect. For the GPU path, since we can't detect this case in canFilterImageGPU() without recursing, we'll just drop to the generic path if either input is empty, since we can't use the effect in that case anyway. While we're at it, let's drop to the generic path if the xfermode can't be expressed as an effect, since the code here was doing a 2-pass render in that case anyway, which is equivalent to what the (xfermode == NULL) case was doing anyway. R=bsalomon@google.com, sugoi@chromium.org Committed: https://code.google.com/p/skia/source/detail?r=14016

Patch Set 1 #

Patch Set 2 : Add unit test #

Patch Set 3 : Fix GPU path; fix all-cropped out case; add more test cases #

Patch Set 4 : NULL mode can be handled by the generic path too. #

Patch Set 5 : Fix whitespace #

Patch Set 6 : Check for non-effect xfermodes in canFilterImageGPU #

Patch Set 7 : Don't bother checking drawsNothing() #

Unified diffs Side-by-side diffs Delta from patch set Stats (+85 lines, -25 lines) Patch
M include/effects/SkXfermodeImageFilter.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M src/effects/SkXfermodeImageFilter.cpp View 1 2 3 4 5 6 5 chunks +24 lines, -24 lines 0 comments Download
M tests/ImageFilterTest.cpp View 1 2 3 4 2 chunks +60 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Stephen White
PTAL. Thanks!
6 years, 8 months ago (2014-04-01 18:00:40 UTC) #1
sugoi
On 2014/04/01 18:00:40, Stephen White wrote: > PTAL. Thanks! LGTM
6 years, 8 months ago (2014-04-01 18:09:15 UTC) #2
Stephen White
+Brian for header file changes
6 years, 8 months ago (2014-04-01 19:02:25 UTC) #3
bsalomon
On 2014/04/01 19:02:25, Stephen White wrote: > +Brian for header file changes lgtm
6 years, 8 months ago (2014-04-01 19:07:21 UTC) #4
Stephen White
6 years, 8 months ago (2014-04-01 19:15:27 UTC) #5
Message was sent while issue was closed.
Committed patchset #7 manually as r14016 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698