aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/effects/SkMorphologyImageFilter.h
Commit message (Collapse)AuthorAge
* rebaseGravatar Cary Clark2018-06-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 32a4910e57b1fdd3c8671de1ee85e05ca21d079f. Reason for revert: SkMatrix::toString use has been removed from flutter and has been picked up in fuchsia Additionally some bookmaker changes take into account recent additions of typedef comments and the generated header comment. Original change's description: > Revert "remove toString" > > This reverts commit 5191880cbf3ee4d122b0d11b4945fbab0784fda7. > > Reason for revert: broke flutter > > Original change's description: > > remove toString > > > > toString may have been used by obsolete debugger only > > find out if that is so > > > > R=​brianosman@google.com,bsalomon@google.com > > > > Docs-Preview: https://skia.org/?cl=119894 > > Bug:830651 > > Change-Id: I737f19b7d3fbc869bea2f443fa3b5ed7c1393ffd > > Reviewed-on: https://skia-review.googlesource.com/119894 > > Commit-Queue: Cary Clark <caryclark@google.com> > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org > > Change-Id: I9f81de6c3615ee0608bcea9081b77239b4b8816c TBR=bsalomon@google.com,brianosman@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Reviewed-on: https://skia-review.googlesource.com/129623 Reviewed-by: Cary Clark <caryclark@skia.org> Commit-Queue: Cary Clark <caryclark@google.com> Docs-Preview: https://skia.org/?cl=133583 Bug: 830651 Change-Id: If8499e796be63580ad419e150e94d43e8b89de1b Reviewed-on: https://skia-review.googlesource.com/133583 Commit-Queue: Cary Clark <caryclark@skia.org> Auto-Submit: Cary Clark <caryclark@skia.org>
* Revert "Reland "remove toString""Gravatar Cary Clark2018-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 92e37b6d79f12ccfaaf7671413316952d182267d. Reason for revert: toString still used by flutter Original change's description: > Reland "remove toString" > > This reverts commit 32a4910e57b1fdd3c8671de1ee85e05ca21d079f. > > Reason for revert: SkMatrix::toString use has been removed from flutter and has been picked up in fuchsia > > Original change's description: > > Revert "remove toString" > > > > This reverts commit 5191880cbf3ee4d122b0d11b4945fbab0784fda7. > > > > Reason for revert: broke flutter > > > > Original change's description: > > > remove toString > > > > > > toString may have been used by obsolete debugger only > > > find out if that is so > > > > > > R=​brianosman@google.com,bsalomon@google.com > > > > > > Docs-Preview: https://skia.org/?cl=119894 > > > Bug:830651 > > > Change-Id: I737f19b7d3fbc869bea2f443fa3b5ed7c1393ffd > > > Reviewed-on: https://skia-review.googlesource.com/119894 > > > Commit-Queue: Cary Clark <caryclark@google.com> > > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > > > TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org > > > > Change-Id: I9f81de6c3615ee0608bcea9081b77239b4b8816c > > No-Presubmit: true > > No-Tree-Checks: true > > No-Try: true > > Bug: 830651 > > Reviewed-on: https://skia-review.googlesource.com/129340 > > Reviewed-by: Cary Clark <caryclark@google.com> > > Commit-Queue: Cary Clark <caryclark@google.com> > > TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org > > # Not skipping CQ checks because original CL landed > 1 day ago. > > Bug: 830651 > Change-Id: Ida8725b6051132d8c46faf99358a8fcc1bcabf34 > Reviewed-on: https://skia-review.googlesource.com/129623 > Reviewed-by: Cary Clark <caryclark@skia.org> > Reviewed-by: Cary Clark <caryclark@google.com> > Commit-Queue: Cary Clark <caryclark@google.com> TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org Change-Id: Iafc59ffc1b3db67c520ba31bf12d68e1b46c0ea2 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 830651 Reviewed-on: https://skia-review.googlesource.com/131082 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
* Reland "remove toString"Gravatar Cary Clark2018-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 32a4910e57b1fdd3c8671de1ee85e05ca21d079f. Reason for revert: SkMatrix::toString use has been removed from flutter and has been picked up in fuchsia Original change's description: > Revert "remove toString" > > This reverts commit 5191880cbf3ee4d122b0d11b4945fbab0784fda7. > > Reason for revert: broke flutter > > Original change's description: > > remove toString > > > > toString may have been used by obsolete debugger only > > find out if that is so > > > > R=​brianosman@google.com,bsalomon@google.com > > > > Docs-Preview: https://skia.org/?cl=119894 > > Bug:830651 > > Change-Id: I737f19b7d3fbc869bea2f443fa3b5ed7c1393ffd > > Reviewed-on: https://skia-review.googlesource.com/119894 > > Commit-Queue: Cary Clark <caryclark@google.com> > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org > > Change-Id: I9f81de6c3615ee0608bcea9081b77239b4b8816c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: 830651 > Reviewed-on: https://skia-review.googlesource.com/129340 > Reviewed-by: Cary Clark <caryclark@google.com> > Commit-Queue: Cary Clark <caryclark@google.com> TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: 830651 Change-Id: Ida8725b6051132d8c46faf99358a8fcc1bcabf34 Reviewed-on: https://skia-review.googlesource.com/129623 Reviewed-by: Cary Clark <caryclark@skia.org> Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
* remove defines and add commasGravatar Cary Clark2018-05-21
| | | | | | | | | | | | | | | | | | | | | | | | Preparation for generating bookmaker files for all remaining interfaces Standardize enum and enum classes by including a comma after the last entry. Replace flatten-related #define in public interfaces with their equivalent. The motivation is to give documentation something to refer to. An alternative would be to move part or all of this out of the public interface; something I can work on in a follow-up CL. R=reed@google.com,bsalomon@google.com Bug: skia:6898 Change-Id: I4b865f6ec3d8f5d31e50448fef7d2714510302f0 Reviewed-on: https://skia-review.googlesource.com/129312 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Cary Clark <caryclark@skia.org>
* Revert "remove toString"Gravatar Cary Clark2018-05-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 5191880cbf3ee4d122b0d11b4945fbab0784fda7. Reason for revert: broke flutter Original change's description: > remove toString > > toString may have been used by obsolete debugger only > find out if that is so > > R=​brianosman@google.com,bsalomon@google.com > > Docs-Preview: https://skia.org/?cl=119894 > Bug:830651 > Change-Id: I737f19b7d3fbc869bea2f443fa3b5ed7c1393ffd > Reviewed-on: https://skia-review.googlesource.com/119894 > Commit-Queue: Cary Clark <caryclark@google.com> > Reviewed-by: Brian Salomon <bsalomon@google.com> TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org Change-Id: I9f81de6c3615ee0608bcea9081b77239b4b8816c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 830651 Reviewed-on: https://skia-review.googlesource.com/129340 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
* remove toStringGravatar Cary Clark2018-05-20
| | | | | | | | | | | | | | toString may have been used by obsolete debugger only find out if that is so R=brianosman@google.com,bsalomon@google.com Docs-Preview: https://skia.org/?cl=119894 Bug:830651 Change-Id: I737f19b7d3fbc869bea2f443fa3b5ed7c1393ffd Reviewed-on: https://skia-review.googlesource.com/119894 Commit-Queue: Cary Clark <caryclark@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Fix srcBounds computation in SkMatrixConvolutionImageFilterGravatar Robert Phillips2018-05-17
| | | | | | | | | | | Note that this does change the behavior of the cropRect for the repeated case. The cropRect now only acts as a hard clip on the output. BUG= skia:7766 Change-Id: I1d66678bc797cd4835701cd20c36e68b22ac880a Reviewed-on: https://skia-review.googlesource.com/127338 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* remove SK_IGNORE_TO_STRINGGravatar Cary Clark2018-04-05
| | | | | | | | | | | | | | | | | | | SK_IGNORE_TO_STRING is not defined anywhere. The same effect can be had by using a modern linker. Removing it simplifies bookmaker and makes our includes easier to understand. R=robertphillips@google.com TBR=reed@google.com Bug: skia:6898 Change-Id: Ib716f5ef1b42a7fbda0df43ece212d1b7c40289f Reviewed-on: https://skia-review.googlesource.com/118963 Reviewed-by: Robert Phillips <robertphillips@google.com> Reviewed-by: Cary Clark <caryclark@skia.org> Commit-Queue: Cary Clark <caryclark@skia.org>
* SkImageFilter::onMakeColorSpace() - more overridesGravatar Matt Sarett2017-04-10
| | | | | | | | | | | Fills out most of the simple implementations. Improves 22 gms in gbr-8888. Bug: skia: Change-Id: I881ade140993568263de75be51aed240d2de8cc6 Reviewed-on: https://skia-review.googlesource.com/13126 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* remove 4 legacy flags (clients already updated)Gravatar Mike Reed2016-10-20
| | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3785 Change-Id: I187e50e09ed7a3316719fae51af770259928fdf9 Reviewed-on: https://skia-review.googlesource.com/3785 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* Outline SkImageFilter Make methodsGravatar robertphillips2016-04-17
| | | | | | | | | | Mainly mechanical CL. TBR=reed@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1893973002 Review URL: https://codereview.chromium.org/1893973002
* Update SkMorphology ImageFilters to sk_spGravatar robertphillips2016-04-05
| | | | | | | | TBR=reed@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1860573002 Review URL: https://codereview.chromium.org/1860573002
* Update Morphology image filter to store its typeGravatar robertphillips2016-03-30
| | | | | | | | TBR=bsalomon@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1834953002 Review URL: https://codereview.chromium.org/1834953002
* Switch SkMorphologyImageFilter over to new onFilterImage interfaceGravatar robertphillips2016-03-25
| | | | | | | | | | This now relies on: https://codereview.chromium.org/1826233002/ (Add rowBytesAsPixels and shiftPerPixel to SkPixmap) TBR=bsalomon@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1819393002 Review URL: https://codereview.chromium.org/1819393002
* Change signatures of filter bounds methods to return a rect.Gravatar senorblanco2016-03-21
| | | | | | | | | | | Change filterBounds(), onFilterBounds() and onFilterNodeBounds() and computeFastBounds() to return the destination rectangle. There was no code path that could return false, and returning rects by value is ok now. BUG=skia:5094 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1823573003 Review URL: https://codereview.chromium.org/1823573003
* Mark existing image filter entry points that will be going away with DeprecatedGravatar robertphillips2016-02-17
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1709753002 Review URL: https://codereview.chromium.org/1709753002
* Fix filter primitive bounds computations.Gravatar senorblanco2015-12-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make each filter responsible for expanding its destination bounds. Previously, we were using a union of all intermediate bounds sizes via join() calls in many image filters' computeFastBounds(), due to the fact that those filters could only produce bitmaps the same size as their inputs. Now, we compute optimal bounds for each filter as follows: 1) Pass the (unmodified) clip bounds to the root node of the DAG in the first recursive call to onFilterImage() as the Context's fClipBounds. 2) Reverse-map the clip: when recursing up the DAG in filterInput[GPU](), apply filter-specific expansion to the clip by calling calling onFilterNodeBounds(... kReverse). This allows upstream nodes to have a clip that respects the current node's requirements. This is done via helper function mapContext(). 3) Forward-map the source bitmap: just prior to applying the crop rect in applyCropRect(), we determine the filter's preferred bounds by mapping the source bitmap bounds forwards via onFilterNodeBounds(..., kForward). NOTE: GMs affected by this change: fast_slow_blurimagefilter: fast and slow paths now produce the same result spritebitmap: drawSprite() and drawBitmap() paths now produce the same result filterfastbounds: fast bounds are optimized; all drop-shadow results now appear apply-filter: snug and not-snug cases give same results dropshadowimagefilter: drawSprite() results now show shadows draw-with-filter: no artifacts on erode edges; blur edges no longer clipped displacement, imagefiltersbase, imagefiltersclipped, imagefilterscropexpand, imagefiltersscaled, matriximagefilter, resizeimagefilter, localmatriximagefilter, testimagefilters: fixed incorrect clipping imagefilterstransformed, morphology: no artifacts on erode edges BUG=skia:1062,skia:3194,skia:3939,skia:4337,skia:4526 Review URL: https://codereview.chromium.org/1308703007
* Revert "Revert of factories should return baseclass, allowing the impl to ↵Gravatar reed2015-10-06
| | | | | | | | | | | specialize (patchset #4 id:60001 of https://codereview.chromium.org/1390523005/ )" This reverts commit 95376a0dde3cdf414eb97a20cef3af19ed7e0151. BUG=skia: TBR= Review URL: https://codereview.chromium.org/1389083002
* Revert of factories should return baseclass, allowing the impl to specialize ↵Gravatar schenney2015-10-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (patchset #4 id:60001 of https://codereview.chromium.org/1390523005/ ) Reason for revert: Breaks Chrome with this link error: ../../third_party/skia/include/effects/SkMorphologyImageFilter.h:75: error: undefined reference to 'SkMorphologyImageFilter::SkMorphologyImageFilter(int, int, SkImageFilter*, SkImageFilter::CropRect const*)' ../../third_party/skia/include/effects/SkMorphologyImageFilter.h:104: error: undefined reference to 'SkMorphologyImageFilter::SkMorphologyImageFilter(int, int, SkImageFilter*, SkImageFilter::CropRect const*)' Presumably due to code in third_party/WebKit/Source/platform/graphics/filters/FEMorphology.cpp that contains: #include "SkMorphologyImageFilter.h" ... if (m_type == FEMORPHOLOGY_OPERATOR_DILATE) return adoptRef(SkDilateImageFilter::Create(radiusX, radiusY, input.get(), &rect)); return adoptRef(SkErodeImageFilter::Create(radiusX, radiusY, input.get(), &rect)); Original issue's description: > factories should return baseclass, allowing the impl to specialize > > waiting on https://codereview.chromium.org/1386163002/# to land > > BUG=skia:4424 > > Committed: https://skia.googlesource.com/skia/+/80a6dcaa1b757826ed7414f64b035d512d9ccbf8 TBR=senorblanco@google.com,robertphillips@google.com,reed@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:4424 Review URL: https://codereview.chromium.org/1389063002
* factories should return baseclass, allowing the impl to specializeGravatar reed2015-10-06
| | | | | | | | waiting on https://codereview.chromium.org/1386163002/# to land BUG=skia:4424 Review URL: https://codereview.chromium.org/1390523005
* Style Change: SkNEW->new; SkDELETE->deleteGravatar halcanary2015-08-26
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316123003 Review URL: https://codereview.chromium.org/1316123003
* style nit cleanups. e.g. remove 'virtual' on override declarationsGravatar robertphillips2015-07-07
| | | | Review URL: https://codereview.chromium.org/1216433005
* C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla}Gravatar mtklein2015-03-25
| | | | | | | | | NOPRESUBMIT=true BUG=skia: DOCS_PREVIEW= https://skia.org/?cl=1037793002 Review URL: https://codereview.chromium.org/1037793002
* Remove uniqueID from all filter serialization.Gravatar senorblanco2015-03-18
| | | | | | | | | | | | (This is essentially a revert of https://codereview.chromium.org/503833002/.) This was necessary back when SkPaint was flattened even for in-process use. Now that we only flatten SkPaint for cross-process use, there's no need to serialize UniqueIDs. Note: SkDropShadowImageFilter is being constructed with a croprect and UniqueID (of 0) in Blink. I've made the uniqueID param default to 0 temporarily, until this rolls in and Blink can be changed. (Blink can't be changed first, since unlike the other filters, there's no constructor that takes a cropRect but not a uniqueID.) BUG=skia: Review URL: https://codereview.chromium.org/1019493002
* Fix up all the easy virtual ... SK_OVERRIDE cases.Gravatar mtklein2015-01-09
| | | | | | | | | | | | This fixes every case where virtual and SK_OVERRIDE were on the same line, which should be the bulk of cases. We'll have to manually clean up the rest over time unless I level up in regexes. for f in (find . -type f); perl -p -i -e 's/virtual (.*)SK_OVERRIDE/\1SK_OVERRIDE/g' $f; end BUG=skia: Review URL: https://codereview.chromium.org/806653007
* Add toString methods to SkImageFilter-derived classesGravatar robertphillips2014-12-19
| | | | | | This isn't definitive but at least makes something show up in the debugger. Review URL: https://codereview.chromium.org/789163006
* Remove SK_SUPPORT_LEGACY_DEEPFLATTENING.Gravatar mtklein2014-12-01
| | | | | | | | | | | | This was needed for pictures before v33, and we're now requiring v35+. Will follow up with the same for skia/ext/pixel_ref_utils_unittest.cc BUG=skia: Committed: https://skia.googlesource.com/skia/+/52c293547b973f7fb5de3c83f5062b07d759ab88 Review URL: https://codereview.chromium.org/769953002
* Revert of Remove SK_SUPPORT_LEGACY_DEEPFLATTENING. (patchset #1 id:1 of ↵Gravatar mtklein2014-12-01
| | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/769953002/) Reason for revert: Breaks canary builds. Will reland after the Chromium change lands. Original issue's description: > Remove SK_SUPPORT_LEGACY_DEEPFLATTENING. > > This was needed for pictures before v33, and we're now requiring v35+. > > Will follow up with the same for skia/ext/pixel_ref_utils_unittest.cc > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/52c293547b973f7fb5de3c83f5062b07d759ab88 TBR=reed@google.com,mtklein@chromium.org NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/768183002
* Remove SK_SUPPORT_LEGACY_DEEPFLATTENING.Gravatar mtklein2014-12-01
| | | | | | | | | | This was needed for pictures before v33, and we're now requiring v35+. Will follow up with the same for skia/ext/pixel_ref_utils_unittest.cc BUG=skia: Review URL: https://codereview.chromium.org/769953002
* Reimplement deserialization of SkImageFilter's uniqueID.Gravatar senorblanco2014-08-26
| | | | | | | | | | | | | | | | | | | | | | | 9fa60d ("Simplify flattening to just write enough ... ") simplified just a tad too much. In particular, it disabled deserialization of SkImageFilter's uniqueID, which in turn caused the failure of SkImageFilter's cache, which caused a large regression in Chrome's SVG filter performance. The medium-term fix is to switch to the new SkRecordDraw SkPicture backend, which will make the unique IDs unnecessary. This change is an "in case of emergecy" CL, in the event that there are problems switching on the new backend in Chrome. For that reason, it's minimalist: only the filters used by Chrome are modified, and whitespace changes are kept to a minimum. In this way, it should be easy to revert once the new backend goes in. R=reed@google.com Author: senorblanco@chromium.org Review URL: https://codereview.chromium.org/503833002
* Simplify flattening to just write enough to call the ↵Gravatar reed2014-08-21
| | | | | | | | | | | | | | | | | | factory/public-constructor for the class. We want to *not* rely on private constructors, and not rely on calling through the inheritance hierarchy for either flattening or unflattening(CreateProc). Refactoring pattern: 1. guard the existing constructor(readbuffer) with the legacy build-flag 2. If you are a instancable subclass, implement CreateProc(readbuffer) to create a new instances from the buffer params (or return NULL). If you're a shader subclass 1. You must read/write the local matrix if your class accepts that in its factory/constructor, else ignore it. R=robertphillips@google.com, mtklein@google.com, senorblanco@google.com, senorblanco@chromium.org, sugoi@chromium.org Author: reed@google.com Review URL: https://codereview.chromium.org/395603002
* Clean up SkImageFilter constructors.Gravatar senorblanco2014-07-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | Now that all creation of SkImageFilters goes through factory Create() methods, there's no real reason for the convenience constructors. Some SkImageFilter subclasses which actually have zero DAG-able inputs were passing NULL to the superclass constructor. This actually means 1 input, with a NULL value, not zero inputs. This becomes more relevant for the upcoming cache infrastructure, where this indicates that the filter will use its src input, where in fact some of these filters do not (they are image generators only). Limiting SkImageFilter to a single constructor resolves this ambiguity. Along the way, I removed all of the default parameters to the constructors, since the Create methods always call them with the full argument list. BUG=skia: R=reed@google.com Author: senorblanco@chromium.org Review URL: https://codereview.chromium.org/376953003
* Remove SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS flag.Gravatar commit-bot@chromium.org2014-05-15
| | | | | | | | | | | | | | Neither Chrome nor Android uses this flag anymore. Make sure all constructors touched that only have one parameter are marked as 'explicit'. BUG=2187 R=scroggo@google.com, reed@google.com Author: dominikg@chromium.org Review URL: https://codereview.chromium.org/282203004 git-svn-id: http://skia.googlecode.com/svn/trunk@14749 2bbb7eff-a529-9590-31e7-b0007b416f81
* Implement support for a Context parameter in image filtersGravatar senorblanco@chromium.org2014-03-14
| | | | | | | | | | | | | | | Some upcoming work (support for expanding crop rects) requires the clip bounds to be available during filter traversal. This change replaces the SkMatrix parameter in the onFilterImage() traversals with a Context parameter. It contains the CTM, as well as the clip bounds. BUG=skia: R=reed@google.com Review URL: https://codereview.chromium.org/189913021 git-svn-id: http://skia.googlecode.com/svn/trunk@13803 2bbb7eff-a529-9590-31e7-b0007b416f81
* Factory methods for heap-allocated SkImageFilter objects.Gravatar commit-bot@chromium.org2014-03-10
| | | | | | | | | | | | | | | | | | This is part of an effort to ensure that all SkPaint effects can only be allocated on the heap. This patch makes the constructors of SkImageFilter and its subclasses non-public and instead provides factory methods for creating these objects on the heap. We temporarily keep constructor of publicly visible classes public behind a flag. BUG=skia:2187 R=scroggo@google.com, mtklein@chromium.org, reed@google.com, senorblanco@google.com, senorblanco@chromium.org, bsalomon@google.com, sugoi@chromium.org, zork@chromium.org Author: dominikg@chromium.org Review URL: https://codereview.chromium.org/182983003 git-svn-id: http://skia.googlecode.com/svn/trunk@13718 2bbb7eff-a529-9590-31e7-b0007b416f81
* Make SkImageFilter methods const.Gravatar commit-bot@chromium.org2014-02-05
| | | | | | | | | | | | | | SkImageFilter had some non-const methods that could all be made const. This is a first step towards making SkImageFilter immutable. BUG=skia:2097 R=mtklein@google.com, reed@google.com, robertphillips@google.com Author: dominikg@chromium.org Review URL: https://codereview.chromium.org/148883011 git-svn-id: http://skia.googlecode.com/svn/trunk@13330 2bbb7eff-a529-9590-31e7-b0007b416f81
* Implement correct clipping for image filters.Gravatar senorblanco@chromium.org2014-02-05
| | | | | | | | | | | | | | | | | | | | | | | | | | Image filters in Skia currently clip the size of the the offscreen bitmap used for filtering to the device clip bounds. This means that any pixel-moving filter (e.g., blur) has edge artifacts at the clip boundaries. This is problematic for tiling, where a single SkPicture is played back with a clip set to the tile boundaries. By implementing the onFilterBounds() traversal, and using it in saveLayer() when a filter is present, we can clip the layer to the expanded clip rect. Note that this requires that the traversal be performed in reverse as compared to computeFastBounds(). (It's also done in device space, unlike computeFastBounds()). New test imagefiltersclipped tests pixel-moving filters when clipped by various clip rects. New test imageblurtiled tests tiled (compositor-style) rendering of blurred text. There should be no artifacts at the tile boundaries. BUG=337831 R=reed@google.com Review URL: https://codereview.chromium.org/23011012 git-svn-id: http://skia.googlecode.com/svn/trunk@13323 2bbb7eff-a529-9590-31e7-b0007b416f81
* Refactor read and write buffers.Gravatar commit-bot@chromium.org2014-01-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Eliminates SkFlattenable{Read,Write}Buffer, promoting SkOrdered{Read,Write}Buffer a step each in the hierarchy. What used to be this: SkFlattenableWriteBuffer -> SkOrderedWriteBuffer SkFlattenableReadBuffer -> SkOrderedReadBuffer SkFlattenableReadBuffer -> SkValidatingReadBuffer is now SkWriteBuffer SkReadBuffer -> SkValidatingReadBuffer Benefits: - code is simpler, names are less wordy - the generic SkFlattenableFooBuffer code in SkPaint was incorrect; removed - write buffers are completely devirtualized, important for record speed This refactoring was mostly mechanical. You aren't going to find anything interesting in files with less than 10 lines changed. BUG=skia: R=reed@google.com, scroggo@google.com, djsollen@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/134163010 git-svn-id: http://skia.googlecode.com/svn/trunk@13245 2bbb7eff-a529-9590-31e7-b0007b416f81
* Implement a computeFastBounds() traversal for SkImageFilter.Gravatar senorblanco@chromium.org2014-01-27
| | | | | | | | | | | This allows for correct culling of primitives which have image filters applied. R=reed@google.com BUG=skia: Review URL: https://codereview.chromium.org/137423005 git-svn-id: http://skia.googlecode.com/svn/trunk@13207 2bbb7eff-a529-9590-31e7-b0007b416f81
* [Reland of r13154, since the Housekeeping bot seems to have reverted it in ↵Gravatar senorblanco@chromium.org2014-01-24
| | | | | | | | | | | | | | | | | | r13155. Next time I'll put the "do not disturb" sign on my commit.] Refactor SkMorphologyImageFilter, CPU and GPU paths. This required making opts/ dependent on effects/, so that we could use the SkMorphologyProc type in SkMorphologyImageFilter.h. Correctness and performance covered by existing tests; no change in functionality. R=bsalomon@google.com, djsollen@google.com, reed@google.com Committed: https://code.google.com/p/skia/source/detail?r=13154 BUG=skia: Review URL: https://codereview.chromium.org/135013004 git-svn-id: http://skia.googlecode.com/svn/trunk@13168 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Housekeeper-NightlyGravatar skia.committer@gmail.com2014-01-23
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@13155 2bbb7eff-a529-9590-31e7-b0007b416f81
* Refactor SkMorphologyImageFilter, CPU and GPU paths. This required making ↵Gravatar senorblanco@chromium.org2014-01-23
| | | | | | | | | | | | opts/ dependent on effects/, so that we could use the SkMorphologyProc type in SkMorphologyImageFilter.h. Correctness and performance covered by existing tests; no change in functionality. R=bsalomon@google.com, djsollen@google.com, reed@google.com Review URL: https://codereview.chromium.org/135013004 git-svn-id: http://skia.googlecode.com/svn/trunk@13154 2bbb7eff-a529-9590-31e7-b0007b416f81
* Change SkImageFilter's cropRect from SkIRect to a CropRect struct, ↵Gravatar senorblanco@chromium.org2013-10-10
| | | | | | | | | | | | | | containing an SkRect and flags indicating which parameters are set. NOTE: this will require SK_CROP_RECT_IS_INT=1 to be set in Chrome until Blink has been updated to use SkImageFilter::CropRect. Include https://codereview.chromium.org/26528002/ with the Skia roll. Note also that SK_CROP_RECT_IS_INT is a temporary measure until all call sites in Blink have been updated to use SkRect. R=reed@google.com Review URL: https://codereview.chromium.org/26371002 git-svn-id: http://skia.googlecode.com/svn/trunk@11692 2bbb7eff-a529-9590-31e7-b0007b416f81
* Implement crop rect for the dilate and erode (morphology) filters. This ↵Gravatar senorblanco@chromium.org2013-09-17
| | | | | | | | | | | | provoked some cleanup on the GPU side: apply_morphology() now deals with SkBitmaps, rather than GrTextures. There's still a clear opportunity for more refactoring between the two filters. Note: this adds some test cases to the morphology GM, so it will require a rebaseline. R=bsalomon@google.com, reed@google.com Review URL: https://codereview.chromium.org/23892011 git-svn-id: http://skia.googlecode.com/svn/trunk@11313 2bbb7eff-a529-9590-31e7-b0007b416f81
* Added ctm matrix to GPU pathGravatar commit-bot@chromium.org2013-08-05
| | | | | | | | | | | | | There should be no changes in behavior caused by this cl, it just adds the ctm matrix to filterImageGPU so that it may be used for scaling on all platforms when it is implemented on the blink side. BUG= R=senorblanco@google.com, senorblanco@chromium.org Author: sugoi@chromium.org Review URL: https://chromiumcodereview.appspot.com/22209002 git-svn-id: http://skia.googlecode.com/svn/trunk@10536 2bbb7eff-a529-9590-31e7-b0007b416f81
* Implement offset for GPU filter path. Although we can't yet use this in ↵Gravatar commit-bot@chromium.org2013-07-10
| | | | | | | | | | | | | | | | Blink for FEOffset, due to SVG semantics, we can use it to support crop rect (upcoming patch). This patch adds the parameter to the filterImageGPU() signature, plumbs through the code on the GPU side, and implements support for it in SkXfermodeImageFilter for both raster and GPU. Of the remaining filters with GPU implementations, Blur, Morphology, Bicubic and Displacement work fine; they're commutative wrt offset and can simply pass it up the chain. Blend is not, but will be removed shortly anyway (has been replaced with SkXfermodeImageFilter in Blink). R=reed@google.com, bsalomon@google.com Author: senorblanco@chromium.org Review URL: https://chromiumcodereview.appspot.com/15995026 git-svn-id: http://skia.googlecode.com/svn/trunk@9977 2bbb7eff-a529-9590-31e7-b0007b416f81
* Nuke SkSingleInputImageFilter. 99% of its functionality was refactored into ↵Gravatar senorblanco@chromium.org2013-02-04
| | | | | | | | SkImageFilterUtils in https://code.google.com/p/skia/source/detail?r=7467, so it has outlived its usefulness. Review URL: https://codereview.appspot.com/7277055 git-svn-id: http://skia.googlecode.com/svn/trunk@7563 2bbb7eff-a529-9590-31e7-b0007b416f81
* This changes the signature of SkImageFilter::filterImageGPU() to use ↵Gravatar senorblanco@chromium.org2013-01-30
| | | | | | | | | | SkBitmaps for input and output, and removes the rect param. This allows us to return textures which are larger than the actual result, such as when GrAutoScratchTextures are used. The SkBitmap's size represents the active region, while the GrTexture's size is the full texture size. This fixes the bicubic image filter GM on the GPU, which otherwise draws garbage outside the filtered region. It also moves us closer to unifying the signatures of SkImageFilter::onFilterImage() and SkImageFilter::filterImageGPU(). Review URL: https://codereview.appspot.com/7180048 git-svn-id: http://skia.googlecode.com/svn/trunk@7467 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2013-01-26
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@7406 2bbb7eff-a529-9590-31e7-b0007b416f81
* Rename onFilterImageGPU to filterImageGPU(), to match skia convention. No ↵Gravatar senorblanco@chromium.org2013-01-10
| | | | | | | | | | change in functionality. (Note that this does mean that clients must override onFilterImage() to implement the raster path, but filterImageGPU() to implement the GPU path.) Review URL: https://codereview.appspot.com/7058078 git-svn-id: http://skia.googlecode.com/svn/trunk@7123 2bbb7eff-a529-9590-31e7-b0007b416f81