|
|
Created:
6 years, 9 months ago by Savago Modified:
6 years, 8 months ago CC:
blink-reviews, jamesr, krit, dsinclair, jbroman, danakj, Rik, Stephen Chennney, pdr., rwlbuis Base URL:
https://chromium.googlesource.com/chromium/blink.git@master Visibility:
Public. |
DescriptionRemove software path from filters: FEGaussianBlur.
BUG=357672
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=170356
Patch Set 1 #
Total comments: 3
Patch Set 2 : Addressing reviewer's notes. #Patch Set 3 : Forgot the call in FilterEffect. #Patch Set 4 : Cleaned up. #
Total comments: 1
Patch Set 5 : Last changes. #
Messages
Total messages: 24 (0 generated)
+cc senorblanco
https://codereview.chromium.org/215303003/diff/1/Source/platform/graphics/fil... File Source/platform/graphics/filters/FilterEffect.h (right): https://codereview.chromium.org/215303003/diff/1/Source/platform/graphics/fil... Source/platform/graphics/filters/FilterEffect.h:203: virtual void applySoftware() { }; I don't think this is correct. I think this will turn all filters which don't have applySkia() into no-ops. I think the correct solution is to rename FEGaussianBlur::applySkia() to FEGaussianBlur::applySoftware(), and remove the existing FEGaussianBlur::applySoftware() (as you've done).
On 2014/03/27 21:40:14, Stephen White wrote: > https://codereview.chromium.org/215303003/diff/1/Source/platform/graphics/fil... > File Source/platform/graphics/filters/FilterEffect.h (right): > > https://codereview.chromium.org/215303003/diff/1/Source/platform/graphics/fil... > Source/platform/graphics/filters/FilterEffect.h:203: virtual void > applySoftware() { }; > I don't think this is correct. I think this will turn all filters which don't > have applySkia() into no-ops. > > I think the correct solution is to rename FEGaussianBlur::applySkia() to > FEGaussianBlur::applySoftware(), and remove the existing > FEGaussianBlur::applySoftware() (as you've done). BTW, this shouldn't require any changes to FilterEffect. Once all applySkia()s have been renamed and old code removed, we can remove it from FilterEffect.
https://codereview.chromium.org/215303003/diff/1/Source/platform/graphics/fil... File Source/platform/graphics/filters/FilterEffect.h (right): https://codereview.chromium.org/215303003/diff/1/Source/platform/graphics/fil... Source/platform/graphics/filters/FilterEffect.h:203: virtual void applySoftware() { }; applySoftware() is a pure abstract virtual member function, which will require all its descendants to reimplement it, otherwise no instances are allowed to be created. Since I'm looking to implement this patch step-by-step (or a Filter at time), the path of less friction was to provide a default empty implementation of this method. This would allow to simply remove the aforementioned member function from FEGaussianBlur, while allowing instances of it to be created while requiring *no changes* on the other FE*Filters. When the last filter class is completed, then we can rename applySkia() to applySoftware().
https://codereview.chromium.org/215303003/diff/1/Source/platform/graphics/fil... File Source/platform/graphics/filters/FilterEffect.h (right): https://codereview.chromium.org/215303003/diff/1/Source/platform/graphics/fil... Source/platform/graphics/filters/FilterEffect.h:203: virtual void applySoftware() { }; On 2014/03/27 23:16:31, Savago wrote: > applySoftware() is a pure abstract virtual member function, which will require > all its descendants to reimplement it, otherwise no instances are allowed to be > created. > > Since I'm looking to implement this patch step-by-step (or a Filter at time), > the path of less friction was to provide a default empty implementation of this > method. > > This would allow to simply remove the aforementioned member function from > FEGaussianBlur, while allowing instances of it to be created while requiring *no > changes* on the other FE*Filters. It's a good goal, but you can do this without requiring changes to FilterEffect either. Just rename FEGaussianBlur::applySkia() to FEGaussianBlur::applySoftware() as I suggested (and remove the return value). Then the pure virtual of FilterEffect::applySoftware() is overridden. This should only require changes to FEGaussianBlur.*. > When the last filter class is completed, then we can rename applySkia() to > applySoftware().
Stephen Thanks for commenting, I appreciate the feedback. There is the issue that Filter.cpp calls both applySoftware() and applySkia(). Making no changes on both its .h and .cpp would require the filter classes to have both methods. I'm assuming that changing the call site in the .cpp is the way that you prefer? If we purge the calls to applySkia() and just call applySoftware() to allow to execute the renamed method in FEGaussianBlur as you suggested, that means that only FEGaussianBlur would execute the skia path (while the other classes that are unpatched) would execute the software path. That would be a change on the behavior... and probably not what we want. To continue executing the skia path, it would require to patch the other classes (i.e. rename applySkia() to applySoftware() in all of them).
On 2014/03/27 23:43:53, Savago wrote: > Stephen > > Thanks for commenting, I appreciate the feedback. > > There is the issue that Filter.cpp calls both applySoftware() and applySkia(). > Making no changes on both its .h and .cpp would require the filter classes to > have both methods. Look again. The code in FilterEffect::applyRecursive() looks like this: if (applySkia()) return; applySoftware(); and the base class implementation of applySkia() returns false. So it's perfectly fine to have applySoftware() without an applySkia() (a number of the filters currently do). We'd just be changing FEGaussianBlur to do that. > I'm assuming that changing the call site in the .cpp is the way that you prefer? > > If we purge the calls to applySkia() and just call applySoftware() to allow to > execute the renamed method in FEGaussianBlur as you suggested, that means that > only FEGaussianBlur would execute the skia path (while the other classes that > are unpatched) would execute the software path. They'll continue to do what they did before: applySkia() if they have it, applySoftware() if they don't. > That would be a change on the behavior... and probably not what we want. To > continue executing the skia path, it would require to patch the other classes > (i.e. rename applySkia() to applySoftware() in all of them).
I stand corrected, didn't noticed that the default in applySkia() was to return a false. :-)
The last patch I've uploaded yesterday should address the reviewer's comments.
LGTM. Thanks for the extra effort. (BTW, reviewers are not notified when a new patch is uploaded; you have to "publish & mail comments" again.)
https://codereview.chromium.org/215303003/diff/60001/Source/platform/graphics... File Source/platform/graphics/filters/FEGaussianBlur.h (left): https://codereview.chromium.org/215303003/diff/60001/Source/platform/graphics... Source/platform/graphics/filters/FEGaussianBlur.h:81: inline void FEGaussianBlur::kernelPosition(int boxBlur, unsigned& std, int& dLeft, int& dRight) BTW, it looks like this function could go as well.
Stephen Thanks for the review. I will upload a new patch with the suggestions.
By the way, since the plan is to do a filter at time, it may make sense to open a bug report in chromium to help keep track of the work. I will update the patch to reference the new bug.
Bug report created, issue CL updated, new patch uploaded.
Still LGTM. :)
The CQ bit was checked by a.cavalcanti@samsung.com
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/a.cavalcanti@samsung.com/215303003/70001
The CQ bit was unchecked by commit-bot@chromium.org
Internal error: failed to checkout. Please try again.
On 2014/03/28 19:00:58, I haz the power (commit-bot) wrote: > Internal error: failed to checkout. Please try again. Let me give it a try.
The CQ bit was checked by senorblanco@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/a.cavalcanti@samsung.com/215303003/70001
Message was sent while issue was closed.
Change committed as 170356 |