|
|
Chromium Code Reviews
Descriptioncheck for inputs before reporting asColorFilter
moved to https://codereview.chromium.org/967833003
BUG=skia:
Patch Set 1 #Patch Set 2 : #Patch Set 3 : now with composecolorfilter #
Total comments: 1
Patch Set 4 : update to use composecolorfilter #Patch Set 5 : remove obsolete test #
Total comments: 3
Messages
Total messages: 32 (11 generated)
reed@chromium.org changed reviewers: + bsalomon@google.com, senorblanco@google.com, sugoi@google.com
Part of a large effort to devolve imagefilters into colorfilters when that is viable. That CL is in the works, but was failing due to false-positives from this imagefilter.
The CQ bit was checked by reed@chromium.org
reed@chromium.org changed reviewers: + reed@google.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/967143002/20001
Note for Reviewers: The CQ is waiting for an approval. If you believe that the CL is not ready yet, or if you would like to L-G-T-M with comments then please uncheck the CQ checkbox. Waiting for LGTM from valid reviewer(s) till 2015-03-02 01:04 UTC
The CQ bit was unchecked by commit-bot@chromium.org
No LGTM from a valid reviewer yet. Please ask for an LGTM from a full Skia committer from https://skia.googlesource.com/skia/+/master/CQ_COMMITTERS
The CQ bit was checked by reed@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/967143002/40001
Note for Reviewers: The CQ is waiting for an approval. If you believe that the CL is not ready yet, or if you would like to L-G-T-M with comments then please uncheck the CQ checkbox. Waiting for LGTM from valid reviewer(s) till 2015-03-02 10:38 UTC
The CQ bit was unchecked by commit-bot@chromium.org
No LGTM from a valid reviewer yet. Please ask for an LGTM from a full Skia committer from https://skia.googlesource.com/skia/+/master/CQ_COMMITTERS
senorblanco@chromium.org changed reviewers: + senorblanco@chromium.org
https://codereview.chromium.org/967143002/diff/40001/src/effects/SkColorFilte... File src/effects/SkColorFilterImageFilter.cpp (right): https://codereview.chromium.org/967143002/diff/40001/src/effects/SkColorFilte... src/effects/SkColorFilterImageFilter.cpp:174: *filter = SkColorFilter::CreateComposeFilter(fColorFilter, inputCF); As discussed, I think this will prevent the matrix/table collapse optimization. This function needs to test whether a single filter node can be expressed as a color filter, not the whole DAG, otherwise it would prevent optimizations such as blur -> CF1 -> CF2 --> blur -> CF3. If it's possible to do your new test after the create functions run, perhaps we can just test whether the resulting filter DAG is a single node which returns true for asColorFilter(). i.e., something like (filter->asColorFilter(&cf) && filter->inputCount() == 0).
ptal
The CQ bit was checked by reed@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/967143002/60001
Note for Reviewers: The CQ is waiting for an approval. If you believe that the CL is not ready yet, or if you would like to L-G-T-M with comments then please uncheck the CQ checkbox. Waiting for LGTM from valid reviewer(s) till 2015-03-04 07:38 UTC
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: Test-Ubuntu13.10-GCE-NoGPU-x86_64-Release-Shared-Trybot on client.skia (JOB_FAILED, http://build.chromium.org/p/client.skia/builders/Test-Ubuntu13.10-GCE-NoGPU-x...)
The CQ bit was checked by reed@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/967143002/80001
Note for Reviewers: The CQ is waiting for an approval. If you believe that the CL is not ready yet, or if you would like to L-G-T-M with comments then please uncheck the CQ checkbox. Waiting for LGTM from valid reviewer(s) till 2015-03-04 09:17 UTC
The CQ bit was unchecked by commit-bot@chromium.org
No LGTM from a valid reviewer yet. Please ask for an LGTM from a full Skia committer from https://skia.googlesource.com/skia/+/master/CQ_COMMITTERS
https://codereview.chromium.org/967143002/diff/80001/src/effects/SkColorFilte... File src/effects/SkColorFilterImageFilter.cpp (right): https://codereview.chromium.org/967143002/diff/80001/src/effects/SkColorFilte... src/effects/SkColorFilterImageFilter.cpp:93: *filter = SkColorFilter::CreateComposeFilter(fColorFilter, inputCF); I don't understand the need to call this here as well as in the Create() function above. Create() also calls asColorFilter(), so it seems like CreateComposeFilter() is being called multiple times. Create() should collapse any chain of CFIFs into a single CFIF on construction. Then your IF -> CF optimization just has to check for a single CFIF (via the original asColorFilter()) with a NULL input and extract its CF for direct application.
https://codereview.chromium.org/967143002/diff/80001/src/effects/SkColorFilte... File src/effects/SkColorFilterImageFilter.cpp (right): https://codereview.chromium.org/967143002/diff/80001/src/effects/SkColorFilte... src/effects/SkColorFilterImageFilter.cpp:93: *filter = SkColorFilter::CreateComposeFilter(fColorFilter, inputCF); On 2015/03/04 15:01:52, Stephen White wrote: > I don't understand the need to call this here as well as in the Create() > function above. Create() also calls asColorFilter(), so it seems like > CreateComposeFilter() is being called multiple times. > > Create() should collapse any chain of CFIFs into a single CFIF on construction. > Then your IF -> CF optimization just has to check for a single CFIF (via the > original asColorFilter()) with a NULL input and extract its CF for direct > application. Ah, perhaps so. In that case I could instead add an assert that the input (if not null) is never a colorfilter?
https://codereview.chromium.org/967143002/diff/80001/src/effects/SkColorFilte... File src/effects/SkColorFilterImageFilter.cpp (right): https://codereview.chromium.org/967143002/diff/80001/src/effects/SkColorFilte... src/effects/SkColorFilterImageFilter.cpp:93: *filter = SkColorFilter::CreateComposeFilter(fColorFilter, inputCF); On 2015/03/04 15:49:01, reed1 wrote: > On 2015/03/04 15:01:52, Stephen White wrote: > > I don't understand the need to call this here as well as in the Create() > > function above. Create() also calls asColorFilter(), so it seems like > > CreateComposeFilter() is being called multiple times. > > > > Create() should collapse any chain of CFIFs into a single CFIF on > construction. > > Then your IF -> CF optimization just has to check for a single CFIF (via the > > original asColorFilter()) with a NULL input and extract its CF for direct > > application. > > Ah, perhaps so. In that case I could instead add an assert that the input (if > not null) is never a colorfilter? It might have a crop rect. I suppose we could assert cropRectIsSet() || NULL == getInput(0) || !getInput(0)->asColorFilter() maybe?
On 2015/03/04 16:06:56, Stephen White wrote: > https://codereview.chromium.org/967143002/diff/80001/src/effects/SkColorFilte... > File src/effects/SkColorFilterImageFilter.cpp (right): > > https://codereview.chromium.org/967143002/diff/80001/src/effects/SkColorFilte... > src/effects/SkColorFilterImageFilter.cpp:93: *filter = > SkColorFilter::CreateComposeFilter(fColorFilter, inputCF); > On 2015/03/04 15:49:01, reed1 wrote: > > On 2015/03/04 15:01:52, Stephen White wrote: > > > I don't understand the need to call this here as well as in the Create() > > > function above. Create() also calls asColorFilter(), so it seems like > > > CreateComposeFilter() is being called multiple times. > > > > > > Create() should collapse any chain of CFIFs into a single CFIF on > > construction. > > > Then your IF -> CF optimization just has to check for a single CFIF (via the > > > original asColorFilter()) with a NULL input and extract its CF for direct > > > application. > > > > Ah, perhaps so. In that case I could instead add an assert that the input (if > > not null) is never a colorfilter? > > It might have a crop rect. I suppose we could assert > > cropRectIsSet() || NULL == getInput(0) || !getInput(0)->asColorFilter() > > maybe? Do we need a version of that test before we can legally collapse in the factory?
On 2015/03/04 18:40:35, reed1 wrote: > On 2015/03/04 16:06:56, Stephen White wrote: > > > https://codereview.chromium.org/967143002/diff/80001/src/effects/SkColorFilte... > > File src/effects/SkColorFilterImageFilter.cpp (right): > > > > > https://codereview.chromium.org/967143002/diff/80001/src/effects/SkColorFilte... > > src/effects/SkColorFilterImageFilter.cpp:93: *filter = > > SkColorFilter::CreateComposeFilter(fColorFilter, inputCF); > > On 2015/03/04 15:49:01, reed1 wrote: > > > On 2015/03/04 15:01:52, Stephen White wrote: > > > > I don't understand the need to call this here as well as in the Create() > > > > function above. Create() also calls asColorFilter(), so it seems like > > > > CreateComposeFilter() is being called multiple times. > > > > > > > > Create() should collapse any chain of CFIFs into a single CFIF on > > > construction. > > > > Then your IF -> CF optimization just has to check for a single CFIF (via > the > > > > original asColorFilter()) with a NULL input and extract its CF for direct > > > > application. > > > > > > Ah, perhaps so. In that case I could instead add an assert that the input > (if > > > not null) is never a colorfilter? > > > > It might have a crop rect. I suppose we could assert > > > > cropRectIsSet() || NULL == getInput(0) || !getInput(0)->asColorFilter() > > > > maybe? > > Do we need a version of that test before we can legally collapse in the factory? The factory can (and should, and does) collapse even if getInput(0) is non-NULL. We still want to optimize e.g. blur -> cf1 -> cf2 into blur -> cf3. We shouldn't optimize if there's a crop rect, which asColorFilter() takes care of today (returns false). |
