aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkBlurMask.cpp
Commit message (Collapse)AuthorAge
* Revert "Revert "SkTypes: extract SkTo""Gravatar Hal Canary2018-06-14
| | | | | | | | | | | | | | | | This reverts commit fdcfb8b7c23fbf18f872d2c31d27978235033876. > Original change's description: > > SkTypes: extract SkTo > > > > Change-Id: I8de790d5013db2105ad885fa2683303d7c250b09 > > Reviewed-on: https://skia-review.googlesource.com/133620 > > Reviewed-by: Mike Klein <mtklein@google.com> Change-Id: Ida74fbc5c21248a724a5edbf9fae18a33bcb23aa Reviewed-on: https://skia-review.googlesource.com/134506 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* Revert "SkTypes: extract SkTo"Gravatar Hal Canary2018-06-13
| | | | | | | | | | | | | | | | | | | | | | | This reverts commit 2a2f67592602b18527bc3fd449132d420cd5b62e. Reason for revert: this appears to be what is holding up the Chrome roll. Original change's description: > SkTypes: extract SkTo > > Change-Id: I8de790d5013db2105ad885fa2683303d7c250b09 > Reviewed-on: https://skia-review.googlesource.com/133620 > Reviewed-by: Mike Klein <mtklein@google.com> TBR=mtklein@google.com,halcanary@google.com No-Presubmit: true No-Tree-Checks: true No-Try: true Change-Id: Iafd738aedfb679a23c061a51afe4b98a8d4cdfae Reviewed-on: https://skia-review.googlesource.com/134504 Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* SkTypes: extract SkToGravatar Hal Canary2018-06-12
| | | | | | Change-Id: I8de790d5013db2105ad885fa2683303d7c250b09 Reviewed-on: https://skia-review.googlesource.com/133620 Reviewed-by: Mike Klein <mtklein@google.com>
* Set margin for outer blur masks with no blur.Gravatar Ben Wagner2018-05-17
| | | | | | | | | | | | | | | | | | | | | | | | The margin of a mask filter is intended to be the additional src region which the mask filter will take into account when creating the dst (a region which will be assumed to be fully transparent around the src). In the event there is an outer blur with no effective blur the src does not need to be considered at all since the outcome will always be an empty mask. The 'margin' is then effectively -inf in all directions, but currently users of margin expect the value to come back non-negative. This sets the margin in this case to 0 to allow the users to do their work and then the filter will simply discard that work. Currently the margin is not being set at all, leading to undefined behavior. In the future the users of mask filters need to be able to handle negative margins and there needs to be a way for the mask filter to signal that it will disregard any src image. BUG=oss-fuzz:8332 Change-Id: Ia9d1711b8c68142134bb6d393de17b9abaf7b23a Reviewed-on: https://skia-review.googlesource.com/128683 Reviewed-by: Kevin Lubick <kjlubick@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* Correctly handle empty outer blurs.Gravatar Ben Wagner2018-05-14
| | | | | | | | | | | Most blur styles approach the original mask as the sigma goes to zero. The outer style however approaches nothing as the mask sigma goes to zero. Handle this case correctly. Change-Id: I14f76e144d7cfc78aeaff30ff5444a21f1e5f98b Reviewed-on: https://skia-review.googlesource.com/128006 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Kevin Lubick <kjlubick@google.com>
* Avoid possible memory leak with inner blurs.Gravatar Ben Wagner2018-05-11
| | | | | | | | | | | | | | | If the inner blur dst is too big, SkBlurMask::BoxBlur can return without freeing the intermediate blur mask. Fix this by using SkAutoMaskFreeImage. Use SkAutoMaskFreeImage instead of custom SkAutoTCallVProc in SkBlurMask::BlurGroundTruth. Make SkAutoMaskFreeImage a special kind of std::unique_ptr. Change-Id: I93dc54265416ca69254633b00f14be75009d990f Reviewed-on: https://skia-review.googlesource.com/127402 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Ben Wagner <bungeman@google.com>
* Non-normal blur styles to work with non-a8.Gravatar Ben Wagner2018-05-10
| | | | | | | | | BUG=skia:7941 Change-Id: I500561c2fec1bcab324fd9519f1d20d356afdfb5 Reviewed-on: https://skia-review.googlesource.com/127500 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Herb Derby <herb@google.com>
* SkBlurMask to blur all the things.Gravatar Ben Wagner2018-05-08
| | | | | | | | | | | | | | | SkBlurMask used to handle only A8 as input, and was recently extended to ARGB as input. This adds LCD16 and A1 as inputs as well, allowing SkScalerContext to no longer force all requests with a mask filter to A8. This also fixes the shadows for LCD16 and A1 glyphs, which at small sigma were quite obviously wrong since they were generated from an A8 version. Change-Id: I151cdbf5556d18c2938da990ecee5bcd8ee31be8 Reviewed-on: https://skia-review.googlesource.com/126615 Reviewed-by: Herb Derby <herb@google.com> Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* Just pass color glyph masks to filters.Gravatar Ben Wagner2018-04-27
| | | | | | | | | | | | | | | Allow the filters to try to apply themselves to the color mask. Most mask filters will just return false, but allow them the opprotunity. This removes the behavior of trying to create a mask from the color mask. This updates the blur mask filter to handle kARGB32_Format directly by using just the alpha (which mirrors current behavior). Change-Id: I15eb736060ecf9b24aca874758c167b74d9ebc22 Reviewed-on: https://skia-review.googlesource.com/124185 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* hide SkBlurMaskFilter and SkBlurQualityGravatar Mike Reed2018-03-14
| | | | | | | | | | SK_SUPPORT_LEGACY_BLURMASKFILTER Bug: skia: Change-Id: Ic3e27e08e6e3cd2ffc1cd13b044e197bebc96236 Reviewed-on: https://skia-review.googlesource.com/113940 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
* remove unused ConvertRadiusToSigma from SkBlurMaskFilterGravatar Mike Reed2018-03-12
Bug: skia: Change-Id: I1726f22fc40ad61b1b0485bcda6d383614da1fdb Reviewed-on: https://skia-review.googlesource.com/113463 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Mike Reed <reed@google.com>